Sat Oct 22 12:22:01 2022 UTC ()
x11/pixman: update the patch to pixman-vmx.c for powerpc.

This gets rid of the warnings and simplifies the code, ref.
the discussion in
https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/64


(he)
diff -r1.84 -r1.85 pkgsrc/x11/pixman/Makefile
diff -r1.72 -r1.73 pkgsrc/x11/pixman/distinfo
diff -r1.4 -r1.5 pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c

cvs diff -r1.84 -r1.85 pkgsrc/x11/pixman/Makefile (expand / switch to unified diff)

--- pkgsrc/x11/pixman/Makefile 2022/10/19 17:14:32 1.84
+++ pkgsrc/x11/pixman/Makefile 2022/10/22 12:22:01 1.85
@@ -1,29 +1,31 @@ @@ -1,29 +1,31 @@
1# $NetBSD: Makefile,v 1.84 2022/10/19 17:14:32 he Exp $ 1# $NetBSD: Makefile,v 1.85 2022/10/22 12:22:01 he Exp $
2 2
3DISTNAME= pixman-0.42.0 3DISTNAME= pixman-0.42.0
4PKGREVISION= 2 4PKGREVISION= 3
5CATEGORIES= x11 5CATEGORIES= x11
6MASTER_SITES= ${MASTER_SITE_XORG:=lib/} 6MASTER_SITES= ${MASTER_SITE_XORG:=lib/}
7EXTRACT_SUFX= .tar.xz 7EXTRACT_SUFX= .tar.xz
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://xorg.freedesktop.org/ 10HOMEPAGE= https://xorg.freedesktop.org/
11COMMENT= Library of low-level pixel manipulation routines 11COMMENT= Library of low-level pixel manipulation routines
12LICENSE= mit 12LICENSE= mit
13 13
14CHECK_PORTABILITY_SKIP+= Makefile.am # already patched in Makefile.in 14CHECK_PORTABILITY_SKIP+= Makefile.am # already patched in Makefile.in
15 15
16GNU_CONFIGURE= yes 16GNU_CONFIGURE= yes
17.if ${MACHINE_ARCH} == i386 17.if ${MACHINE_ARCH} == i386
18CONFIGURE_ARGS+= --disable-sse2 18CONFIGURE_ARGS+= --disable-sse2
19.endif 19.endif
20 20
21USE_LIBTOOL= yes 21USE_LIBTOOL= yes
22USE_TOOLS+= perl 22USE_TOOLS+= perl
23 23
24PKGCONFIG_OVERRIDE+= pixman-1.pc.in 24PKGCONFIG_OVERRIDE+= pixman-1.pc.in
25PKGCONFIG_OVERRIDE+= pixman-1-uninstalled.pc.in 25PKGCONFIG_OVERRIDE+= pixman-1-uninstalled.pc.in
26 26
 27TEST_TARGET= check
 28
27X11_LIB_NAME?= pixman 29X11_LIB_NAME?= pixman
28.include "../../meta-pkgs/modular-xorg/avoid-duplicate.mk" 30.include "../../meta-pkgs/modular-xorg/avoid-duplicate.mk"
29.include "../../mk/bsd.pkg.mk" 31.include "../../mk/bsd.pkg.mk"

cvs diff -r1.72 -r1.73 pkgsrc/x11/pixman/distinfo (expand / switch to unified diff)

--- pkgsrc/x11/pixman/distinfo 2022/10/20 09:35:15 1.72
+++ pkgsrc/x11/pixman/distinfo 2022/10/22 12:22:01 1.73
@@ -1,8 +1,11 @@ @@ -1,8 +1,11 @@
1$NetBSD: distinfo,v 1.72 2022/10/20 09:35:15 jperkin Exp $ 1$NetBSD: distinfo,v 1.73 2022/10/22 12:22:01 he Exp $
2 2
3BLAKE2s (pixman-0.42.0.tar.xz) = 9846ec6a902afa54328b18a9a58cbdf7ad066aa69cbbfddb145b1475c6ad8899 3BLAKE2s (pixman-0.42.0.tar.xz) = 9846ec6a902afa54328b18a9a58cbdf7ad066aa69cbbfddb145b1475c6ad8899
4SHA512 (pixman-0.42.0.tar.xz) = 43d43d1aef9b8a6167098ab68ce2cfd8c0429c4825d40a4fb468b5b51dc1a2035f8bd1b70413e4ecd77deb469b5d558f42171b423e348d5ddd8604c466ffc7d9 4SHA512 (pixman-0.42.0.tar.xz) = 43d43d1aef9b8a6167098ab68ce2cfd8c0429c4825d40a4fb468b5b51dc1a2035f8bd1b70413e4ecd77deb469b5d558f42171b423e348d5ddd8604c466ffc7d9
5Size (pixman-0.42.0.tar.xz) = 652780 bytes 5Size (pixman-0.42.0.tar.xz) = 652780 bytes
 6<<<<<<< distinfo
 7=======
 8>>>>>>> 1.72
