The permutation vector isn't correct for LE, so correct its values
in case we are in LE mode.

v2:

- replace _LITTLE_ENDIAN with WORDS_BIGENDIAN for consistency
- change #ifndef to #ifdef for readability

Signed-off-by: Oded Gabbay <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
---
 pixman/pixman-vmx.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index c33631c..d0a4fc8 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -37,10 +37,17 @@
 static force_inline vector unsigned int
 splat_alpha (vector unsigned int pix)
 {
+#ifdef WORDS_BIGENDIAN
     return vec_perm (pix, pix,
                     (vector unsigned char)AVV (
                         0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04,
                         0x08, 0x08, 0x08, 0x08, 0x0C, 0x0C, 0x0C, 0x0C));
+#else
+    return vec_perm (pix, pix,
+                    (vector unsigned char)AVV (
+                        0x03, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07,
+                        0x0B, 0x0B, 0x0B, 0x0B, 0x0F, 0x0F, 0x0F, 0x0F));
+#endif
 }
 
 static force_inline vector unsigned int
-- 
2.4.3

_______________________________________________
Pixman mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to