!218 Sync master branch for update to 128.3.0

From: @wk333 
Reviewed-by: @starlet-dx 
Signed-off-by: @starlet-dx
This commit is contained in:
openeuler-ci-bot 2024-10-09 02:21:31 +00:00 committed by Gitee
commit cbaf45aac0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
28 changed files with 55 additions and 1444 deletions

View File

@ -1,127 +0,0 @@
From 263682c9a29395055f3b3afe2d97be1828a6223f Mon Sep 17 00:00:00 2001
From: Jerome Jiang <jianj@google.com>
Date: Thu, 30 Jun 2022 13:48:56 -0400
Subject: [PATCH] Fix bug with smaller width bigger size
Fixed previous patch that clusterfuzz failed on.
Bug: webm:1642
Change-Id: If0e08e72abd2e042efe4dcfac21e4cc51afdfdb9
---
test/resize_test.cc | 11 +++--------
vp9/common/vp9_alloccommon.c | 13 ++++++-------
vp9/encoder/vp9_encoder.c | 27 +++++++++++++++++++++++++--
3 files changed, 34 insertions(+), 17 deletions(-)
diff --git a/test/resize_test.cc b/test/resize_test.cc
index fd1c2a92de6..20ad2229b46 100644
--- a/test/resize_test.cc
+++ b/test/resize_test.cc
@@ -102,11 +102,8 @@ void ScaleForFrameNumber(unsigned int frame, unsigned int initial_w,
if (frame < 30) {
return;
}
- if (frame < 100) {
- *w = initial_w * 7 / 10;
- *h = initial_h * 16 / 10;
- return;
- }
+ *w = initial_w * 7 / 10;
+ *h = initial_h * 16 / 10;
return;
}
if (frame < 10) {
@@ -559,9 +556,7 @@ TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
}
}
-// TODO(https://crbug.com/webm/1642): This causes a segfault in
-// init_encode_frame_mb_context().
-TEST_P(ResizeRealtimeTest, DISABLED_TestExternalResizeSmallerWidthBiggerSize) {
+TEST_P(ResizeRealtimeTest, TestExternalResizeSmallerWidthBiggerSize) {
ResizingVideoSource video;
video.flag_codec_ = true;
video.smaller_width_larger_size_ = true;
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c
index e53883f621d..9e73e40ea09 100644
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -135,13 +135,6 @@ int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) {
cm->free_mi(cm);
if (cm->alloc_mi(cm, new_mi_size)) goto fail;
}
-
- if (cm->seg_map_alloc_size < cm->mi_rows * cm->mi_cols) {
- // Create the segmentation map structure and set to 0.
- free_seg_map(cm);
- if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail;
- }
-
if (cm->above_context_alloc_cols < cm->mi_cols) {
vpx_free(cm->above_context);
cm->above_context = (ENTROPY_CONTEXT *)vpx_calloc(
@@ -156,6 +149,12 @@ int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) {
cm->above_context_alloc_cols = cm->mi_cols;
}
+ if (cm->seg_map_alloc_size < cm->mi_rows * cm->mi_cols) {
+ // Create the segmentation map structure and set to 0.
+ free_seg_map(cm);
+ if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail;
+ }
+
if (vp9_alloc_loop_filter(cm)) goto fail;
return 0;
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 69a4e3c314f..e3ba294c32f 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2047,6 +2047,17 @@ static void alloc_copy_partition_data(VP9_COMP *cpi) {
}
}
+static void free_copy_partition_data(VP9_COMP *cpi) {
+ vpx_free(cpi->prev_partition);
+ cpi->prev_partition = NULL;
+ vpx_free(cpi->prev_segment_id);
+ cpi->prev_segment_id = NULL;
+ vpx_free(cpi->prev_variance_low);
+ cpi->prev_variance_low = NULL;
+ vpx_free(cpi->copied_frame_cnt);
+ cpi->copied_frame_cnt = NULL;
+}
+
void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
VP9_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
@@ -2126,6 +2137,8 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
new_mi_size = cm->mi_stride * calc_mi_size(cm->mi_rows);
if (cm->mi_alloc_size < new_mi_size) {
vp9_free_context_buffers(cm);
+ vp9_free_pc_tree(&cpi->td);
+ vpx_free(cpi->mbmi_ext_base);
alloc_compressor_data(cpi);
realloc_segmentation_maps(cpi);
cpi->initial_width = cpi->initial_height = 0;
@@ -2144,8 +2157,18 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
update_frame_size(cpi);
if (last_w != cpi->oxcf.width || last_h != cpi->oxcf.height) {
- memset(cpi->consec_zero_mv, 0,
- cm->mi_rows * cm->mi_cols * sizeof(*cpi->consec_zero_mv));
+ vpx_free(cpi->consec_zero_mv);
+ CHECK_MEM_ERROR(
+ &cm->error, cpi->consec_zero_mv,
+ vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(*cpi->consec_zero_mv)));
+
+ vpx_free(cpi->skin_map);
+ CHECK_MEM_ERROR(
+ &cm->error, cpi->skin_map,
+ vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(cpi->skin_map[0])));
+
+ free_copy_partition_data(cpi);
+ alloc_copy_partition_data(cpi);
if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
vp9_cyclic_refresh_reset_resize(cpi);
rc->rc_1_frame = 0;

View File

@ -1,38 +0,0 @@
Origin: https://sqlite.org/src/info/0e4e7a05c4204b47
Index: third_party/sqlite3/src/sqlite3.c
==================================================================
--- a/third_party/sqlite3/src/sqlite3.c
+++ b/third_party/sqlite3/src/sqlite3.c
@@ -3234,19 +3234,23 @@
pIn->iNext += nByte;
}
}
}
if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){
- sqlite3_int64 v = sessionGetI64(aVal);
- if( eType==SQLITE_INTEGER ){
- sqlite3VdbeMemSetInt64(apOut[i], v);
+ if( (pIn->nData-pIn->iNext)<8 ){
+ rc = SQLITE_CORRUPT_BKPT;
}else{
- double d;
- memcpy(&d, &v, 8);
- sqlite3VdbeMemSetDouble(apOut[i], d);
+ sqlite3_int64 v = sessionGetI64(aVal);
+ if( eType==SQLITE_INTEGER ){
+ sqlite3VdbeMemSetInt64(apOut[i], v);
+ }else{
+ double d;
+ memcpy(&d, &v, 8);
+ sqlite3VdbeMemSetDouble(apOut[i], d);
+ }
+ pIn->iNext += 8;
}
- pIn->iNext += 8;
}
}
}
return rc;

View File

