From f873fc3d71a80ee1484f5452cdaf5df0474a3fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 15 Feb 2022 14:39:37 +0000 Subject: [PATCH] The upstream fix https://github.com/opencv/opencv/pull/21614 and remove the previous workaround --- ...bb06b230b5c4b5bca78d84102f5d1adf48cf.patch | 23 +++++++++++++++++++ opencv.spec | 19 +++++++-------- 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 8d88bb06b230b5c4b5bca78d84102f5d1adf48cf.patch diff --git a/8d88bb06b230b5c4b5bca78d84102f5d1adf48cf.patch b/8d88bb06b230b5c4b5bca78d84102f5d1adf48cf.patch new file mode 100644 index 0000000..114a6d6 --- /dev/null +++ b/8d88bb06b230b5c4b5bca78d84102f5d1adf48cf.patch @@ -0,0 +1,23 @@ +From 8d88bb06b230b5c4b5bca78d84102f5d1adf48cf Mon Sep 17 00:00:00 2001 +From: Alexander Alekhin +Date: Tue, 15 Feb 2022 07:23:32 +0300 +Subject: [PATCH] core(vsx): update vec_absd() workaround condition + +--- + modules/core/include/opencv2/core/vsx_utils.hpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules/core/include/opencv2/core/vsx_utils.hpp b/modules/core/include/opencv2/core/vsx_utils.hpp +index 68863ffb36f2..5cbc066784d0 100644 +--- a/modules/core/include/opencv2/core/vsx_utils.hpp ++++ b/modules/core/include/opencv2/core/vsx_utils.hpp +@@ -684,7 +684,8 @@ VSX_IMPL_LOAD_L8(vec_double2, double) + #endif + + // absolute difference +-#ifndef vec_absd ++#ifndef _ARCH_PWR9 ++# undef vec_absd + # define vec_absd(a, b) vec_sub(vec_max(a, b), vec_min(a, b)) + #endif + diff --git a/opencv.spec b/opencv.spec index 0522448..c3c47d6 100644 --- a/opencv.spec +++ b/opencv.spec @@ -50,7 +50,7 @@ Name: opencv Version: 4.5.5 %global javaver %(foo=%{version}; echo ${foo//./}) %global abiver %(foo=%{version}; echo ${foo:0:3}) -Release: 4%{?dist} +Release: 5%{?dist} Summary: Collection of algorithms for computer vision # This is normal three clause BSD. License: BSD @@ -70,7 +70,8 @@ Source4: b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip Source5: xorg.conf Patch0: opencv-4.1.0-install_3rdparty_licenses.patch -Patch1: 81a6d1b0d4d93a3330cc99fbb1601c90b9516a9c.patch +Patch1: https://github.com/opencv/opencv/commit/81a6d1b0d4d93a3330cc99fbb1601c90b9516a9c.patch +Patch2: https://github.com/opencv/opencv/commit/8d88bb06b230b5c4b5bca78d84102f5d1adf48cf.patch BuildRequires: gcc-c++ BuildRequires: cmake >= 2.6.3 @@ -251,6 +252,7 @@ popd &>/dev/null %patch0 -p1 -b .install_3rdparty_licenses %patch1 -p1 -R -b .soversion +%patch2 -p1 -b .ppc64le_builtin_altivec_vadub pushd %{name}_contrib-%{version} #patch1 -p1 -b .install_cvv @@ -268,15 +270,6 @@ popd mkdir -p .cache/ade install -pm 0644 %{SOURCE4} .cache/ade/ -%ifarch ppc64le -# Disable some altivec vectorization optimization on ppc64le (bug 2051193) -# Workaround is to force defining CV_FORCE_SIMD128_CPP on ppc64le so as NOT to use intrin_vsx.hpp . -# https://github.com/opencv/opencv/issues/21465 -# https://github.com/opencv/opencv/issues/19020 -sed -i modules/core/include/opencv2/core/hal/intrin.hpp \ - -e '\@ifdef CV_FORCE_SIMD128_CPP@i #define CV_FORCE_SIMD128_CPP' -%endif - %build # enabled by default if libraries are presents at build time: # GTK, GSTREAMER, 1394, V4L, eigen3 @@ -491,6 +484,10 @@ ln -s -r %{buildroot}%{_jnidir}/opencv-%{javaver}.jar %{buildroot}%{_jnidir}/ope %{_libdir}/libopencv_xphoto.so.%{abiver}* %changelog +* Tue Feb 15 2022 Sérgio Basto - 4.5.5-5 +- The upstream fix https://github.com/opencv/opencv/pull/21614 + and remove the previous workaround + * Sun Feb 13 2022 Mamoru TASAKA - 4.5.5-4 - Disable some altivec vectorization optimization on ppc64le (bug 2051193)