* [Buildroot] [PATCH 2/4] jpeg: rework jpeg-turbo simd support handling
2016-12-11 15:52 [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config Peter Korsgaard
@ 2016-12-11 15:52 ` Peter Korsgaard
2016-12-11 15:52 ` [Buildroot] [PATCH 3/4] jpeg-turbo: add simd support for powerpc cores with altivec Peter Korsgaard
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2016-12-11 15:52 UTC (permalink / raw)
To: buildroot
In preperation for adding more architectures to the jpeg-turbo simd
handling, introduce a hidden BR2_PACKAGE_JPEG_SIMDS_SUPPORT symbol and use
that to enable simd support and default to jpeg-turbo, instead of open
coding it in both places.
While we are at it, reword the help text to be more useful.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
package/jpeg-turbo/jpeg-turbo.mk | 2 +-
package/jpeg/Config.in | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/package/jpeg-turbo/jpeg-turbo.mk b/package/jpeg-turbo/jpeg-turbo.mk
index c3de04a..e2b7e63 100644
--- a/package/jpeg-turbo/jpeg-turbo.mk
+++ b/package/jpeg-turbo/jpeg-turbo.mk
@@ -15,7 +15,7 @@ JPEG_TURBO_DEPENDENCIES = host-pkgconf
JPEG_TURBO_CONF_OPTS = --with-jpeg8
-ifeq ($(BR2_X86_CPU_HAS_MMX)$(BR2_ARM_CPU_HAS_NEON),y)
+ifeq ($(BR2_PACKAGE_JPEG_SIMD_SUPPORT),y)
JPEG_TURBO_CONF_OPTS += --with-simd
# x86 simd support needs nasm
JPEG_TURBO_DEPENDENCIES += $(if $(BR2_X86_CPU_HAS_MMX),host-nasm)
diff --git a/package/jpeg/Config.in b/package/jpeg/Config.in
index f337aeb..170e58c 100644
--- a/package/jpeg/Config.in
+++ b/package/jpeg/Config.in
@@ -3,13 +3,18 @@ config BR2_PACKAGE_JPEG
help
Select the desired JPEG library provider.
+# jpeg-turbo has simd support for some architectures
+config BR2_PACKAGE_JPEG_SIMD_SUPPORT
+ bool
+ default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON
+
if BR2_PACKAGE_JPEG
choice
prompt "jpeg variant"
- default BR2_PACKAGE_JPEG_TURBO if (BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON)
+ default BR2_PACKAGE_JPEG_TURBO if BR2_PACKAGE_JPEG_SIMD_SUPPORT
help
- Select the older stable version, or the newer developer version
+ Select the normal libjpeg or libjpeg-turbo.
config BR2_PACKAGE_LIBJPEG
bool "jpeg"
--
2.10.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH 3/4] jpeg-turbo: add simd support for powerpc cores with altivec
2016-12-11 15:52 [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config Peter Korsgaard
2016-12-11 15:52 ` [Buildroot] [PATCH 2/4] jpeg: rework jpeg-turbo simd support handling Peter Korsgaard
@ 2016-12-11 15:52 ` Peter Korsgaard
2016-12-11 15:52 ` [Buildroot] [PATCH 4/4] jpeg-turbo: add simd support for aarch64 Peter Korsgaard
2016-12-11 17:34 ` [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config Thomas Petazzoni
3 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2016-12-11 15:52 UTC (permalink / raw)
To: buildroot
From the 1.5-b1 release notes:
Added full SIMD acceleration for PowerPC platforms using AltiVec VMX
(128-bit SIMD) instructions. Although the performance of libjpeg-turbo on
PowerPC was already good, due to the increased number of registers available
to the compiler vs. x86, it was still possible to speed up compression by
about 3-4x and decompression by about 2-2.5x (relative to libjpeg v6b)
through the use of AltiVec instructions.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
package/jpeg/Config.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package/jpeg/Config.in b/package/jpeg/Config.in
index 170e58c..926f12e 100644
--- a/package/jpeg/Config.in
+++ b/package/jpeg/Config.in
@@ -6,7 +6,8 @@ config BR2_PACKAGE_JPEG
# jpeg-turbo has simd support for some architectures
config BR2_PACKAGE_JPEG_SIMD_SUPPORT
bool
- default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON
+ default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON || \
+ BR2_POWERPC_CPU_HAS_ALTIVEC
if BR2_PACKAGE_JPEG
--
2.10.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH 4/4] jpeg-turbo: add simd support for aarch64
2016-12-11 15:52 [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config Peter Korsgaard
2016-12-11 15:52 ` [Buildroot] [PATCH 2/4] jpeg: rework jpeg-turbo simd support handling Peter Korsgaard
2016-12-11 15:52 ` [Buildroot] [PATCH 3/4] jpeg-turbo: add simd support for powerpc cores with altivec Peter Korsgaard
@ 2016-12-11 15:52 ` Peter Korsgaard
2016-12-11 17:34 ` [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config Thomas Petazzoni
3 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2016-12-11 15:52 UTC (permalink / raw)
To: buildroot
From the 1.5-b1 release notes:
Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used
compression algorithms (including the slow integer forward DCT and h2v2 &
h2v1 downsampling algorithms, which are not accelerated in the 32-bit NEON
implementation.) This speeds up the compression of full-color JPEGs by about
75% on average on a Cavium ThunderX processor and by about 2-2.5x on average
on Cortex-A53 and Cortex-A57 cores.
Add it unconditionally for all aarch64 cores, as neon support is required
for all "standard" ARMv8 implementations. If an ARMv8 implementation w/o
NEON ever shows up, then we will need to add a BR2_AARCH64_CPU_HAS_NEON and
handle it like ARM.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
package/jpeg/Config.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/package/jpeg/Config.in b/package/jpeg/Config.in
index 926f12e..9bf9712 100644
--- a/package/jpeg/Config.in
+++ b/package/jpeg/Config.in
@@ -7,7 +7,9 @@ config BR2_PACKAGE_JPEG
config BR2_PACKAGE_JPEG_SIMD_SUPPORT
bool
default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON || \
- BR2_POWERPC_CPU_HAS_ALTIVEC
+ BR2_POWERPC_CPU_HAS_ALTIVEC || \
+ BR2_aarch64 || BR2_aarch64_be
+
if BR2_PACKAGE_JPEG
--
2.10.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config
2016-12-11 15:52 [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config Peter Korsgaard
` (2 preceding siblings ...)
2016-12-11 15:52 ` [Buildroot] [PATCH 4/4] jpeg-turbo: add simd support for aarch64 Peter Korsgaard
@ 2016-12-11 17:34 ` Thomas Petazzoni
2016-12-11 17:37 ` Peter Korsgaard
3 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-12-11 17:34 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 11 Dec 2016 16:52:16 +0100, Peter Korsgaard wrote:
> The jpeg-turbo configure script now contains PKG_PROG_PKG_CONFIG, even
> though it doesn't so far use pkg-config to detect any dependencies (it does
> install a .pc file now though):
>
> checking pkg-config is at least version 0.9.0... ./configure: line 13540: \
> /home/peko/source/buildroot/output/host/usr/bin/pkg-config: No such file or directory
>
> Depend on host-pkgconf for consistency.
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
> package/jpeg-turbo/jpeg-turbo.mk | 1 +
> 1 file changed, 1 insertion(+)
All four patches applied, thanks. Notice that on PATCH 3/4, you had a
mix of tabs and spaces for the indentation of the PowerPC Altivec
dependency.
Also, since you are interested about jpeg-turbo, what about adding
yourself for this package in DEVELOPERS? We already have another
developer, but who isn't really active, so having someone else would be
good.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread* [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config
2016-12-11 17:34 ` [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config Thomas Petazzoni
@ 2016-12-11 17:37 ` Peter Korsgaard
2016-12-11 17:40 ` Thomas Petazzoni
0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2016-12-11 17:37 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Hi,
> All four patches applied, thanks. Notice that on PATCH 3/4, you had a
> mix of tabs and spaces for the indentation of the PowerPC Altivec
> dependency.
Ups, thanks for fixing.
> Also, since you are interested about jpeg-turbo, what about adding
> yourself for this package in DEVELOPERS? We already have another
> developer, but who isn't really active, so having someone else would be
> good.
Sure, I can do that. I'll send a patch.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/4] jpeg-turbo: now checks for pkg-config
2016-12-11 17:37 ` Peter Korsgaard
@ 2016-12-11 17:40 ` Thomas Petazzoni
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2016-12-11 17:40 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 11 Dec 2016 18:37:04 +0100, Peter Korsgaard wrote:
> > All four patches applied, thanks. Notice that on PATCH 3/4, you had a
> > mix of tabs and spaces for the indentation of the PowerPC Altivec
> > dependency.
>
> Ups, thanks for fixing.
And I somehow screw things up when fixing your typo, so I had to make a
follow-up commit :-/
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread