Re: [PATCH 4/9] gnu: mesa: Add support for powerpc-linux.

2021-04-06 Thread Efraim Flashner
On Tue, Apr 06, 2021 at 03:32:48PM +0300, Efraim Flashner wrote:
>  
> +   ;; The llvm-based tests are flakey on non-Intel hardware.
> +   #:tests? ,(if (string=? "powerpc-linux" (or (%current-system)
> +   (%current-target-system)))
> +   '#f '#t)
> +
> 

Looks like Charlène of OpenBSD (I think?) is right, there are some
endianness bugs in mesa with llvm. I've tried, building mesa for powerpc
without llvm isn't actually possible, so disabled tests for now.

Snippet from the test suite log:

Testing util_format_a1b5g5r5_unorm_unpack_rgba_8unorm ...
FAILED: {0x39, 0xc5, 0x00, 0x00} obtained
{0x00, 0x00, 0xff, 0x00} expected
FAILED: {0xc5, 0x00, 0x18, 0xff} obtained
{0x00, 0xff, 0x00, 0x00} expected
FAILED: {0x00, 0x18, 0xe6, 0x00} obtained
{0xff, 0x00, 0x00, 0x00} expected
FAILED: {0x00, 0x20, 0x00, 0x00} obtained
{0x00, 0x00, 0x00, 0xff} expected
Testing util_format_a1b5g5r5_unorm_norm_flags ...
Testing util_format_x1b5g5r5_unorm_fetch_rgba_float ...
FAILED: {0.225806, 0.774194, 0.00, 1.00} obtained
{0.00, 0.00, 1.00, 1.00} expected
FAILED: {0.774194, 0.00, 0.096774, 1.00} obtained
{0.00, 1.00, 0.00, 1.00} expected
FAILED: {0.00, 0.096774, 0.903226, 1.00} obtained
{1.00, 0.00, 0.00, 1.00} expected
FAILED: {1.00, 0.870968, 1.00, 1.00} obtained
{1.00, 1.00, 1.00, 1.00} expected
Testing util_format_x1b5g5r5_unorm_pack_rgba_float ...
FAILED: 00 3e obtained
3e 00 expected
FAILED: 07 c0 obtained
c0 07 expected
FAILED: f8 00 obtained
00 f8 expected
FAILED: ff fe obtained
fe ff expected


-- 
Efraim Flashner  אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted


signature.asc
Description: PGP signature


[PATCH 4/9] gnu: mesa: Add support for powerpc-linux.

2021-04-06 Thread Efraim Flashner
* gnu/packages/gl.scm (mesa)[inputs]: Add llvm, glslang for powerpc.
[arguments]: Customize the configure flags for powerpc. Skip tests on
powerpc.
---
 gnu/packages/gl.scm | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index ee29a79366..3b6a829031 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -271,7 +271,7 @@ also known as DXTn or DXTC) for Mesa.")
 ("libxrandr" ,libxrandr)
 ("libxvmc" ,libxvmc)
 ,@(match (%current-system)
-((or "x86_64-linux" "i686-linux")
+((or "x86_64-linux" "i686-linux" "powerpc-linux")
  ;; Note: update the 'clang' input of mesa-opencl when bumping 
this.
  `(("llvm" ,llvm-11)))
 (_
@@ -283,7 +283,7 @@ also known as DXTn or DXTC) for Mesa.")
 ("flex" ,flex)
 ("gettext" ,gettext-minimal)
 ,@(match (%current-system)
-((or "x86_64-linux" "i686-linux")
+((or "x86_64-linux" "i686-linux" "powerpc-linux")
  `(("glslang" ,glslang)))
 (_
  `()))
@@ -298,6 +298,8 @@ also known as DXTn or DXTC) for Mesa.")
  ((or "armhf-linux" "aarch64-linux")
   ;; TODO: Fix svga driver for aarch64 and armhf.
   
'("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,panfrost,r300,r600,swrast,tegra,v3d,vc4,virgl"))
+ ("powerpc-linux"
+  '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,swrast,virgl"))
  (_
   
'("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
  ;; Enable various optional features.  TODO: opencl requires libclc,
@@ -318,12 +320,14 @@ also known as DXTn or DXTC) for Mesa.")
  ,@(match (%current-system)
  ((or "i686-linux" "x86_64-linux")
   '("-Dvulkan-drivers=intel,amd"))
+ ("powerpc-linux"   ; No default on this platform.
+  '("-Dvulkan-drivers=amd"))
  (_
   '("-Dvulkan-drivers=auto")))
 
  ;; Enable the Vulkan overlay layer on i686-linux and x86-64-linux.
  ,@(match (%current-system)
- ((or "x86_64-linux" "i686-linux")
+ ((or "x86_64-linux" "i686-linux" "powerpc-linux")
   '("-Dvulkan-overlay-layer=true"))
  (_
   '()))
@@ -337,6 +341,9 @@ also known as DXTn or DXTC) for Mesa.")
  ((or "x86_64-linux" "i686-linux")
   '("-Ddri-drivers=i915,i965,nouveau,r200,r100"
 "-Dllvm=enabled"))  ; default is x86/x86_64 only
+ ("powerpc-linux"
+  '("-Ddri-drivers=nouveau,r200,r100"
+"-Dllvm=enabled"))
  (_
   '("-Ddri-drivers=nouveau,r200,r100"
 
@@ -344,6 +351,11 @@ also known as DXTn or DXTC) for Mesa.")
;; documentation recommends using 'release' for performance anyway.
#:build-type "release"
 
+   ;; The llvm-based tests are flakey on non-Intel hardware.
+   #:tests? ,(if (string=? "powerpc-linux" (or (%current-system)
+   (%current-target-system)))
+   '#f '#t)
+
#:modules ((ice-9 match)
   (srfi srfi-1)
   (guix build utils)
-- 
2.31.1