@ -1,42 +0,0 @@
diff --git a/js/src/jit/riscv64/CodeGenerator-riscv64.cpp b/js/src/jit/riscv64/CodeGenerator-riscv64.cpp
--- a/js/src/jit/riscv64/CodeGenerator-riscv64.cpp
+++ b/js/src/jit/riscv64/CodeGenerator-riscv64.cpp
@@ -1103,22 +1103,29 @@
masm.xor64(ToRegister64(lhs), ToRegister64(lhs));
return;
case 1:
// nop
return;
+ case 2:
+ masm.add(output.reg, ToRegister64(lhs).reg, ToRegister64(lhs).reg);
+ return;
default:
if (constant > 0) {
- if (mozilla::IsPowerOfTwo(static_cast<uint32_t>(constant + 1))) {
- masm.move64(ToRegister64(lhs), output);
- masm.lshift64(Imm32(FloorLog2(constant + 1)), output);
- masm.sub64(ToRegister64(lhs), output);
+ if (mozilla::IsPowerOfTwo(static_cast<uint64_t>(constant + 1))) {
+ ScratchRegisterScope scratch(masm);
+ masm.movePtr(ToRegister64(lhs).reg, scratch);
+ masm.slli(output.reg, ToRegister64(lhs).reg,
+ FloorLog2(constant + 1));
+ masm.sub64(scratch, output);
return;
} else if (mozilla::IsPowerOfTwo(
- static_cast<uint32_t>(constant - 1))) {
- masm.move64(ToRegister64(lhs), output);
- masm.lshift64(Imm32(FloorLog2(constant - 1u)), output);
- masm.add64(ToRegister64(lhs), output);
+ static_cast<uint64_t>(constant - 1))) {
+ int32_t shift = mozilla::FloorLog2(constant - 1);
+ ScratchRegisterScope scratch(masm);
+ masm.movePtr(ToRegister64(lhs).reg, scratch);
+ masm.slli(output.reg, ToRegister64(lhs).reg, shift);
+ masm.add64(scratch, output);
return;
}
// Use shift if constant is power of 2.
int32_t shift = mozilla::FloorLog2(constant);
if (int64_t(1) << shift == constant) {

File diff suppressed because one or more lines are too long

View File

@ -1,34 +0,0 @@
From e2dbfb2757ec5c45b7d1f0082031f27378c147c2 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Thu, 14 Dec 2023 07:50:41 +0000
Subject: [PATCH 2/6] add loongarch64 support for cty
---
third_party/rust/cty/.cargo-checksum.json | 2 +-
third_party/rust/cty/src/lib.rs | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/third_party/rust/cty/.cargo-checksum.json b/third_party/rust/cty/.cargo-checksum.json
index 902714f58a..3e65dbf70a 100644
--- a/third_party/rust/cty/.cargo-checksum.json
+++ b/third_party/rust/cty/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"077c738b5f2c05d66a12209edaabca887091db727d61164a7a414da23d8bf08f","Cargo.toml":"94a517ea6c7dad4634a9a2bd356f3a8035927e7ff8367bd5a975b4db4ccf8e6e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"035e70219855119df4273b3c5b97543ae82e0dd60c520416e759107c602f651b","README.md":"19687c50697e6abc991e4c35e6d674db56bd5e5ae0d5b833440718f8f154a74d","ci/install.sh":"9b34273d9e79ec59f63d5e3e7aea27b0db66194667f9730a21158740fa1b99f1","ci/script.sh":"54962430ca4d3528e5c0d44ff590b1504be13147db5cbe8bb82f1358528ef5f3","src/lib.rs":"33a38ce6df718fb0191f34ff2cefdcbd3ad9d93f0c4073b78eaf937c07fb7614"},"package":"b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"}
\ No newline at end of file
+{"files":{"CHANGELOG.md":"077c738b5f2c05d66a12209edaabca887091db727d61164a7a414da23d8bf08f","Cargo.toml":"94a517ea6c7dad4634a9a2bd356f3a8035927e7ff8367bd5a975b4db4ccf8e6e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"035e70219855119df4273b3c5b97543ae82e0dd60c520416e759107c602f651b","README.md":"19687c50697e6abc991e4c35e6d674db56bd5e5ae0d5b833440718f8f154a74d","ci/install.sh":"9b34273d9e79ec59f63d5e3e7aea27b0db66194667f9730a21158740fa1b99f1","ci/script.sh":"54962430ca4d3528e5c0d44ff590b1504be13147db5cbe8bb82f1358528ef5f3","src/lib.rs":"3e9ec28a0d13cfb47546e044b8fc3a32007f7c76994704c4164c4430a7167e39"},"package":"b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"}
diff --git a/third_party/rust/cty/src/lib.rs b/third_party/rust/cty/src/lib.rs
index 971c9cb3a9..80b8f3f291 100644
--- a/third_party/rust/cty/src/lib.rs
+++ b/third_party/rust/cty/src/lib.rs
@@ -24,6 +24,7 @@ pub use pwd::*;
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "s390x",
+ target_arch = "loongarch64",
target_arch = "riscv32",
target_arch = "riscv64"))]
mod ad {
--
2.41.0

View File

@ -1,27 +0,0 @@
From 4f9ab53eeabdc5966156601bda09f77fce057ba6 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Thu, 14 Dec 2023 09:47:06 +0000
Subject: [PATCH] add loongarch64 support for ipc
---
ipc/chromium/src/build/build_config.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h
index 511f36858c..f3a96feaf7 100644
--- a/ipc/chromium/src/build/build_config.h
+++ b/ipc/chromium/src/build/build_config.h
@@ -129,6 +129,9 @@
#elif defined(__riscv) && __riscv_xlen == 64
# define ARCH_CPU_RISCV64 1
# define ARCH_CPU_64_BITS 1
+#elif defined(__loongarch64)
+# define ARCH_CPU_LOONGARCH64 1
+# define ARCH_CPU_64_BITS 1
#else
# error Please add support for your architecture in build/build_config.h
#endif
--
2.41.0

File diff suppressed because one or more lines are too long

View File

@ -1,469 +0,0 @@
From 01ea3f7cf670d9e1f62a8f97474c84831d2e0e18 Mon Sep 17 00:00:00 2001
From: wujiahuan <wujiahuan161@gmail.com>
Date: Thu, 14 Dec 2023 12:40:12 +0000
Subject: [PATCH] backport Bug 1782159 to support loongarch64
https://hg.mozilla.org/mozilla-central/rev/f01044248c8595683ca1f625080c9aee51655966
---
xpcom/reflect/xptcall/md/unix/moz.build | 8 +
.../md/unix/xptcinvoke_asm_loongarch64.S | 91 ++++++++++
.../md/unix/xptcinvoke_loongarch64.cpp | 100 +++++++++++
.../md/unix/xptcstubs_asm_loongarch64.S | 53 ++++++
.../xptcall/md/unix/xptcstubs_loongarch64.cpp | 160 ++++++++++++++++++
5 files changed, 412 insertions(+)
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp
diff --git a/xpcom/reflect/xptcall/md/unix/moz.build b/xpcom/reflect/xptcall/md/unix/moz.build
index 1779c148cb..e74c936c38 100644
--- a/xpcom/reflect/xptcall/md/unix/moz.build
+++ b/xpcom/reflect/xptcall/md/unix/moz.build
@@ -271,6 +271,14 @@ if CONFIG["OS_ARCH"] == "Linux" and CONFIG["CPU_ARCH"] == "riscv64":
"xptcstubs_riscv64.cpp",
]
+if CONFIG["OS_ARCH"] == "Linux" and CONFIG["CPU_ARCH"] == "loongarch64":
+ SOURCES += [
+ "xptcinvoke_asm_loongarch64.S",
+ "xptcinvoke_loongarch64.cpp",
+ "xptcstubs_asm_loongarch64.S",
+ "xptcstubs_loongarch64.cpp",
+ ]
+
FINAL_LIBRARY = "xul"
LOCAL_INCLUDES += [
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S
new file mode 100644
index 0000000000..8769060aed
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S
@@ -0,0 +1,91 @@
+/* This Source Code Form subject to the terms of 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/.
+ */
+
+ .set NGPREGS, 8
+ .set NFPREGS, 8
+
+ .text
+ .globl _NS_InvokeByIndex
+ .type _NS_InvokeByIndex, @function
+/*
+ * _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ * uint32_t paramCount, nsXPTCVariant* params)
+ */
+_NS_InvokeByIndex:
+ .cfi_startproc
+ addi.d $sp, $sp, -32
+ .cfi_def_cfa_offset 32
+ st.d $s0, $sp, 16
+ .cfi_offset 23, -16
+ st.d $s1, $sp, 8
+ .cfi_offset 24, -24
+ st.d $s2, $sp, 0
+ .cfi_offset 25, -32
+ st.d $ra, $sp, 24
+ .cfi_offset 1, -8
+
+ move $s2, $a0
+ move $s1, $a1
+ move $s0, $sp
+ .cfi_def_cfa_register 23
+
+ /* 16-bytes alignment */
+ addi.d $a0, $a2, 1
+ li.d $t4, 0xfffffffffffffffe
+ and $a0, $a0, $t4
+ slli.d $a0, $a0, 3
+ sub.d $sp, $sp, $a0
+ move $a4, $sp
+
+ addi.d $sp, $sp, -8*(NFPREGS+NGPREGS)
+ move $a0, $sp
+ addi.d $a1, $sp, 8*NGPREGS
+
+ bl invoke_copy_to_stack
+
+ /* 1st argument is this */
+ move $a0, $s2
+
+ ld.d $a1, $sp, 8
+ ld.d $a2, $sp, 16
+ ld.d $a3, $sp, 24
+ ld.d $a4, $sp, 32
+ ld.d $a5, $sp, 40
+ ld.d $a6, $sp, 48
+ ld.d $a7, $sp, 56
+
+ fld.d $fa0, $sp, 64
+ fld.d $fa1, $sp, 72
+ fld.d $fa2, $sp, 80
+ fld.d $fa3, $sp, 88
+ fld.d $fa4, $sp, 96
+ fld.d $fa5, $sp, 104
+ fld.d $fa6, $sp, 112
+ fld.d $fa7, $sp, 120
+
+ addi.d $sp, $sp, 8*(NGPREGS+NFPREGS)
+
+ ld.d $s2, $s2, 0
+ slli.w $s1, $s1, 3
+ add.d $s2, $s2, $s1
+ ld.d $t3, $s2, 0
+ jirl $ra, $t3, 0
+
+ move $sp, $s0
+ .cfi_def_cfa_register 3
+ ld.d $s0, $sp, 16
+ .cfi_restore 23
+ ld.d $s1, $sp, 8
+ .cfi_restore 24
+ ld.d $s2, $sp, 0
+ .cfi_restore 25
+ ld.d $ra, $sp, 24
+ .cfi_restore 1
+ addi.d $sp, $sp, 32
+ .cfi_def_cfa_offset -32
+ jirl $zero, $ra, 0
+ .cfi_endproc
+ .size _NS_InvokeByIndex, .-_NS_InvokeByIndex
+ .section .note.GNU-stack, "", @progbits
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp
new file mode 100644
index 0000000000..61bb7b2efd
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp
@@ -0,0 +1,100 @@
+/* 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/. */
+
+// Platform specific code to invoke XPCOM methods on native objects
+
+#include "xptcprivate.h"
+
+extern "C" void invoke_copy_to_stack(uint64_t* gpregs, double* fpregs,
+ uint32_t paramCount, nsXPTCVariant* s,
+ uint64_t* d) {
+ static const uint32_t GPR_COUNT = 8;
+ static const uint32_t FPR_COUNT = 8;
+
+ uint32_t nr_gpr = 1; // skip one GPR register for "this"
+ uint32_t nr_fpr = 0;
+ uint64_t value = 0;
+
+ for (uint32_t i = 0; i < paramCount; i++, s++) {
+ if (s->IsIndirect()) {
+ value = (uint64_t)&s->val;
+ } else {
+ switch (s->type) {
+ case nsXPTType::T_FLOAT:
+ break;
+ case nsXPTType::T_DOUBLE:
+ break;
+ case nsXPTType::T_I8:
+ value = s->val.i8;
+ break;
+ case nsXPTType::T_I16:
+ value = s->val.i16;
+ break;
+ case nsXPTType::T_I32:
+ value = s->val.i32;
+ break;
+ case nsXPTType::T_I64:
+ value = s->val.i64;
+ break;
+ case nsXPTType::T_U8:
+ value = s->val.u8;
+ break;
+ case nsXPTType::T_U16:
+ value = s->val.u16;
+ break;
+ case nsXPTType::T_U32:
+ value = s->val.u32;
+ break;
+ case nsXPTType::T_U64:
+ value = s->val.u64;
+ break;
+ case nsXPTType::T_BOOL:
+ value = s->val.b;
+ break;
+ case nsXPTType::T_CHAR:
+ value = s->val.c;
+ break;
+ case nsXPTType::T_WCHAR:
+ value = s->val.wc;
+ break;
+ default:
+ value = (uint64_t)s->val.p;
+ break;
+ }
+ }
+
+ if (!s->IsIndirect() && s->type == nsXPTType::T_DOUBLE) {
+ if (nr_fpr < FPR_COUNT) {
+ fpregs[nr_fpr++] = s->val.d;
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&gpregs[nr_gpr++], &(s->val.d), sizeof(s->val.d));
+ } else {
+ memcpy(d++, &(s->val.d), sizeof(s->val.d));
+ }
+ } else if (!s->IsIndirect() && s->type == nsXPTType::T_FLOAT) {
+ if (nr_fpr < FPR_COUNT) {
+ memcpy(&fpregs[nr_fpr++], &(s->val.f), sizeof(s->val.f));
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&gpregs[nr_gpr++], &(s->val.f), sizeof(s->val.f));
+ } else {
+ memcpy(d++, &(s->val.f), sizeof(s->val.f));
+ }
+ } else {
+ if (nr_gpr < GPR_COUNT) {
+ gpregs[nr_gpr++] = value;
+ } else {
+ *d++ = value;
+ }
+ }
+ }
+}
+
+extern "C" nsresult _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ uint32_t paramCount,
+ nsXPTCVariant* params);
+EXPORT_XPCOM_API(nsresult)
+NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, uint32_t paramCount,
+ nsXPTCVariant* params) {
+ return _NS_InvokeByIndex(that, methodIndex, paramCount, params);
+}
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S
new file mode 100644
index 0000000000..5041de962c
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S
@@ -0,0 +1,53 @@
+# 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/.
+
+ .set NGPRGES, 8
+ .set NFPREGS, 8
+
+ .text
+ .globl SharedStub
+ .hidden SharedStub
+ .type SharedStub,@function
+
+SharedStub:
+ .cfi_startproc
+ move $t0, $sp
+ addi.d $sp, $sp, -8*(NGPRGES+NFPREGS)-16
+ .cfi_def_cfa_offset 8*(NGPRGES+NFPREGS)+16
+ st.d $a0, $sp, 0
+ st.d $a1, $sp, 8
+ st.d $a2, $sp, 16
+ st.d $a3, $sp, 24
+ st.d $a4, $sp, 32
+ st.d $a5, $sp, 40
+ st.d $a6, $sp, 48
+ st.d $a7, $sp, 56
+ fst.d $fa0, $sp, 64
+ fst.d $fa1, $sp, 72
+ fst.d $fa2, $sp, 80
+ fst.d $fa3, $sp, 88
+ fst.d $fa4, $sp, 96
+ fst.d $fa5, $sp, 104
+ fst.d $fa6, $sp, 112
+ fst.d $fa7, $sp, 120
+ st.d $ra, $sp, 136
+ .cfi_offset 1, 136
+
+ /* methodIndex is passed from stub */
+ move $a1, $t6
+ move $a2, $t0
+ move $a3, $sp
+ addi.d $a4, $sp, 8*NGPRGES
+
+ bl PrepareAndDispatch
+
+ ld.d $ra, $sp, 136
+ .cfi_restore 1
+ addi.d $sp, $sp, 8*(NGPRGES+NFPREGS)+16
+ .cfi_def_cfa_offset -8*(NGPRGES+NFPREGS)-16
+ jirl $zero, $ra, 0
+ .cfi_endproc
+
+ .size SharedStub, .-SharedStub
+ .section .note.GNU-stack, "", @progbits
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp
new file mode 100644
index 0000000000..1ea4289045
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp
@@ -0,0 +1,160 @@
+/* -*- Mode: C; tab-width: 8; 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 "xptcprivate.h"
+
+extern "C" nsresult ATTRIBUTE_USED PrepareAndDispatch(nsXPTCStubBase* self,
+ uint32_t methodIndex,
+ uint64_t* args,
+ uint64_t* gpregs,
+ double* fpregs) {
+ static const uint32_t GPR_COUNT = 8;
+ static const uint32_t FPR_COUNT = 8;
+ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
+ const nsXPTMethodInfo* info;
+
+ self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
+
+ uint32_t paramCount = info->GetParamCount();
+ const uint8_t indexOfJSContext = info->IndexOfJSContext();
+
+ uint64_t* ap = args;
+ uint32_t nr_gpr = 1; // skip the arg which is 'self'
+ uint32_t nr_fpr = 0;
+ uint64_t value;
+
+ for (uint32_t i = 0; i < paramCount; i++) {
+ const nsXPTParamInfo& param = info->GetParam(i);
+ const nsXPTType& type = param.GetType();
+ nsXPTCMiniVariant* dp = &paramBuffer[i];
+
+ if (i == indexOfJSContext) {
+ if (nr_gpr < GPR_COUNT)
+ nr_gpr++;
+ else
+ ap++;
+ }
+
+ if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
+ if (nr_fpr < FPR_COUNT) {
+ dp->val.d = fpregs[nr_fpr++];
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&dp->val.d, &gpregs[nr_gpr++], sizeof(dp->val.d));
+ } else {
+ memcpy(&dp->val.d, ap++, sizeof(dp->val.d));
+ }
+ continue;
+ }
+
+ if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
+ if (nr_fpr < FPR_COUNT) {
+ memcpy(&dp->val.f, &fpregs[nr_fpr++], sizeof(dp->val.f));
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&dp->val.f, &gpregs[nr_gpr++], sizeof(dp->val.f));
+ } else {
+ memcpy(&dp->val.f, ap++, sizeof(dp->val.f));
+ }
+ continue;
+ }
+
+ if (nr_gpr < GPR_COUNT) {
+ value = gpregs[nr_gpr++];
+ } else {
+ value = *ap++;
+ }
+
+ if (param.IsOut() || !type.IsArithmetic()) {
+ dp->val.p = (void*)value;
+ continue;
+ }
+
+ switch (type) {
+ case nsXPTType::T_I8:
+ dp->val.i8 = (int8_t)value;
+ break;
+ case nsXPTType::T_I16:
+ dp->val.i16 = (int16_t)value;
+ break;
+ case nsXPTType::T_I32:
+ dp->val.i32 = (int32_t)value;
+ break;
+ case nsXPTType::T_I64:
+ dp->val.i64 = (int64_t)value;
+ break;
+ case nsXPTType::T_U8:
+ dp->val.u8 = (uint8_t)value;
+ break;
+ case nsXPTType::T_U16:
+ dp->val.u16 = (uint16_t)value;
+ break;
+ case nsXPTType::T_U32:
+ dp->val.u32 = (uint32_t)value;
+ break;
+ case nsXPTType::T_U64:
+ dp->val.u64 = (uint64_t)value;
+ break;
+ case nsXPTType::T_BOOL:
+ dp->val.b = (bool)(uint8_t)value;
+ break;
+ case nsXPTType::T_CHAR:
+ dp->val.c = (char)value;
+ break;
+ case nsXPTType::T_WCHAR:
+ dp->val.wc = (wchar_t)value;
+ break;
+ default:
+ NS_ERROR("bad type");
+ break;
+ }
+ }
+
+ nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
+ paramBuffer);
+ return result;
+}
+
+// Load $t6 with the constant 'n' and branch to SharedStub().
+// clang-format off
+#define STUB_ENTRY(n) \
+ __asm__( \
+ ".text\n\t" \
+ ".if "#n" < 10 \n\t" \
+ ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
+ ".hidden _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
+ ".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n" \
+ "_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \
+ ".elseif "#n" < 100 \n\t" \
+ ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
+ ".hidden _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
+ ".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n" \
+ "_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \
+ ".elseif "#n" < 1000 \n\t" \
+ ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
+ ".hidden _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
+ ".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n" \
+ "_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \
+ ".else \n\t" \
+ ".err \"stub number "#n" >= 1000 not yet supported\"\n" \
+ ".endif \n\t" \
+ "li.d $t6, "#n" \n\t" \
+ "b SharedStub \n" \
+ ".if "#n" < 10 \n\t" \
+ ".size _ZN14nsXPTCStubBase5Stub"#n"Ev,.-_ZN14nsXPTCStubBase5Stub"#n"Ev\n\t" \
+ ".elseif "#n" < 100 \n\t" \
+ ".size _ZN14nsXPTCStubBase6Stub"#n"Ev,.-_ZN14nsXPTCStubBase6Stub"#n"Ev\n\t" \
+ ".else \n\t" \
+ ".size _ZN14nsXPTCStubBase7Stub"#n"Ev,.-_ZN14nsXPTCStubBase7Stub"#n"Ev\n\t" \
+ ".endif" \
+);
+// clang-format on
+
+#define SENTINEL_ENTRY(n) \
+ nsresult nsXPTCStubBase::Sentinel##n() { \
+ NS_ERROR("nsXPTCStubBase::Sentinel called"); \
+ return NS_ERROR_NOT_IMPLEMENTED; \
+ }
+
+#include "xptcstubsdef.inc"
--
2.41.0

Binary file not shown.

View File

@ -1,14 +0,0 @@
--- firefox-115.4.0/python/sites/mach.txt 2023-10-17 10:48:58.000000000 +0800
+++ firefox-115.4.0/python/sites/mach.txt 2023-11-15 11:10:22.840955542 +0800
@@ -135,11 +135,3 @@
pth:xpcom/ds/tools
pth:xpcom/geckoprocesstypes_generator
pth:xpcom/idl-parser
-# glean-sdk may not be installable if a wheel isn't available
-# and it has to be built from source.
-pypi-optional:glean-sdk==52.7.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).
-pypi-optional:psutil>=5.4.2,<=5.9.4:telemetry will be missing some data
-pypi-optional:zstandard>=0.11.1,<=0.22.0:zstd archives will not be possible to extract

View File

@ -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

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEErdcHlHlwDcrf3VM34207E/PZMnQFAmbMkacACgkQ4207E/PZ
MnQIMRAApCTh0QtB534WKg8rOh4EXq1JPVq0geZeYod/7ogTcf0ePybfrO2dGeIv
vbzfm4NZsIkcznLvYj/0LpkiA3WRXNwO0Rlxrh2CcnwjAFpLMhSs7iIXFy+sPv3u
Pn3v0rZiHwvunA8dyLtQjOYgRTeJ+FCorD6lowhM722uMjUEp2vYocgztDeDY8tS
ZHdud1FLBybC3eT0DB/KfCCcNmIETk1NVm3MoyKz7+2AcMMEXKbP/mIWHKPh82wn
w0m+hjdfEYzWIQZqQwuypil4dfQ59hxZfU+/L5MFrLV5iBDS8gexjZKzUYQjHi2E
ismmfZdscqFsTzDhXdKhi5d5aFIJ65T+7ZVXK00lBzCBnWGMXTdBNEweXAeqseaX
yDyLKouaO5HnptTH88zrSEoKpAYpAVwgKxNUM+HjolqagHPBnRZENfZZ+272m7YI
NmwFBBE/gonJbOaNbkmdpPPlCrLuyXozMo5alRRAsOLDn9eHsVosg/PpYzXcs1z3
BB60WU+/DNtQ36Oe/enMO5KhY/mHneoxk7VRIyaixyQoJuLv8/NYRB2YT92EWDut
Nhd6pdsMVD313F5d59NwdUOmGpW7SfmDcgJnHgLdFHddAhTk+4291eGxgSJP/g5m
9z5aUbuNlPlyAXVNUiPFkiSoOvFXtMRDDrDHomyCl7MVSEHDHxc=
=9hCE
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEErdcHlHlwDcrf3VM34207E/PZMnQFAmbxkrMACgkQ4207E/PZ
MnQ8khAA0WUg/6Ykv2Mbxq1840nUwoTqBy2OMyqCR4kuqHVJlKIbTn8U1Fqde4RS
qwgqkQ+eJUk6IAG/32KBZWJHsTFTUs+D0GYB+xqJnFGHDBcaK9IdvQz7SIIqzJUu
MlAqqbQm/vXfrVqjyIEvvG9dIaYVe85L3/KKGDcHQOSMGZxsTX/MvqOMMjGH7J6w
/kTFVjMcbrpjs1w1ovDtanNe66JNvuEnR5mdLvXa9o7Dg90ujJxq1jC/Z6h7A17f
lsey0v+7nbUBINhdiFNgg3HBlm6aj4axghd4SkEKB1Vb4eCZmlzqY0JgKY6Xw8FM
w9kKPAntGMaUXlSn0yR+XFlrwngTpi48+Ljgi/SxnKEGGOnWOj8XPpx0uxiRrIfp
xNpK/rDUT+5EEFkap7Prr0huIBzYE50H/JKx8hVIwHQFbPe/oLZE1IAwepG8wcxv
HQuYcYh+L+LG1uKqdLSlMi5EmLizobU0JWw+t989eR6wEPAyp5w+FZmYdNt9dgrk
33nc72RdaCFmkDOpF++uLf8I/s4hrpIEQ4DU5XHnaHdUFg0W7B6/BR7d1YACljHs
CkNm3XKcgYJJBeKHEskU5NozMpBbDC0OoXNzgGwpT1z2AmvsCI7JdAHTgSflTXe7
wX/7t30hbGGzFdC9fJ6ZqUsC7EmZzPtpDmY5XI50yx9uZL32rhk=
=1kCT
-----END PGP SIGNATURE-----

View File

@ -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);

View File

@ -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):

View File

@ -64,25 +64,8 @@ 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"
##
## Enable Wayland backend?
##
%DISABLE_WAYLAND_PLACEHOLDER%
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.
##

View File

@ -15,9 +15,10 @@
%global build_tests 1
%endif
%global system_nss 1
# TODO: Revert this after SM2 & SM3 issue is fixed
%global system_nss 0
%global llvm_version 7.0
%global rust_version 1.66
%global rust_version 1.77
%global wayland_backend_default 0
%global system_av1 0
@ -27,8 +28,7 @@
%if %{?system_nss}
%global nspr_version 4.35
%global nspr_version_max 4.36
%global nss_version 3.90
%global nss_version_max 3.95
%global nss_version 3.101
%endif
%global mozappdir %{_libdir}/firefox
@ -44,7 +44,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 115.15.0
Version: 128.3.0
Release: 1
URL: https://www.mozilla.org/firefox/
License: MPL-1.1 or GPL-2.0-or-later or LGPL-2.0-or-later
@ -77,69 +77,43 @@ Source36: testing.sh
Source37: mochitest-python.tar.gz
# Build patches
Patch01: disable-glean-sdk,psutil,zstandard.patch
Patch02: firefox-gcc-build.patch
Patch01: firefox-gcc-build.patch
# -- Upstreamed patches --
Patch51: mozilla-bmo1170092.patch
Patch52: CVE-2023-7104.patch
# -- Submitted upstream, not merged --
Patch101: mozilla-bmo1636168-fscreen.patch
Patch102: mozilla-bmo1670333.patch
# Big endian fix
Patch103: mozilla-bmo1504834-part1.patch
Patch104: mozilla-bmo1504834-part3.patch
# Big endian fix
Patch105: mozilla-bmo849632.patch
# Big endian fix
Patch106: mozilla-bmo998749.patch
# Big endian fix
Patch107: mozilla-bmo1716707-swizzle.patch
Patch108: mozilla-bmo1716707-svg.patch
# ---- Fedora specific patches ----
# Enable user addons
Patch151: firefox-enable-addons.patch
Patch152: rhbz-1173156.patch
Patch153: fedora-shebang-build.patch
Patch154: firefox-nss-addon-hack.patch
# ARM run-time patch
Patch155: rhbz-1354671.patch
Patch153: firefox-nss-addon-hack.patch
# Specific ARM run-time patch below
Patch154: rhbz-1354671.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
Patch201: firefox-tests-xpcshell-freeze.patch
# ---- Security patches ----
Patch301: CVE-2023-44488-libvpx.patch
# system AV1 patches (from Gentoo)
Patch800: bmo-1559213-Support-system-av1.patch
Patch801: bmo-1559213-fix-system-av1-libs.patch
# Arch specific patches
# ---- RISCV64 patches ----
# Fix register conflict in MulI64.r=jseward
# https://phabricator.services.mozilla.com/D188068
Patch1001: D188068.diff
Patch1002: add-loongarch64-support-for-nix.patch
Patch1003: add-loongarch64-support-for-cty.patch
Patch1004: add-loongarch64-support-for-authenticator.patch
Patch1005: add-loongarch64-support-for-ipc.patch
Patch1006: add-loongarch64-support-for-libwebrtc.patch
Patch1007: backport-Bug-1782159-to-support-loongarch64.patch
# ---- LOONGARCH patches ----
Patch1002: add-loongarch64-support-for-libwebrtc.patch
# BUILD REQURES/REQUIRES
%if %{?system_nss}
BuildRequires: pkgconfig(nspr) >= %{nspr_version}
BuildRequires: pkgconfig(nspr) < %{nspr_version_max}
BuildRequires: pkgconfig(nss) >= %{nss_version}
BuildRequires: pkgconfig(nss) < %{nss_version_max}
BuildRequires: nss-static >= %{nss_version}
BuildRequires: nss-static < %{nss_version_max}
%endif
BuildRequires: bzip2-devel
@ -401,40 +375,24 @@ rm -vf ./*/testing/web-platform/tests/conformance-checkers/html-rdfa/0231-isvali
rm -vf ./*/layout/inspector/tests/chrome/test_fontVariationsAPI.css
# Build patches
%patch -P1 -p1
%patch -P2 -p1 -b .firefox-gcc-build
%patch -P1 -p1 -b .firefox-gcc-build
# -- Upstreamed patches --
%patch -P51 -p1 -b .mozilla-bmo1170092
%patch -P52 -p1
# -- Submitted upstream, not merged --
%patch -P101 -p1 -b .mozilla-bmo1636168-fscreen
%patch -P102 -p1 -b .mozilla-bmo1670333
%patch -P103 -p1 -b .mozilla-bmo1504834-part1
%patch -P104 -p1 -b .mozilla-bmo1504834-part3
%patch -P105 -p1 -b .mozilla-bmo849632
%patch -P106 -p1 -b .mozilla-bmo998749
%patch -P107 -p1 -b .mozilla-bmo1716707-swizzle
%patch -P108 -p1 -b .mozilla-bmo1716707-svg
# ---- Fedora specific patches ----
# ---- Specific patches ----
%patch -P151 -p1 -b .addons
%patch -P152 -p1 -b .rhbz-1173156
%patch -P153 -p1 -b .fedora-shebang
%patch -P154 -p1 -b .addons-nss-hack
%patch -P153 -p1 -b .addons-nss-hack
# ARM run-time patch
%ifarch aarch64
%patch -P155 -p1 -b .rhbz-1354671
%patch -P154 -p1 -b .rhbz-1354671
%endif
# ---- Test patches ----
%patch -P201 -p1 -b .firefox-tests-xpcshell-freeze
# ---- Security patches ----
cd media/libvpx/libvpx
%patch -P301 -p1 -b .CVE-2023-44488-libvpx
cd -
# system AV1 patches
%if %{system_av1}
@ -443,15 +401,11 @@ cd -
%endif
# RISCV64 patches
%patch -P1001 -p1 -b .D188068
#LoongArch64 patches
%ifarch loongarch64
%patch -P1002 -p1
%patch -P1003 -p1
%patch -P1004 -p1
%patch -P1005 -p1
%patch -P1006 -p1
%patch -P1007 -p1
%endif
%{__rm} -f .mozconfig
%{__cp} %{SOURCE10} .mozconfig
@ -606,6 +560,7 @@ chmod a+x %{_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//')
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-fexceptions//')
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-Werror=format-security//')
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fpermissive"
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now"
@ -856,9 +811,6 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries
%{__cp} failures-* %{buildroot}/%{version}-%{release}/ || true
%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
@ -938,7 +890,6 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%dir %{langpackdir}
%endif
%{mozappdir}/browser/omni.ja
%{mozappdir}/run-mozilla.sh
%{mozappdir}/application.ini
%{mozappdir}/pingsender
%exclude %{mozappdir}/removed-files
@ -959,17 +910,29 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{mozappdir}/dictionaries
%{mozappdir}/omni.ja
%{mozappdir}/platform.ini
%{mozappdir}/plugin-container
%{mozappdir}/gmp-clearkey
%{mozappdir}/fonts/TwemojiMozilla.ttf
%{mozappdir}/glxtest
%{mozappdir}/vaapitest
%ifarch aarch64 riscv64
%{mozappdir}/v4l2test
%endif
%if !%{?system_nss}
%exclude %{mozappdir}/libnssckbi.so
%endif
%changelog
* Tue Oct 08 2024 wangkai <13474090681@163.com> - 128.3.0-1
- Update to 128.3.0
- Fix CVE-2024-9392 CVE-2024-9393 CVE-2024-9394 CVE-2024-9396
CVE-2024-9397 CVE-2024-9398 CVE-2024-9399 CVE-2024-9400 CVE-2024-9401
CVE-2024-9402
* Thu Sep 05 2024 misaka00251 <liuxin@iscas.ac.cn> - 128.2.0-1
- Upgrade to 128.2.0
- Fix CVE-2024-8385 CVE-2024-8386 CVE-2024-8387
* Wed Sep 04 2024 wangkai <13474090681@163.com> - 115.15.0-1
- Update to 115.15.0
- Fix CVE-2024-8381 CVE-2024-8382 CVE-2024-8383 CVE-2024-8384

View File

@ -1,95 +0,0 @@
diff -up firefox-115.0.2/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-115.0.2/extensions/pref/autoconfig/src/nsReadConfig.cpp
--- firefox-115.0.2/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2023-07-10 21:08:53.000000000 +0200
+++ firefox-115.0.2/extensions/pref/autoconfig/src/nsReadConfig.cpp 2023-07-17 10:33:23.443355156 +0200
@@ -263,8 +263,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/<application>/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-115.0.2/modules/libpref/Preferences.cpp.1170092 firefox-115.0.2/modules/libpref/Preferences.cpp
--- firefox-115.0.2/modules/libpref/Preferences.cpp.1170092 2023-07-10 21:09:00.000000000 +0200
+++ firefox-115.0.2/modules/libpref/Preferences.cpp 2023-07-17 10:33:23.444355156 +0200
@@ -4825,6 +4825,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<nsZipFind> find;
diff -up firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp
--- firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp.1170092 2023-07-10 22:57:20.000000000 +0200
+++ firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp 2023-07-17 10:56:25.309692121 +0200
@@ -72,6 +72,7 @@
#endif
#ifdef XP_UNIX
# include <ctype.h>
+# include "nsIXULAppInfo.h"
#endif
#ifdef XP_IOS
# include "UIKitDirProvider.h"
@@ -478,6 +479,17 @@ nsXREDirProvider::GetFile(const char* aP
rv = file->AppendNative(nsLiteralCString(PREF_OVERRIDE_DIRNAME));
NS_ENSURE_SUCCESS(rv, rv);
rv = EnsureDirectoryExists(file);
+ } else if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) {
+ nsCString sysConfigDir = nsLiteralCString("/etc/");
+ nsCOMPtr<nsIXULAppInfo> 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);
+ NS_NewNativeLocalFile(sysConfigDir, false, getter_AddRefs(file));
+ rv = EnsureDirectoryExists(file);
} else {
// We don't know anything about this property. Fail without warning, because
// otherwise we'll get too much warning spam due to
@@ -694,6 +706,16 @@ nsXREDirProvider::GetFiles(const char* a
}
#endif
+ // Add /etc/<application>/pref/ directory if it exists
+ nsCOMPtr<nsIFile> 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-115.0.2/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-115.0.2/xpcom/io/nsAppDirectoryServiceDefs.h
--- firefox-115.0.2/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2023-07-10 21:09:13.000000000 +0200
+++ firefox-115.0.2/xpcom/io/nsAppDirectoryServiceDefs.h 2023-07-17 10:33:23.444355156 +0200
@@ -58,6 +58,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"

View File

@ -1,86 +0,0 @@
diff -up firefox-115.2.0/gfx/2d/DrawTargetSkia.cpp.mozilla-bmo1504834-part1 firefox-115.2.0/gfx/2d/DrawTargetSkia.cpp
--- firefox-115.2.0/gfx/2d/DrawTargetSkia.cpp.mozilla-bmo1504834-part1 2023-09-20 22:15:11.850172571 +0200
+++ firefox-115.2.0/gfx/2d/DrawTargetSkia.cpp 2023-09-20 22:16:10.446147737 +0200
@@ -156,8 +156,8 @@ static IntRect CalculateSurfaceBounds(co
}
static const int kARGBAlphaOffset =
- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
-
+ 0; // Skia is always BGRA SurfaceFormat::A8R8G8B8_UINT32 ==
+ // SurfaceFormat::B8G8R8A8 ? 3 : 0;
static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
const int32_t aStride, SurfaceFormat aFormat) {
if (aFormat != SurfaceFormat::B8G8R8X8 || aSize.IsEmpty()) {
diff -up firefox-115.2.0/gfx/2d/Types.h.mozilla-bmo1504834-part1 firefox-115.2.0/gfx/2d/Types.h
--- firefox-115.2.0/gfx/2d/Types.h.mozilla-bmo1504834-part1 2023-08-21 15:43:23.000000000 +0200
+++ firefox-115.2.0/gfx/2d/Types.h 2023-09-20 22:15:11.850172571 +0200
@@ -89,18 +89,11 @@ enum class SurfaceFormat : int8_t {
// This represents the unknown format.
UNKNOWN, // TODO: Replace uses with Maybe<SurfaceFormat>.
-// The following values are endian-independent synonyms. The _UINT32 suffix
-// indicates that the name reflects the layout when viewed as a uint32_t
-// value.
-#if MOZ_LITTLE_ENDIAN()
+ // The following values are endian-independent synonyms. The _UINT32 suffix
+ // indicates that the name reflects the layout when viewed as a uint32_t
+ // value.
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB
-#elif MOZ_BIG_ENDIAN()
- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
- X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB
-#else
-# error "bad endianness"
-#endif
// The following values are OS and endian-independent synonyms.
//
diff -up firefox-115.2.0/gfx/skia/skia/modules/skcms/skcms.cc.mozilla-bmo1504834-part1 firefox-115.2.0/gfx/skia/skia/modules/skcms/skcms.cc
--- firefox-115.2.0/gfx/skia/skia/modules/skcms/skcms.cc.mozilla-bmo1504834-part1 2023-08-21 15:43:23.000000000 +0200
+++ firefox-115.2.0/gfx/skia/skia/modules/skcms/skcms.cc 2023-09-20 22:15:11.851172570 +0200
@@ -30,6 +30,8 @@
#include <avx512fintrin.h>
#include <avx512dqintrin.h>
#endif
+#else
+ #define SKCMS_PORTABLE
#endif
static bool runtime_cpu_detection = true;
@@ -324,20 +326,28 @@ enum {
static uint16_t read_big_u16(const uint8_t* ptr) {
uint16_t be;
memcpy(&be, ptr, sizeof(be));
-#if defined(_MSC_VER)
- return _byteswap_ushort(be);
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ return be;
#else
- return __builtin_bswap16(be);
+ #if defined(_MSC_VER)
+ return _byteswap_ushort(be);
+ #else
+ return __builtin_bswap16(be);
+ #endif
#endif
}
static uint32_t read_big_u32(const uint8_t* ptr) {
uint32_t be;
memcpy(&be, ptr, sizeof(be));
-#if defined(_MSC_VER)
- return _byteswap_ulong(be);
+#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__
+ return be;
#else
- return __builtin_bswap32(be);
+ #if defined(_MSC_VER)
+ return _byteswap_ulong(be);
+ #else
+ return __builtin_bswap32(be);
+ #endif
#endif
}

View File

@ -1,17 +0,0 @@
# HG changeset patch
# Parent 09cd4ac2cc607e85aa572425b824fbab386af607
For FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the
right of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white).
diff --git a/gfx/skia/skia/src/opts/SkBlitMask_opts.h b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
--- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h
+++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
@@ -210,6 +210,8 @@ namespace SK_OPTS_NS {
// ~~~>
// a = 1*aa + d(1-1*aa) = aa + d(1-aa)
// c = 0*aa + d(1-1*aa) = d(1-aa)
+ // TODO: Check this for endian-issues!
+ // Do we need to switch 255 to the front for all of those tuples?
return (aa & Sk4px(skvx::byte16{0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255}))
+ d.approxMulDiv255(aa.inv());
};

View File

@ -1,82 +0,0 @@
diff -up firefox-114.0/widget/gtk/nsWindow.cpp.D110204-fscreen.diff firefox-114.0/widget/gtk/nsWindow.cpp
--- firefox-114.0/widget/gtk/nsWindow.cpp.D110204-fscreen.diff 2023-05-17 10:43:02.000000000 +0200
+++ firefox-114.0/widget/gtk/nsWindow.cpp 2023-05-17 13:53:54.000443278 +0200
@@ -100,6 +100,7 @@
#include "ScreenHelperGTK.h"
#include "SystemTimeConverter.h"
#include "WidgetUtilsGtk.h"
+#include "nsIBrowserHandler.h"
#ifdef ACCESSIBILITY
# include "mozilla/a11y/LocalAccessible.h"
@@ -173,7 +174,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK | GDK_SCROLL_MASK |
- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
+ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
+ GDK_FOCUS_CHANGE_MASK;
/* utility functions */
static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
@@ -433,7 +435,8 @@ nsWindow::nsWindow()
mResizedAfterMoveToRect(false),
mConfiguredClearColor(false),
mGotNonBlankPaint(false),
- mNeedsToRetryCapturingMouse(false) {
+ mNeedsToRetryCapturingMouse(false),
+ mPendingFullscreen(false) {
mWindowType = WindowType::Child;
mSizeConstraints.mMaxSize = GetSafeWindowSize(mSizeConstraints.mMaxSize);
@@ -5263,6 +5266,19 @@ void nsWindow::OnWindowStateEvent(GtkWid
ClearTransparencyBitmap();
}
}
+
+ // Hack to ensure window switched to fullscreen - avoid to fail when starting
+ // in kiosk mode
+ if (mPendingFullscreen &&
+ !(aEvent->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
+ LOG(
+ " Window should be fullscreen, but it's not, retrying set to "
+ "fullscreen.\n");
+ MakeFullScreen(true);
+ } else {
+ LOG(" Window successfully switched to fullscreen, happy now\n");
+ mPendingFullscreen = false;
+ }
}
void nsWindow::OnDPIChanged() {
@@ -7409,6 +7425,19 @@ nsresult nsWindow::MakeFullScreen(bool a
}
}
+ // if in kiosk, ensure the fullscreen is called
+ nsCOMPtr<nsIBrowserHandler> browserHandler =
+ do_GetService("@mozilla.org/browser/clh;1");
+ if (browserHandler) {
+ bool isKiosk;
+ browserHandler->GetKiosk(&isKiosk);
+ if (isKiosk) {
+ LOG(" is kiosk, ensure the window switch to fullscreen\n");
+ mPendingFullscreen = true;
+ }
+ } else {
+ LOG(" Cannot find the browserHandler service.\n");
+ }
gtk_window_fullscreen(GTK_WINDOW(mShell));
} else {
gtk_window_unfullscreen(GTK_WINDOW(mShell));
diff -up firefox-114.0/widget/gtk/nsWindow.h.D110204-fscreen.diff firefox-114.0/widget/gtk/nsWindow.h
--- firefox-114.0/widget/gtk/nsWindow.h.D110204-fscreen.diff 2023-05-17 08:46:16.000000000 +0200
+++ firefox-114.0/widget/gtk/nsWindow.h 2023-05-17 13:51:29.502159247 +0200
@@ -752,6 +752,7 @@ class nsWindow final : public nsBaseWidg
* move-to-rect callback we set mMovedAfterMoveToRect/mResizedAfterMoveToRect.
*/
bool mWaitingForMoveToRectCallback : 1;
+ bool mPendingFullscreen : 1;
bool mMovedAfterMoveToRect : 1;
bool mResizedAfterMoveToRect : 1;

View File

@ -1,69 +0,0 @@
diff -up firefox-115.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-115.0/dom/media/mp4/MP4Demuxer.cpp
--- firefox-115.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2023-06-06 23:14:43.000000000 +0200
+++ firefox-115.0/dom/media/mp4/MP4Demuxer.cpp 2023-06-08 08:15:48.214109403 +0200
@@ -32,6 +32,8 @@ mozilla::LogModule* GetDemuxerLog() { re
DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
__func__, ##__VA_ARGS__)
+extern bool gUseKeyframeFromContainer;
+
namespace mozilla {
using TimeUnit = media::TimeUnit;
@@ -404,6 +406,12 @@ already_AddRefed<MediaRawData> 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-115.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-115.0/dom/media/platforms/PDMFactory.cpp
--- firefox-115.0/dom/media/platforms/PDMFactory.cpp.1670333 2023-06-06 23:14:44.000000000 +0200
+++ firefox-115.0/dom/media/platforms/PDMFactory.cpp 2023-06-08 08:09:33.145289602 +0200
@@ -67,6 +67,8 @@
#include <functional>
+bool gUseKeyframeFromContainer = false;
+
using DecodeSupport = mozilla::media::DecodeSupport;
using DecodeSupportSet = mozilla::media::DecodeSupportSet;
using MediaCodec = mozilla::media::MediaCodec;
@@ -562,7 +564,7 @@ void PDMFactory::CreateRddPDMs() {
#ifdef MOZ_FFMPEG
if (StaticPrefs::media_ffmpeg_enabled() &&
StaticPrefs::media_rdd_ffmpeg_enabled() &&
- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
+ !(mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>())) {
mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
FFmpegRuntimeLinker::LinkStatusCode());
}
@@ -738,9 +740,10 @@ void PDMFactory::CreateDefaultPDMs() {
CreateAndStartupPDM<AgnosticDecoderModule>();
- if (StaticPrefs::media_gmp_decoder_enabled() &&
+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
!StartupPDM(GMPDecoderModule::Create(),
StaticPrefs::media_gmp_decoder_preferred())) {
+ gUseKeyframeFromContainer = true;
mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
}
}
diff -up firefox-115.0/dom/media/platforms/PDMFactory.h.1670333 firefox-115.0/dom/media/platforms/PDMFactory.h
--- firefox-115.0/dom/media/platforms/PDMFactory.h.1670333 2023-06-06 23:14:42.000000000 +0200
+++ firefox-115.0/dom/media/platforms/PDMFactory.h 2023-06-08 08:09:33.145289602 +0200
@@ -103,6 +103,7 @@ class PDMFactory final {
RefPtr<PlatformDecoderModule> mNullPDM;
DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
+ bool mFFmpegUsed = false;
friend class RemoteVideoDecoderParent;
static void EnsureInit();

View File

@ -1,29 +0,0 @@
# HG changeset patch
# User M. Sirringhaus <msirringhaus@suse.de>
# Date 1645518286 -3600
# Tue Feb 22 09:24:46 2022 +0100
# Node ID 81832d035e101471dcf52dd91de287268add7a91
# Parent 66f7ce16eb4965108687280e5443edd610631efb
imported patch svg-rendering.patch
diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -372,6 +372,17 @@ nsresult imgFrame::InitWithDrawable(gfxD
return NS_ERROR_OUT_OF_MEMORY;
}
+#if MOZ_BIG_ENDIAN()
+ if (aBackend == gfx::BackendType::SKIA && canUseDataSurface) {
+ // SKIA is lying about what format it returns on big endian
+ for (int ii=0; ii < mRawSurface->GetSize().Height()*mRawSurface->Stride() / 4; ++ii) {
+ uint32_t *vals = (uint32_t*)(mRawSurface->GetData());
+ uint32_t val = ((vals[ii] << 8) & 0xFF00FF00 ) | ((vals[ii] >> 8) & 0xFF00FF );
+ vals[ii] = (val << 16) | (val >> 16);
+ }
+ }
+#endif
+
if (!canUseDataSurface) {
// We used an offscreen surface, which is an "optimized" surface from
// imgFrame's perspective.

View File

@ -1,34 +0,0 @@
# HG changeset patch
# User M. Sirringhaus <msirringhaus@suse.de>
# Date 1645518286 -3600
# Tue Feb 22 09:24:46 2022 +0100
# Node ID 494640792b4677f6462e95b90a54a4e22aeb738b
# Parent 81832d035e101471dcf52dd91de287268add7a91
imported patch one_swizzle_to_rule_them_all.patch
Index: firefox-102.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp
===================================================================
--- firefox-102.0.orig/gfx/webrender_bindings/RenderCompositorSWGL.cpp
+++ firefox-102.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp
@@ -7,6 +7,7 @@
#include "RenderCompositorSWGL.h"
#include "mozilla/gfx/Logging.h"
+#include "mozilla/gfx/Swizzle.h"
#include "mozilla/widget/CompositorWidget.h"
#ifdef MOZ_WIDGET_GTK
@@ -235,6 +237,13 @@ void RenderCompositorSWGL::CommitMappedB
}
mDT->Flush();
+#if MOZ_BIG_ENDIAN()
+ // One swizzle to rule them all.
+ gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8,
+ mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8,
+ mDT->GetSize());
+#endif
+
// Done with the DT. Hand it back to the widget and clear out any trace of it.
mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion);
mDirtyRegion.SetEmpty();

View File

@ -1,26 +0,0 @@
# HG changeset patch
# Parent 3de59fe1b8708c01e134ce698c4232b8a854f617
Problem: webGL sites are displayed in the wrong color (usually blue-ish)
Solution: Problem is with skia once again. Output of webgl seems endian-correct, but skia only
knows how to deal with little endian.
So we swizzle the output of webgl after reading it from readpixels()
Note: This does not fix all webGL sites, but is a step in the right direction
Index: firefox-115.0/gfx/gl/GLContext.h
===================================================================
--- firefox-115.0.orig/gfx/gl/GLContext.h
+++ firefox-115.0/gfx/gl/GLContext.h
@@ -1560,6 +1560,13 @@ class GLContext : public GenericAtomicRe
BEFORE_GL_CALL;
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
OnSyncCall();
+#if MOZ_BIG_ENDIAN()
+ uint8_t* itr = (uint8_t*)pixels;
+ for (GLsizei i = 0; i < width * height; i++) {
+ NativeEndian::swapToLittleEndianInPlace((uint32_t*)itr, 1);
+ itr += 4;
+ }
+#endif
AFTER_GL_CALL;
mHeavyGLCallsSinceLastFlush = true;
}

View File

@ -1,29 +0,0 @@
# HG changeset patch
# User msirringhaus@suse.de
# Date 1583738770 -3600
# Mon Mar 09 08:26:10 2020 +0100
# Node ID 34676feac1a542e409e22acf5b98735f8313b1ce
# Parent 506857dace0a08d1c9685e3ac264646590b3e27f
[mq]: mozilla-bmo998749.patch
diff -r 506857dace0a -r 34676feac1a5 gfx/2d/FilterProcessing.h
--- a/gfx/2d/FilterProcessing.h Fri Feb 28 12:31:51 2020 +0100
+++ b/gfx/2d/FilterProcessing.h Mon Mar 09 08:26:10 2020 +0100
@@ -13,10 +13,17 @@
namespace mozilla {
namespace gfx {
+#if MOZ_BIG_ENDIAN()
+const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 3;
+const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 2;
+const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 1;
+const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 0;
+#else
const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_B = 0;
const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_G = 1;
const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_R = 2;
const ptrdiff_t B8G8R8A8_COMPONENT_BYTEOFFSET_A = 3;
+#endif
class FilterProcessing {
public: