Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support
@ 2025-04-21 21:37 Charlie Jenkins
  2025-04-21 21:37 ` [Buildroot] [PATCH v2 1/2] package/pixman: Only compile with riscv vector support when selected Charlie Jenkins
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Charlie Jenkins @ 2025-04-21 21:37 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Charlie Jenkins

Pixman 0.44.0 introduced riscv vector support. Fixup the buildroot
support by only enabling the vector support when vector is enabled in
buildroot, and add a patch to detect if the toolchain supports vector.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
---
Changes in v2:
- Use pixman patch instead of buildroot hack
- Include new patch to only use vector when buildroot vector is enabled
- Link to v1: https://lore.kernel.org/r/20250410-pixman_riscv_dependency-v1-1-25d44d225acc@rivosinc.com

---
Charlie Jenkins (2):
      package/pixman: Only compile with riscv vector support when selected
      package/pixman: Fix pixman compilation on riscv

 ...-enable-RVV-on-linux-if-hwcap-headers-are.patch | 44 ++++++++++++++++++++++
 package/pixman/pixman.mk                           |  6 +++
 2 files changed, 50 insertions(+)
---
base-commit: f2b14baf2576b54cca43e6f2aebbb4a19fae3bd9
change-id: 20250410-pixman_riscv_dependency-00d2cca17b88
-- 
- Charlie

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/pixman: Only compile with riscv vector support when selected
  2025-04-21 21:37 [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support Charlie Jenkins
@ 2025-04-21 21:37 ` Charlie Jenkins
  2025-04-21 21:37 ` [Buildroot] [PATCH v2 2/2] package/pixman: Fix pixman compilation on riscv Charlie Jenkins
  2025-04-22 19:41 ` [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support Thomas Petazzoni via buildroot
  2 siblings, 0 replies; 6+ messages in thread
From: Charlie Jenkins @ 2025-04-21 21:37 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Charlie Jenkins

Pixman defaults to building with the riscv vector extension. Instead,
only build with vector if the buildroot user has selected
BR2_RISCV_ISA_RVV.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
---
 package/pixman/pixman.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/pixman/pixman.mk b/package/pixman/pixman.mk
index 391950cbfc31bd11eeb6765d6fd6b388b0d481f8..76e72d6d96161f9458cad71a8437e46b3fdf4d95 100644
--- a/package/pixman/pixman.mk
+++ b/package/pixman/pixman.mk
@@ -74,6 +74,12 @@ else
 PIXMAN_CONF_OPTS += -Da64-neon=disabled
 endif
 
+ifeq ($(BR2_RISCV_ISA_RVV),y)
+PIXMAN_CONF_OPTS += -Drvv=enabled
+else
+PIXMAN_CONF_OPTS += -Drvv=disabled
+endif
+
 PIXMAN_CFLAGS = $(TARGET_CFLAGS)
 
 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_101737),y)