6SHA1 (patch-Makefile.in) = 244969af69e43472d43d8cd1556abacf9ec679e0 9SHA1 (patch-Makefile.in) = 244969af69e43472d43d8cd1556abacf9ec679e0
7SHA1 (patch-configure) = 909bf50acfd69700b26bd55a47f93fd77b49226c 10SHA1 (patch-configure) = 909bf50acfd69700b26bd55a47f93fd77b49226c
8SHA1 (patch-pixman_pixman-vmx.c) = 26ee87f2d1ffabf89fc1e2ed6cd50abbb2fc86cd 11SHA1 (patch-pixman_pixman-vmx.c) = 8ca3649a5dd0527ce078af1b91fb01611dde9b45

cvs diff -r1.4 -r1.5 pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c (expand / switch to unified diff)

--- pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c 2022/10/20 09:35:15 1.4
+++ pkgsrc/x11/pixman/patches/patch-pixman_pixman-vmx.c 2022/10/22 12:22:01 1.5
@@ -1,83 +1,80 @@ @@ -1,83 +1,80 @@
1$NetBSD: patch-pixman_pixman-vmx.c,v 1.4 2022/10/20 09:35:15 jperkin Exp $ 1$NetBSD: patch-pixman_pixman-vmx.c,v 1.5 2022/10/22 12:22:01 he Exp $
2 2
3Add a fix so that this builds on NetBSD/powerpc. Otherwise we get 3Add a fix so that this builds without warnings on NetBSD/powerpc.
4pixman-vmx.c:2936:5: error: subscripted value is neither array nor pointer 4Also do some simplification.
5Also fix something which clearly must be bugs with loading 
6vector registers from single 32-bit ints. 
7 5
8https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/64/ 6https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests/64/
9 7
10--- pixman/pixman-vmx.c.orig 2021-03-01 13:49:17.000000000 +0000 8--- pixman/pixman-vmx.c.orig 2021-03-01 13:49:17.000000000 +0000
11+++ pixman/pixman-vmx.c 9+++ pixman/pixman-vmx.c
12@@ -292,7 +292,9 @@ create_mask_1x32_128 (const uint32_t *sr 10@@ -278,21 +278,10 @@ save_128_aligned (uint32_t* data,
 11 STORE_VECTOR(data)
 12 }
 13
 14-static force_inline vector unsigned int
 15-create_mask_1x32_128 (const uint32_t *src)
 16-{
 17- vector unsigned int vsrc;
 18- DECLARE_SRC_MASK_VAR;
 19-
 20- COMPUTE_SHIFT_MASK (src);
 21- LOAD_VECTOR (src);
 22- return vec_splat(vsrc, 0);
 23-}
 24-
13 static force_inline vector unsigned int 25 static force_inline vector unsigned int
14 create_mask_32_128 (uint32_t mask) 26 create_mask_32_128 (uint32_t mask)
15 { 27 {
16- return create_mask_1x32_128(&mask); 28- return create_mask_1x32_128(&mask);
17+ uint32_t nmask[4]; /* vector sized array */ 29+ return (vector unsigned int) {mask, mask, mask, mask};
18+ nmask[3] = nmask[2] = nmask[1] = nmask[0] = mask; 
19+ return create_mask_1x32_128(nmask); 
20 } 30 }
21  31
22 static force_inline vector unsigned int 32 static force_inline vector unsigned int
23@@ -2435,6 +2437,9 @@ vmx_fill (pixman_implementation_t *imp, 33@@ -2471,7 +2460,7 @@ vmx_fill (pixman_implementation_t *imp,
24 uint8_t *byte_line; 
25  
26 vector unsigned int vfiller; 
27+ uint32_t fillers[4]; 
28+ 
29+ fillers[3] = fillers[2] = fillers[1] = fillers[0] = filler; 
30  
31 if (bpp == 8) 
32 { 
33@@ -2471,7 +2476,7 @@ vmx_fill (pixman_implementation_t *imp, 
34 return FALSE; 34 return FALSE;
35 } 35 }
36  36
37- vfiller = create_mask_1x32_128(&filler); 37- vfiller = create_mask_1x32_128(&filler);
38+ vfiller = create_mask_1x32_128(fillers); 38+ vfiller = create_mask_32_128(filler);
39  39
40 while (height--) 40 while (height--)
41 { 41 {
42@@ -2913,32 +2918,29 @@ scaled_nearest_scanline_vmx_8888_8888_OV 42@@ -2913,32 +2902,26 @@ scaled_nearest_scanline_vmx_8888_8888_OVER (uint32_t* pd,
43  43
44 while (w >= 4) 44 while (w >= 4)
45 { 45 {
46- vector unsigned int tmp; 46- vector unsigned int tmp;
47- uint32_t tmp1, tmp2, tmp3, tmp4; 47- uint32_t tmp1, tmp2, tmp3, tmp4;
48+ union { 48+ uint32_t tmp[4];
49+ vector unsigned int tmp; 
50+ uint32_t tmp1[4]; 
51+ } u; 
52  49
53- tmp1 = *(ps + pixman_fixed_to_int (vx)); 50- tmp1 = *(ps + pixman_fixed_to_int (vx));
54+ u.tmp1[0] = *(ps + pixman_fixed_to_int (vx)); 51+ tmp[0] = *(ps + pixman_fixed_to_int (vx));
55 vx += unit_x; 52 vx += unit_x;
56 while (vx >= 0) 53 while (vx >= 0)
57 vx -= src_width_fixed; 54 vx -= src_width_fixed;
58- tmp2 = *(ps + pixman_fixed_to_int (vx)); 55- tmp2 = *(ps + pixman_fixed_to_int (vx));
59+ u.tmp1[1] = *(ps + pixman_fixed_to_int (vx)); 56+ tmp[1] = *(ps + pixman_fixed_to_int (vx));
60 vx += unit_x; 57 vx += unit_x;
61 while (vx >= 0) 58 while (vx >= 0)
62 vx -= src_width_fixed; 59 vx -= src_width_fixed;
63- tmp3 = *(ps + pixman_fixed_to_int (vx)); 60- tmp3 = *(ps + pixman_fixed_to_int (vx));
64+ u.tmp1[2] = *(ps + pixman_fixed_to_int (vx)); 61+ tmp[2] = *(ps + pixman_fixed_to_int (vx));
65 vx += unit_x; 62 vx += unit_x;
66 while (vx >= 0) 63 while (vx >= 0)
67 vx -= src_width_fixed; 64 vx -= src_width_fixed;
68- tmp4 = *(ps + pixman_fixed_to_int (vx)); 65- tmp4 = *(ps + pixman_fixed_to_int (vx));
69+ u.tmp1[3] = *(ps + pixman_fixed_to_int (vx)); 66+ tmp[3] = *(ps + pixman_fixed_to_int (vx));
70 vx += unit_x; 67 vx += unit_x;
71 while (vx >= 0) 68 while (vx >= 0)
72 vx -= src_width_fixed; 69 vx -= src_width_fixed;
73  70
74- tmp[0] = tmp1; 71- tmp[0] = tmp1;
75- tmp[1] = tmp2; 72- tmp[1] = tmp2;
76- tmp[2] = tmp3; 73- tmp[2] = tmp3;
77- tmp[3] = tmp4; 74- tmp[3] = tmp4;
78- 75-
79- vsrc = combine4 ((const uint32_t *) &tmp, pm); 76- vsrc = combine4 ((const uint32_t *) &tmp, pm);
80+ vsrc = combine4 ((const uint32_t *) &u.tmp, pm); 77+ vsrc = combine4 (tmp, pm);
81  78
82 if (is_opaque (vsrc)) 79 if (is_opaque (vsrc))
83 { 80 {