From patchwork Thu Nov 14 08:58:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai X-Patchwork-Id: 52463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF9C5D65C5E for ; Thu, 14 Nov 2024 08:58:37 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.33016.1731574711489028259 for ; Thu, 14 Nov 2024 00:58:31 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=1048a99a80=kai.kang@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AE8e1V8028941 for ; Thu, 14 Nov 2024 00:58:31 -0800 Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [147.11.82.254]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 42uwpmkjfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 14 Nov 2024 00:58:30 -0800 (PST) Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.43; Thu, 14 Nov 2024 00:58:30 -0800 Received: from pek-lpg-core4.wrs.com (128.224.153.44) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2507.43 via Frontend Transport; Thu, 14 Nov 2024 00:58:29 -0800 From: To: Subject: [kirkstone][PATCH 1/2] webkitgtk: Fix build on 32bit arm Date: Thu, 14 Nov 2024 16:58:23 +0800 Message-ID: <20241114085824.3504475-1-kai.kang@windriver.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Proofpoint-GUID: pgVCbltk5J_oC2dd1Zbwpey04tj-H2zs X-Authority-Analysis: v=2.4 cv=ZdlPNdVA c=1 sm=1 tr=0 ts=6735bbb6 cx=c_pps a=K4BcnWQioVPsTJd46EJO2w==:117 a=K4BcnWQioVPsTJd46EJO2w==:17 a=VlfZXiiP6vEA:10 a=pGLkceISAAAA:8 a=t7CeM3EgAAAA:8 a=P-IC7800AAAA:8 a=ag1SF4gXAAAA:8 a=V2sgnzSHAAAA:8 a=Q1sTgoEvAAAA:8 a=NEAV23lmAAAA:8 a=LXCGm8LIAAAA:8 a=3cVtXPzy6bTFtKRyDW4A:9 a=FdTzh2GWekK77mhwV6Dw:22 a=d3PnA9EDa4IxuAV0gXij:22 a=Yupwre4RP9_Eg_Bd0iYG:22 a=Z31ocT7rh6aUJxSkT1EX:22 a=FkGh3qDytyf094M0uOEt:22 a=NxI9r9ql2kHpUT0AVVEO:22 X-Proofpoint-ORIG-GUID: pgVCbltk5J_oC2dd1Zbwpey04tj-H2zs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-14_03,2024-11-13_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 priorityscore=1501 spamscore=0 suspectscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.21.0-2409260000 definitions=main-2411140068 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 14 Nov 2024 08:58:37 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/207145 From: Khem Raj Signed-off-by: Khem Raj Cc: Mingli Yu Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie (From OE-Core rev: 9294ccb9530ce70b2513b2e112644ec5e9f8e701) Signed-off-by: Kai Kang --- ...44e17d258106617b0e6d783d073b188a2548.patch | 296 ++++++++++++++++++ meta/recipes-sato/webkit/webkitgtk_2.36.8.bb | 1 + 2 files changed, 297 insertions(+) create mode 100644 meta/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch diff --git a/meta/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch b/meta/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch new file mode 100644 index 0000000000..32f92f7ff5 --- /dev/null +++ b/meta/recipes-sato/webkit/webkitgtk/0d3344e17d258106617b0e6d783d073b188a2548.patch @@ -0,0 +1,296 @@ +From 0d3344e17d258106617b0e6d783d073b188a2548 Mon Sep 17 00:00:00 2001 +From: Adrian Perez de Castro +Date: Thu, 2 Jun 2022 11:19:06 +0300 +Subject: [PATCH] [ARM][NEON] FELightningNEON.cpp fails to build, NEON fast + path seems unused https://bugs.webkit.org/show_bug.cgi?id=241182 + +Reviewed by NOBODY (OOPS!). + +Move the NEON fast path for the SVG lighting filter effects into +FELightingSoftwareApplier, and arrange to actually use them by +forwarding calls to applyPlatformGeneric() into applyPlatformNeon(). + +Some changes were needed to adapt platformApplyNeon() to the current +state of filters after r286140. This was not detected because the code +bitrotted due to it being guarded with CPU(ARM_TRADITIONAL), which does +not get used much these days: CPU(ARM_THUMB2) is more common. It should +be possible to use the NEON fast paths also in Thumb mode, but that is +left for a follow-up fix. + +* Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp: +(WebCore::FELightingSoftwareApplier::platformApplyNeonWorker): +(WebCore::FELightingSoftwareApplier::getPowerCoefficients): +(WebCore::FELighting::platformApplyNeonWorker): Deleted. +(WebCore::FELighting::getPowerCoefficients): Deleted. +* Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h: +(WebCore::FELightingSoftwareApplier::applyPlatformNeon): +(WebCore::FELighting::platformApplyNeon): Deleted. +* Source/WebCore/platform/graphics/filters/DistantLightSource.h: +* Source/WebCore/platform/graphics/filters/FELighting.h: +* Source/WebCore/platform/graphics/filters/PointLightSource.h: +* Source/WebCore/platform/graphics/filters/SpotLightSource.h: +* Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h: +--- +Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/1233] +Signed-off-by: Khem Raj + + .../cpu/arm/filters/FELightingNEON.cpp | 4 +- + .../graphics/cpu/arm/filters/FELightingNEON.h | 54 +++++++++---------- + .../graphics/filters/DistantLightSource.h | 4 ++ + .../platform/graphics/filters/FELighting.h | 7 --- + .../graphics/filters/PointLightSource.h | 4 ++ + .../graphics/filters/SpotLightSource.h | 4 ++ + .../software/FELightingSoftwareApplier.h | 16 ++++++ + 7 files changed, 57 insertions(+), 36 deletions(-) + +--- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp ++++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp +@@ -49,7 +49,7 @@ short* feLightingConstantsForNeon() + return s_FELightingConstantsForNeon; + } + +-void FELighting::platformApplyNeonWorker(FELightingPaintingDataForNeon* parameters) ++void FELightingSoftwareApplier::platformApplyNeonWorker(FELightingPaintingDataForNeon* parameters) + { + neonDrawLighting(parameters); + } +@@ -464,7 +464,7 @@ TOSTRING(neonDrawLighting) ":" NL + "b .lightStrengthCalculated" NL + ); // NOLINT + +-int FELighting::getPowerCoefficients(float exponent) ++int FELightingSoftwareApplier::getPowerCoefficients(float exponent) + { + // Calling a powf function from the assembly code would require to save + // and reload a lot of NEON registers. Since the base is in range [0..1] +--- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h ++++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h +@@ -24,14 +24,15 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef FELightingNEON_h +-#define FELightingNEON_h ++#pragma once + + #if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE) + +-#include "FELighting.h" ++#include "FELightingSoftwareApplier.h" ++#include "ImageBuffer.h" + #include "PointLightSource.h" + #include "SpotLightSource.h" ++#include + #include + + namespace WebCore { +@@ -93,14 +94,14 @@ extern "C" { + void neonDrawLighting(FELightingPaintingDataForNeon*); + } + +-inline void FELighting::platformApplyNeon(const LightingData& data, const LightSource::PaintingData& paintingData) ++inline void FELightingSoftwareApplier::applyPlatformNeon(const FELightingSoftwareApplier::LightingData& data, const LightSource::PaintingData& paintingData) + { +- alignas(16) FELightingFloatArgumentsForNeon floatArguments; +- FELightingPaintingDataForNeon neonData = { ++ WebCore::FELightingFloatArgumentsForNeon alignas(16) floatArguments; ++ WebCore::FELightingPaintingDataForNeon neonData = { + data.pixels->data(), + 1, +- data.widthDecreasedByOne - 1, +- data.heightDecreasedByOne - 1, ++ data.width - 2, ++ data.height - 2, + 0, + 0, + 0, +@@ -111,23 +112,23 @@ inline void FELighting::platformApplyNeo + // Set light source arguments. + floatArguments.constOne = 1; + +- auto color = m_lightingColor.toColorTypeLossy>().resolved(); ++ auto color = data.lightingColor.toColorTypeLossy>().resolved(); + + floatArguments.colorRed = color.red; + floatArguments.colorGreen = color.green; + floatArguments.colorBlue = color.blue; + floatArguments.padding4 = 0; + +- if (m_lightSource->type() == LS_POINT) { ++ if (data.lightSource->type() == LS_POINT) { + neonData.flags |= FLAG_POINT_LIGHT; +- PointLightSource& pointLightSource = static_cast(m_lightSource.get()); ++ const auto& pointLightSource = *static_cast(data.lightSource); + floatArguments.lightX = pointLightSource.position().x(); + floatArguments.lightY = pointLightSource.position().y(); + floatArguments.lightZ = pointLightSource.position().z(); + floatArguments.padding2 = 0; +- } else if (m_lightSource->type() == LS_SPOT) { ++ } else if (data.lightSource->type() == LS_SPOT) { + neonData.flags |= FLAG_SPOT_LIGHT; +- SpotLightSource& spotLightSource = static_cast(m_lightSource.get()); ++ const auto& spotLightSource = *static_cast(data.lightSource); + floatArguments.lightX = spotLightSource.position().x(); + floatArguments.lightY = spotLightSource.position().y(); + floatArguments.lightZ = spotLightSource.position().z(); +@@ -145,7 +146,7 @@ inline void FELighting::platformApplyNeo + if (spotLightSource.specularExponent() == 1) + neonData.flags |= FLAG_CONE_EXPONENT_IS_1; + } else { +- ASSERT(m_lightSource->type() == LS_DISTANT); ++ ASSERT(data.lightSource->type() == LS_DISTANT); + floatArguments.lightX = paintingData.initialLightingData.lightVector.x(); + floatArguments.lightY = paintingData.initialLightingData.lightVector.y(); + floatArguments.lightZ = paintingData.initialLightingData.lightVector.z(); +@@ -155,38 +156,39 @@ inline void FELighting::platformApplyNeo + // Set lighting arguments. + floatArguments.surfaceScale = data.surfaceScale; + floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4; +- if (m_lightingType == FELighting::DiffuseLighting) +- floatArguments.diffuseConstant = m_diffuseConstant; ++ if (data.filterType == FilterEffect::Type::FEDiffuseLighting) ++ floatArguments.diffuseConstant = data.diffuseConstant; + else { + neonData.flags |= FLAG_SPECULAR_LIGHT; +- floatArguments.diffuseConstant = m_specularConstant; +- neonData.specularExponent = getPowerCoefficients(m_specularExponent); +- if (m_specularExponent == 1) ++ floatArguments.diffuseConstant = data.specularConstant; ++ neonData.specularExponent = getPowerCoefficients(data.specularExponent); ++ if (data.specularExponent == 1) + neonData.flags |= FLAG_SPECULAR_EXPONENT_IS_1; + } + if (floatArguments.diffuseConstant == 1) + neonData.flags |= FLAG_DIFFUSE_CONST_IS_1; + +- int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension; ++ static constexpr int minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs ++ int optimalThreadNumber = ((data.width - 2) * (data.height - 2)) / minimalRectDimension; + if (optimalThreadNumber > 1) { + // Initialize parallel jobs +- ParallelJobs parallelJobs(&WebCore::FELighting::platformApplyNeonWorker, optimalThreadNumber); ++ ParallelJobs parallelJobs(&FELightingSoftwareApplier::platformApplyNeonWorker, optimalThreadNumber); + + // Fill the parameter array + int job = parallelJobs.numberOfJobs(); + if (job > 1) { + int yStart = 1; +- int yStep = (data.heightDecreasedByOne - 1) / job; ++ int yStep = (data.height - 2) / job; + for (--job; job >= 0; --job) { + FELightingPaintingDataForNeon& params = parallelJobs.parameter(job); + params = neonData; + params.yStart = yStart; +- params.pixels += (yStart - 1) * (data.widthDecreasedByOne + 1) * 4; ++ params.pixels += (yStart - 1) * data.width * 4; + if (job > 0) { + params.absoluteHeight = yStep; + yStart += yStep; + } else +- params.absoluteHeight = data.heightDecreasedByOne - yStart; ++ params.absoluteHeight = (data.height - 1) - yStart; + } + parallelJobs.execute(); + return; +@@ -199,5 +201,3 @@ inline void FELighting::platformApplyNeo + } // namespace WebCore + + #endif // CPU(ARM_NEON) && COMPILER(GCC_COMPATIBLE) +- +-#endif // FELightingNEON_h +--- a/Source/WebCore/platform/graphics/filters/DistantLightSource.h ++++ b/Source/WebCore/platform/graphics/filters/DistantLightSource.h +@@ -25,6 +25,10 @@ + #include "LightSource.h" + #include + ++namespace WTF { ++class TextStream; ++} // namespace WTF ++ + namespace WebCore { + + class DistantLightSource : public LightSource { +--- a/Source/WebCore/platform/graphics/filters/FELighting.h ++++ b/Source/WebCore/platform/graphics/filters/FELighting.h +@@ -35,8 +35,6 @@ + + namespace WebCore { + +-struct FELightingPaintingDataForNeon; +- + class FELighting : public FilterEffect { + public: + const Color& lightingColor() const { return m_lightingColor; } +@@ -67,11 +65,6 @@ protected: + + std::unique_ptr createSoftwareApplier() const override; + +-#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE) +- static int getPowerCoefficients(float exponent); +- inline void platformApplyNeon(const LightingData&, const LightSource::PaintingData&); +-#endif +- + Color m_lightingColor; + float m_surfaceScale; + float m_diffuseConstant; +--- a/Source/WebCore/platform/graphics/filters/PointLightSource.h ++++ b/Source/WebCore/platform/graphics/filters/PointLightSource.h +@@ -26,6 +26,10 @@ + #include "LightSource.h" + #include + ++namespace WTF { ++class TextStream; ++} // namespace WTF ++ + namespace WebCore { + + class PointLightSource : public LightSource { +--- a/Source/WebCore/platform/graphics/filters/SpotLightSource.h ++++ b/Source/WebCore/platform/graphics/filters/SpotLightSource.h +@@ -26,6 +26,10 @@ + #include "LightSource.h" + #include + ++namespace WTF { ++class TextStream; ++} // namespace WTF ++ + namespace WebCore { + + class SpotLightSource : public LightSource { +--- a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h ++++ b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h +@@ -36,6 +36,7 @@ + namespace WebCore { + + class FELighting; ++struct FELightingPaintingDataForNeon; + + class FELightingSoftwareApplier final : public FilterEffectConcreteApplier { + WTF_MAKE_FAST_ALLOCATED; +@@ -132,8 +133,23 @@ private: + + static void applyPlatformGenericPaint(const LightingData&, const LightSource::PaintingData&, int startY, int endY); + static void applyPlatformGenericWorker(ApplyParameters*); ++ ++#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE) ++ static int getPowerCoefficients(float exponent); ++ static void platformApplyNeonWorker(FELightingPaintingDataForNeon*); ++ inline static void applyPlatformNeon(const LightingData&, const LightSource::PaintingData&); ++ ++ inline static void applyPlatformGeneric(const LightingData& data, const LightSource::PaintingData& paintingData) ++ { ++ applyPlatformNeon(data, paintingData); ++ } ++#else + static void applyPlatformGeneric(const LightingData&, const LightSource::PaintingData&); ++#endif ++ + static void applyPlatform(const LightingData&); + }; + + } // namespace WebCore ++ ++#include "FELightingNEON.h" diff --git a/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb b/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb index a2d455ab92..16acb205b1 100644 --- a/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb +++ b/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb @@ -25,6 +25,7 @@ SRC_URI = "https://www.webkitgtk.org/releases/${BP}.tar.xz \ file://CVE-2022-48503.patch \ file://CVE-2023-32439.patch \ file://CVE-2024-40779.patch \ + file://0d3344e17d258106617b0e6d783d073b188a2548.patch \ " SRC_URI[sha256sum] = "0ad9fb6bf28308fe3889faf184bd179d13ac1b46835d2136edbab2c133d00437"