-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/pixman: Fix pixman compilation on riscv
  2025-04-21 21:37 [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support Charlie Jenkins
  2025-04-21 21:37 ` [Buildroot] [PATCH v2 1/2] package/pixman: Only compile with riscv vector support when selected Charlie Jenkins
@ 2025-04-21 21:37 ` Charlie Jenkins
  2025-04-22  6:57   ` Thomas Petazzoni via buildroot
  2025-04-22 19:41 ` [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support Thomas Petazzoni via buildroot
  2 siblings, 1 reply; 6+ messages in thread
From: Charlie Jenkins @ 2025-04-21 21:37 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Charlie Jenkins

When the riscv vector extension is enabled for pixman, it assumes that
the kernel headers also support riscv vector. Apply a patch that
disables riscv vector in pixman if the Linux headers do not support
COMPAT_HWCAP_ISA_V which pixman requires for vector runtime detection.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Fixes: http://autobuild.buildroot.net/results/4ecdf5320716ec8b39f09fde3fcbbdcdb557f8ab/
---
 ...-enable-RVV-on-linux-if-hwcap-headers-are.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/package/pixman/0001-RISC-V-Only-enable-RVV-on-linux-if-hwcap-headers-are.patch b/package/pixman/0001-RISC-V-Only-enable-RVV-on-linux-if-hwcap-headers-are.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a76963324c0d62d7e9d25e4ebdda747a29f99ae7
--- /dev/null
+++ b/package/pixman/0001-RISC-V-Only-enable-RVV-on-linux-if-hwcap-headers-are.patch
@@ -0,0 +1,44 @@
+From d0045f1fc32635d9629ea9e361631b07d9ca4140 Mon Sep 17 00:00:00 2001
+From: Charlie Jenkins <charlie@rivosinc.com>
+Date: Mon, 21 Apr 2025 13:08:50 -0700
+Subject: [PATCH] RISC-V: Only enable RVV on linux if hwcap headers are
+ available
+
+Linux 6.4 introduced COMPAT_HWCAP_ISA_V. When trying to compile pixman
+against linux headers older than this, pixman will fail to compile
+because it assumes COMPAT_HWCAP_ISA_V exists.
+
+During meson configuration, do not enable have_rvv if the platform is
+Linux and COMPAT_HWCAP_ISA_V doesn't exist.
+
+Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
+Fixes: 0e424031bda2 ("RISC-V floating point operations")
+Upstream: Pending
+---
+ meson.build | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index fdea28f..cb10931 100644
+--- a/meson.build
++++ b/meson.build
+@@ -379,7 +379,15 @@ if not use_rvv.disabled()
+         }
+       ''',
+       args : rvv_flags,
+-      name : 'RISC-V Vector Intrinsic Support')
++      name : 'RISC-V Vector Intrinsic Support') and cc.compiles('''
++      #if defined(__linux__)
++      #include <asm/hwcap.h>
++      #include <sys/auxv.h>
++      COMPAT_HWCAP_ISA_V
++      #endif
++      ''',
++      args : rvv_flags,
++      name: 'RISC-V Vector Linux HWCAP Support')
+       have_rvv = true
+     endif
+   endif
+-- 
+2.43.0
+

-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2 2/2] package/pixman: Fix pixman compilation on riscv
  2025-04-21 21:37 ` [Buildroot] [PATCH v2 2/2] package/pixman: Fix pixman compilation on riscv Charlie Jenkins
@ 2025-04-22  6:57   ` Thomas Petazzoni via buildroot
  2025-04-22 17:54     ` Charlie Jenkins
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-04-22  6:57 UTC (permalink / raw)
  To: Charlie Jenkins; +Cc: buildroot

Hello Charlie,

On Mon, 21 Apr 2025 14:37:04 -0700
Charlie Jenkins <charlie@rivosinc.com> wrote:

> When the riscv vector extension is enabled for pixman, it assumes that
> the kernel headers also support riscv vector. Apply a patch that
> disables riscv vector in pixman if the Linux headers do not support
> COMPAT_HWCAP_ISA_V which pixman requires for vector runtime detection.
> 
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> Fixes: http://autobuild.buildroot.net/results/4ecdf5320716ec8b39f09fde3fcbbdcdb557f8ab/

Thanks for the new iteration! One question below.

> +Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> +Fixes: 0e424031bda2 ("RISC-V floating point operations")
> +Upstream: Pending

Rather than just "Pending", we like to have here the link to the
submission, either a like to the PR/MR, or to the mail posted on a
mailing list. Could you provide that? No need to resend a v3 just for
that, it can be fixed up when we apply your patch.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2 2/2] package/pixman: Fix pixman compilation on riscv
  2025-04-22  6:57   ` Thomas Petazzoni via buildroot
@ 2025-04-22 17:54     ` Charlie Jenkins
  0 siblings, 0 replies; 6+ messages in thread
From: Charlie Jenkins @ 2025-04-22 17:54 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On Tue, Apr 22, 2025 at 08:57:30AM +0200, Thomas Petazzoni wrote:
> Hello Charlie,
> 
> On Mon, 21 Apr 2025 14:37:04 -0700
> Charlie Jenkins <charlie@rivosinc.com> wrote:
> 
> > When the riscv vector extension is enabled for pixman, it assumes that
> > the kernel headers also support riscv vector. Apply a patch that
> > disables riscv vector in pixman if the Linux headers do not support
> > COMPAT_HWCAP_ISA_V which pixman requires for vector runtime detection.
> > 
> > Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> > Fixes: http://autobuild.buildroot.net/results/4ecdf5320716ec8b39f09fde3fcbbdcdb557f8ab/
> 
> Thanks for the new iteration! One question below.
> 
> > +Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> > +Fixes: 0e424031bda2 ("RISC-V floating point operations")
> > +Upstream: Pending
> 
> Rather than just "Pending", we like to have here the link to the
> submission, either a like to the PR/MR, or to the mail posted on a
> mailing list. Could you provide that? No need to resend a v3 just for
> that, it can be fixed up when we apply your patch.

I had to wait for approval to open the MR and I wasn't sure how long it
would take! It ended up being very fast. Here is the MR I opened on the
pixman gitlab
https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/149.

- Charlie

> 
> Thanks a lot!
> 
> Thomas
> -- 
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support
  2025-04-21 21:37 [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support Charlie Jenkins
  2025-04-21 21:37 ` [Buildroot] [PATCH v2 1/2] package/pixman: Only compile with riscv vector support when selected Charlie Jenkins
  2025-04-21 21:37 ` [Buildroot] [PATCH v2 2/2] package/pixman: Fix pixman compilation on riscv Charlie Jenkins
@ 2025-04-22 19:41 ` Thomas Petazzoni via buildroot
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-04-22 19:41 UTC (permalink / raw)
  To: Charlie Jenkins; +Cc: buildroot

Hello Charlie,

On Mon, 21 Apr 2025 14:37:02 -0700
Charlie Jenkins <charlie@rivosinc.com> wrote:

> Charlie Jenkins (2):
>       package/pixman: Only compile with riscv vector support when selected
>       package/pixman: Fix pixman compilation on riscv

Thanks, both applied.

Aside from the Upstream: link on the second patch, one thing that was
missing for the commit messages was since *when* the issue existed in
Buildroot, which helps the people who maintain our LTS/stable branches
to understand if those patches should be backported or not. So I've
added that information, but it would be great to include it in your
future contributions.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-22 19:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-21 21:37 [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support Charlie Jenkins
2025-04-21 21:37 ` [Buildroot] [PATCH v2 1/2] package/pixman: Only compile with riscv vector support when selected Charlie Jenkins
2025-04-21 21:37 ` [Buildroot] [PATCH v2 2/2] package/pixman: Fix pixman compilation on riscv Charlie Jenkins
2025-04-22  6:57   ` Thomas Petazzoni via buildroot
2025-04-22 17:54     ` Charlie Jenkins
2025-04-22 19:41 ` [Buildroot] [PATCH v2 0/2] package/pixman: Fix riscv vector support Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox