Sparc only issue (was already in 52.x) Crash Annotation GraphicsCriticalError: |[0][GFX1]: Unknown image format 1 (t=6.67237) [GFX1]: Unknown image format 1 Assertion failure: [GFX1]: Unknown image format 1, at /scratch/firefox/obj-sparc64-sun-solaris2.11/dist/include/mozilla/gfx/Logging.h:727 Hit MOZ_CRASH(GFX: An assert from the graphics logger) at /scratch/firefox/obj-sparc64-sun-solaris2.11/dist/include/mozilla/gfx/Logging.h:728 Couldn't convert chrome URL: chrome://branding/locale/brand.properties 00000000ffbf7dd1 libc.so.1`__lwp_sigqueue+8(b, ffbf8730, 0, a, 0, fe72eb80) 00000000ffbf7e81 libxul.so`nsProfileLock::FatalSignalHandler+0x124(b, ffbf8e10, ffbf8b00, ff00000000, 9, ffbf8730) 00000000ffbf7f41 libxul.so`js::UnixExceptionHandler+0xac(b, ffbf8e10, ffbf8b00, 0, 0, 0) 00000000ffbf7ff1 libc.so.1`__sighndlr+0xc(b, ffbf8e10, ffbf8b00, dc49a49c, 0, fe726000) 00000000ffbf80a1 libc.so.1`call_user_handler+0x354(0, ffbf8e10, 0, fe7d2a40, b, 0) 00000000ffbf8191 libc.so.1`sigacthandler+0x54(b, ffbf8e10, ffbf8b00, 0, ffbf9120, fe726000) 00000000ffbf8711 libxul.so`nsNativeThemeGTK::DrawWidgetBackground+0x1718(f089d000, d23fd380, e4818180, 56, 4f, d7514db8) 00000000ffbf8bb1 libxul.so`nsDisplayThemedBackground::PaintInternal+0xe4(d33f0120, f089d0e0, d23fd380, da699ca0, d750ac20, ffbf9460) 00000000ffbf8c71 libxul.so`nsDisplayThemedBackground::Paint+0x14(d33f0120, ffbfa648, d23fd380, feec0cd8, feec0cd8, feeb10d0) 00000000ffbf8d21 libxul.so`mozilla::FrameLayerBuilder::PaintItems+0x113c(d33c6870, d33c6780, 0, d23fd380, d33f0120, 1) 00000000ffbf9191 libxul.so`mozilla::FrameLayerBuilder::DrawPaintedLayer+0x2e0(ef109400, d23fd380, ffbf9c68, ffbf9c68, ffbf9ab8, ffbf9ca0) 00000000ffbf93a1 libxul.so`mozilla::layers::ClientPaintedLayer::PaintThebes+0x16c(ef109400, ffbf9d98, ffbf9c88, ef109400, ffbf9c68, 1) 00000000ffbf94d1 libxul.so`mozilla::layers::ClientPaintedLayer::RenderLayerWithReadback+0xd8(ef109400, ffbf9e58, 8, 0, 0, 0) 00000000ffbf95a1 libxul.so`mozilla::layers::ClientContainerLayer::RenderLayer+0x1fc(ef109000, 0, 1ce, ffbf9e58, ef109400, 0) 00000000ffbf9661 libxul.so`mozilla::layers::ClientLayerManager::EndTransactionInternal+0x1b4(e2cb8720, dacc7f10, ffbfa648, 0, ffbf9d78, ef109348) 00000000ffbf98e1 libxul.so`mozilla::layers::ClientLayerManager::EndTransaction+0x58(e2cb8720, dacc7f10, ffbfa648, 0, ffbfa020, d2318240) 00000000ffbf9991 libxul.so`nsDisplayList::PaintRoot+0x6c0(ffbfceb0, ffbfa628, ffbfa648, 0, d2318240, ef1b1800) 00000000ffbf9b11 libxul.so`nsLayoutUtils::PaintFrame+0x2420(2000, e4818020, d, ffffffffffffd6a8, ffbfa648, 184) 00000000ffbfc741 libxul.so`mozilla::PresShell::Paint+0x294(ef1d4000, ffe7e8e8, ffbfd1c8, 0, 0, e2cb8720) 00000000ffbfc911 libxul.so`nsViewManager::ProcessPendingUpdatesPaint+0x208(f26645c0, f0ef1800, ffbfd1c8, ffbfd1d0, d750ac20, f2663200) 00000000ffbfc9e1 libxul.so`nsViewManager::ProcessPendingUpdatesForView+0x404(f26645c0, f2663200, 1, 1, f0ef1800, 0) 00000000ffbfcac1 libxul.so`nsViewManager::ProcessPendingUpdates+0x44(f26645c0, 2, d75d2c90, 40, 0, 3) 00000000ffbfcb71 libxul.so`nsRefreshDriver::Tick+0x15c8(ef1b2000, 1, f26645c8, ffbfd4d0, ef1b2028, f26645c0) 00000000ffbfcf21 libxul.so`mozilla::RefreshDriverTimer::Tick+0x2a0(f08442a0, 571e299e4bca8, 53180ef77537, 1, ef1b2000, 1) 00000000ffbfcfe1 libxul.so`mozilla::VsyncRefreshDriverTimer::RefreshDriverVsyncObserver::TickRefreshDriver+0x5a8(fd6fbdf0, 531804fd2f18, b2, b2, f08442a0, 53180ef77537) 00000000ffbfd0e1 libxul.so`mozilla::VsyncRefreshDriverTimer::RefreshDriverVsyncObserver::ParentProcessVsyncNotifier::Run+0x70(d23e0580, 656e7450726f6365, 328, d23fce66, 2, ddb708a2) 00000000ffbfd191 libxul.so`nsThread::ProcessNextEvent+0xf70(fd6dc050, 2, ffbfe09f, 5a, f857a000, 0) 00000000ffbfd7e1 libxul.so`NS_ProcessNextEvent+0x24(fd6dc050, 0, 328, 0, 1b4, 0) 00000000ffbfd8a1 libxul.so`mozilla::ipc::MessagePump::Run+0x330(fd69f7c0, fe0d69f0, 147, fd69f7e0, fd6dc050, 1) 00000000ffbfd961 libxul.so`MessageLoop::RunInternal+0x60(fe0d69f0, fe0d69f0, ff000000, 1, 0, fd6dc050) 00000000ffbfda31 libxul.so`MessageLoop::Run+0x14(fe0d69f0, fe05423c, fe72eb80, fe7d2a40, fe7d2a40, ffbfe2e8) 00000000ffbfdb01 libxul.so`nsBaseAppShell::Run+0x30(fd68b9e0, 78, 328, fe726000, 114, fd6dc050) 00000000ffbfdbb1 libxul.so`nsAppStartup::Run+0xc0(fd6a7a60, 0, 328, 0, ef991090, 0) 00000000ffbfdc61 libxul.so`XREMain::XRE_mainRun+0x1d20(ffbfe990, fd6b2c10, f, ffbfe5f0, db91269c, ffbfe9c0) 00000000ffbfdfb1 libxul.so`XREMain::XRE_main+0x8e4(ffbfe990, d7a49144, fe05c270, 0, ffbfea08, 0) 00000000ffbfe0e1 libxul.so`XRE_main+0x98(1, ffbff218, ffbff080, ffbfebc8, 0, 3f) 00000000ffbfe321 libxul.so`mozilla::BootstrapImpl::XRE_main+0xc(fe0486c0, 1, ffbff218, ffbff080, fe014080, 0) 00000000ffbfe3d1 do_main+0x1ec(1, ffbff218, ffbff228, 0, ff144e38, 0) 00000000ffbfe891 main+0xa0(1, ffbff218, ffbff228, 53168285f0ca, ff, 24db98) 00000000ffbfe941 _start+0x64(0, 0, 0, 0, 0, 0) https://bugzilla.mozilla.org/show_bug.cgi?id=1344659 --- firefox-140.1.0/gfx/2d/Types.h +++ firefox-140.1.0/gfx/2d/Types.h @@ -104,15 +104,8 @@ UNKNOWN, // TODO: Replace uses with May // 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() 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. // Sparc DEBUG build only issue: [GFX2-]: Failed to lock WindowSurface, falling back to XPutImage backend. Crash Annotation GraphicsCriticalError: |[0][GFX1]: RGBX corner pixel at (0,0) in 921x691 surface, bounded by (0,0,921,691) is not opaque: 255,162,162,162 (t=7.19982) [GFX1]: RGBX corner pixel at (0,0) in 921x691 surface, bounded by (0,0,921,691) is not opaque: 255,162,162,162 Assertion failure: [GFX1]: RGBX corner pixel at (0,0) in 921x691 surface, bounded by (0,0,921,691) is not opaque: 255,162,162,162, at /scratch/firefox/gfx/2d/Logging.h:727 https://bugzilla.mozilla.org/show_bug.cgi?id=1325259 --- firefox-140.1.0/gfx/2d/DrawTargetSkia.cpp +++ firefox-140.1.0/gfx/2d/DrawTargetSkia.cpp @@ -159,8 +159,12 @@ } return surfaceBounds.Intersect(bounds); } +#if MOZ_BIG_ENDIAN() +static const int kARGBAlphaOffset = 0; +#else static const int kARGBAlphaOffset = SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0; +#endif static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, const int32_t aStride, SurfaceFormat aFormat) { # HG changeset patch # User Petr Sumbera # Date 1648114576 25200 # Thu Mar 24 02:36:16 2022 -0700 # Node ID 903e5f164c0ed424492eec6f388c03cbbcf99913 # Parent 20d81e68da033746bf81acbb08490f16679853da Bug 1716707 [s390x] Software WebRender does not support big endian --- firefox-140.1.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp +++ firefox-140.1.0/gfx/webrender_bindings/RenderCompositorSWGL.cpp @@ -7,6 +7,7 @@ * file, You can obtain one at http://moz #include "RenderCompositorSWGL.h" #include "mozilla/gfx/Logging.h" +#include "mozilla/gfx/Swizzle.h" #include "mozilla/widget/CompositorWidget.h" #ifdef MOZ_WIDGET_GTK @@ -240,6 +241,17 @@ mDT->ReleaseBits(mMappedData); } mDT->Flush(); +#if MOZ_BIG_ENDIAN() + // One swizzle to rule them all. + // With exception to certain text boxes with 1 line (46 pixels) and 2 lines + // (64 pixels) in Firefox 115. Per following bug: + // https://bugzilla.mozilla.org/show_bug.cgi?id=1900574 + if ((int)mDT->GetSize().height != 46 && mDT->GetSize().height != 64) + 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(); --- firefox-140.1.0/image/imgFrame.cpp +++ firefox-140.1.0/image/imgFrame.cpp @@ -382,6 +382,17 @@ mAborted = true; 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. https://bugzilla.mozilla.org/show_bug.cgi?id=1888396 --- firefox-140.1.0/gfx/skia/skia/src/core/SkBlitRow_D32.cpp +++ firefox-140.1.0/gfx/skia/skia/src/core/SkBlitRow_D32.cpp @@ -554,7 +554,7 @@ } void SkBlitRow::Color32(SkPMColor dst[], int count, SkPMColor color) { switch (SkGetPackedA32(color)) { case 0: /* Nothing to do */ return; - case 255: SkOpts::memset32(dst, color, count); return; + case 255: SkOpts::memset32(dst, BE_CONVERT(color), count); return; } - return SkOpts::blit_row_color32(dst, count, color); + return SkOpts::blit_row_color32(dst, count, BE_CONVERT(color)); } --- firefox-140.1.0/gfx/skia/skia/src/core/SkBlitter_ARGB32.cpp +++ firefox-140.1.0/gfx/skia/skia/src/core/SkBlitter_ARGB32.cpp @@ -1495,17 +1495,17 @@ void SkARGB32_Blitter::blitAntiH2(int x, uint32_t* device = fDevice.writable_addr32(x, y); SkDEBUGCODE((void)fDevice.writable_addr32(x + 1, y);) - device[0] = SkBlendARGB32(fPMColor, device[0], a0); - device[1] = SkBlendARGB32(fPMColor, device[1], a1); + device[0] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[0]), a0)); + device[1] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[1]), a1)); } void SkARGB32_Blitter::blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { uint32_t* device = fDevice.writable_addr32(x, y); SkDEBUGCODE((void)fDevice.writable_addr32(x, y + 1);) - device[0] = SkBlendARGB32(fPMColor, device[0], a0); + device[0] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[0]), a0)); device = (uint32_t*)((char*)device + fDevice.rowBytes()); - device[0] = SkBlendARGB32(fPMColor, device[0], a1); + device[0] = BE_CONVERT(SkBlendARGB32(fPMColor, BE_CONVERT(device[0]), a1)); } ////////////////////////////////////////////////////////////////////////////////////// @@ -1608,7 +1608,7 @@ return; } SkAlpha aa = antialias[0]; if (aa == 255) { - SkOpts::memset32(device, fPMColor, count); + SkOpts::memset32(device, BE_CONVERT(fPMColor), count); } else if (aa > 0) { SkPMColor sc = SkAlphaMulQ(fPMColor, SkAlpha255To256(aa)); SkBlitRow::Color32(device, count, sc); @@ -1623,17 +1623,17 @@ void SkARGB32_Opaque_Blitter::blitAntiH2 uint32_t* device = fDevice.writable_addr32(x, y); SkDEBUGCODE((void)fDevice.writable_addr32(x + 1, y);) - device[0] = SkFastFourByteInterp(fPMColor, device[0], a0); - device[1] = SkFastFourByteInterp(fPMColor, device[1], a1); + device[0] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[0]), a0)); + device[1] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[1]), a1)); } void SkARGB32_Opaque_Blitter::blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { uint32_t* device = fDevice.writable_addr32(x, y); SkDEBUGCODE((void)fDevice.writable_addr32(x, y + 1);) - device[0] = SkFastFourByteInterp(fPMColor, device[0], a0); + device[0] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[0]), a0)); device = (uint32_t*)((char*)device + fDevice.rowBytes()); - device[0] = SkFastFourByteInterp(fPMColor, device[0], a1); + device[0] = BE_CONVERT(SkFastFourByteInterp(fPMColor, BE_CONVERT(device[0]), a1)); } /////////////////////////////////////////////////////////////////////////////// @@ -1653,7 +1653,7 @@ } const unsigned dst_scale = SkAlpha255To256(255 - SkGetPackedA32(color)); const size_t rowBytes = fDevice.rowBytes(); while (--height >= 0) { - device[0] = color + SkAlphaMulQ(device[0], dst_scale); + device[0] = BE_CONVERT(color + SkAlphaMulQ(BE_CONVERT(device[0]), dst_scale)); device = (uint32_t*)((char*)device + rowBytes); } } @@ -1669,7 +1669,7 @@ uint32_t* device = fDevice.writable_addr const size_t rowBytes = fDevice.rowBytes(); if (SkGetPackedA32(fPMColor) == 0xFF) { - SkOpts::rect_memset32(device, fPMColor, width, rowBytes, height); + SkOpts::rect_memset32(device, BE_CONVERT(fPMColor), width, rowBytes, height); } else { while (height --> 0) { SkBlitRow::Color32(device, width, fPMColor); @@ -1698,7 +1698,7 @@ } unsigned aa = antialias[0]; if (aa) { if (aa == 255) { - SkOpts::memset32(device, kBlack, count); + SkOpts::memset32(device, BE_CONVERT(kBlack), count); } else { const SkPMColor src = aa << SK_A32_SHIFT; const unsigned dst_scale = SkAlpha255To256(255 - aa); --- firefox-140.1.0/gfx/skia/skia/src/core/SkColorData.h +++ firefox-140.1.0/gfx/skia/skia/src/core/SkColorData.h @@ -18,6 +18,13 @@ #include "src/core/SkColorPriv.h" #include +/* Macro to covert between big endian and little endian memory order. */ +#ifdef SK_CPU_BENDIAN +#define BE_CONVERT(c) ((((c) & 0xff)<<24) | (((c) & 0xff00)<<8) | (((c) & 0xff0000)>>8) | (((c) & 0xff000000)>>24)) +#else +#define BE_CONVERT(c) c +#endif + //////////////////////////////////////////////////////////////////////////////////////////// // Convert a 16bit pixel to a 32bit pixel