summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/xorg-lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-graphics/xorg-lib')
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch121
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/pixman-0.27.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch145
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/pixman-0.27.2/0002-Generic-C-implementation-of-pixman_blt-with-overlapp.patch (renamed from meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0008-Generic-C-implementation-of-pixman_blt-with-overlapp.patch)37
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/pixman_0.27.2.bbappend (renamed from meta-oe/recipes-graphics/xorg-lib/pixman_0.26.2.bbappend)5
4 files changed, 172 insertions, 136 deletions
diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
deleted file mode 100644
index b56e690e9..000000000
--- a/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
+++ /dev/null
@@ -1,121 +0,0 @@
1From dad8537110c27b45795f8879a3e0a54aa77546b9 Mon Sep 17 00:00:00 2001
2From: Siarhei Siamashka <siarhei.siamashka@nokia.com>
3Date: Tue, 11 Jan 2011 18:10:39 +0200
4Subject: [PATCH] ARM: qemu related workarounds in cpu features detection code
5
6Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
7---
8 pixman/pixman-cpu.c | 67 +++++++++++++++++++++++++++++++++++++++++---------
9 1 files changed, 55 insertions(+), 12 deletions(-)
10
11diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c
12index aa9036f..a8f2494 100644
13--- a/pixman/pixman-cpu.c
14+++ b/pixman/pixman-cpu.c
15@@ -333,15 +333,30 @@ pixman_arm_read_auxv_or_cpu_features ()
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 #include <sys/mman.h>
19+#include <sys/utsname.h>
20 #include <fcntl.h>
21 #include <string.h>
22 #include <elf.h>
23
24+/*
25+ * The whole CPU capabilities detection is a bit ugly: when running in
26+ * userspace qemu, we see /proc/self/auxv from the host system. To make
27+ * everything even worse, the size of each value is 64-bit when running
28+ * on a 64-bit host system. So the data is totally bogus because we expect
29+ * 32-bit values. As AT_PLATFORM value is used as a pointer, it may cause
30+ * segfault (null pointer dereference on x86-64 host). So in order to be
31+ * on a safe side, we require that AT_PLATFORM value is found only once,
32+ * and it has non-zero value (this is still not totally reliable for a big
33+ * endian 64-bit host system running qemu and may theoretically fail).
34+ */
35 static void
36 pixman_arm_read_auxv_or_cpu_features ()
37 {
38 int fd;
39 Elf32_auxv_t aux;
40+ uint32_t hwcap = 0;
41+ const char *plat = NULL;
42+ int plat_cnt = 0;
43
44 fd = open ("/proc/self/auxv", O_RDONLY);
45 if (fd >= 0)
46@@ -350,32 +365,60 @@ pixman_arm_read_auxv_or_cpu_features ()
47 {
48 if (aux.a_type == AT_HWCAP)
49 {
50- uint32_t hwcap = aux.a_un.a_val;
51- /* hardcode these values to avoid depending on specific
52- * versions of the hwcap header, e.g. HWCAP_NEON
53- */
54- arm_has_vfp = (hwcap & 64) != 0;
55- arm_has_iwmmxt = (hwcap & 512) != 0;
56- /* this flag is only present on kernel 2.6.29 */
57- arm_has_neon = (hwcap & 4096) != 0;
58+ hwcap = aux.a_un.a_val;
59 }
60 else if (aux.a_type == AT_PLATFORM)
61 {
62- const char *plat = (const char*) aux.a_un.a_val;
63- if (strncmp (plat, "v7l", 3) == 0)
64+ plat = (const char*) aux.a_un.a_val;
65+ plat_cnt++;
66+ }
67+ }
68+ close (fd);
69+
70+ if (plat == NULL || plat_cnt != 1 || *plat != 'v')
71+ {
72+ /*
73+ * Something seems to be really wrong, most likely we are
74+ * running under qemu. Let's use machine type from "uname" for
75+ * CPU capabilities detection:
76+ * http://www.mail-archive.com/qemu-devel at nongnu.org/msg22212.html
77+ */
78+ struct utsname u;
79+ hwcap = 0; /* clear hwcap, because it is bogus */
80+ if (uname (&u) == 0)
81+ {
82+ if (strcmp (u.machine, "armv7l") == 0)
83 {
84 arm_has_v7 = TRUE;
85 arm_has_v6 = TRUE;
86+ hwcap |= 64; /* qemu is supposed to emulate vfp */
87+ hwcap |= 4096; /* qemu is supposed to emulate neon */
88 }
89- else if (strncmp (plat, "v6l", 3) == 0)
90+ else if (strcmp (u.machine, "armv6l") == 0)
91 {
92 arm_has_v6 = TRUE;
93+ hwcap |= 64; /* qemu is supposed to emulate vfp */
94 }
95 }
96 }
97- close (fd);
98+ else if (strncmp (plat, "v7l", 3) == 0)
99+ {
100+ arm_has_v7 = TRUE;
101+ arm_has_v6 = TRUE;
102+ }
103+ else if (strncmp (plat, "v6l", 3) == 0)
104+ {
105+ arm_has_v6 = TRUE;
106+ }
107 }
108
109+ /* hardcode these values to avoid depending on specific
110+ * versions of the hwcap header, e.g. HWCAP_NEON
111+ */
112+ arm_has_vfp = (hwcap & 64) != 0;
113+ arm_has_iwmmxt = (hwcap & 512) != 0;
114+ arm_has_neon = (hwcap & 4096) != 0;
115+
116 arm_tests_initialized = TRUE;
117 }
118
119--
1201.7.8.6
121
diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.27.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.27.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
new file mode 100644
index 000000000..8a1c524a8
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/pixman-0.27.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
@@ -0,0 +1,145 @@
1From d140e69c1d76ed61d1feb53b79820951707ee5a6 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
3Date: Sun, 19 Aug 2012 15:15:45 +0200
4Subject: [PATCH 1/2] ARM: qemu related workarounds in cpu features detection
5 code
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10This was ported from meta-oe's patch [1]
11
12[1] http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
13
14Upstream-Status: Inappropriate [other] qemu fix
15
16Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
17---
18 pixman/pixman-arm.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++---
19 1 files changed, 69 insertions(+), 5 deletions(-)
20
21diff --git a/pixman/pixman-arm.c b/pixman/pixman-arm.c
22index 23374e4..d0771fd 100644
23--- a/pixman/pixman-arm.c
24+++ b/pixman/pixman-arm.c
25@@ -129,16 +129,35 @@ detect_cpu_features (void)
26 #include <sys/types.h>
27 #include <sys/stat.h>
28 #include <sys/mman.h>
29+#include <sys/utsname.h>
30 #include <fcntl.h>
31 #include <string.h>
32 #include <elf.h>
33
34+/*
35+ * The whole CPU capabilities detection is a bit ugly: when running in
36+ * userspace qemu, we see /proc/self/auxv from the host system. To make
37+ * everything even worse, the size of each value is 64-bit when running
38+ * on a 64-bit host system. So the data is totally bogus because we expect
39+ * 32-bit values. As AT_PLATFORM value is used as a pointer, it may cause
40+ * segfault (null pointer dereference on x86-64 host). So in order to be
41+ * on a safe side, we require that AT_PLATFORM value is found only once,
42+ * and it has non-zero value (this is still not totally reliable for a big
43+ * endian 64-bit host system running qemu and may theoretically fail).
44+ */
45+#define ARM_HWCAP_VFP 64
46+#define ARM_HWCAP_IWMMXT 512
47+#define ARM_HWCAP_NEON 4096
48+
49 static arm_cpu_features_t
50 detect_cpu_features (void)
51 {
52 arm_cpu_features_t features = 0;
53 Elf32_auxv_t aux;
54 int fd;
55+ uint32_t hwcap = 0;
56+ const char *plat = NULL;
57+ int plat_cnt = 0;
58
59 fd = open ("/proc/self/auxv", O_RDONLY);
60 if (fd >= 0)
61@@ -147,22 +166,23 @@ detect_cpu_features (void)
62 {
63 if (aux.a_type == AT_HWCAP)
64 {
65- uint32_t hwcap = aux.a_un.a_val;
66+ hwcap = aux.a_un.a_val;
67
68 /* hardcode these values to avoid depending on specific
69 * versions of the hwcap header, e.g. HWCAP_NEON
70 */
71- if ((hwcap & 64) != 0)
72+ if ((hwcap & ARM_HWCAP_VFP) != 0)
73 features |= ARM_VFP;
74- if ((hwcap & 512) != 0)
75+ if ((hwcap & ARM_HWCAP_IWMMXT) != 0)
76 features |= ARM_IWMMXT;
77 /* this flag is only present on kernel 2.6.29 */
78- if ((hwcap & 4096) != 0)
79+ if ((hwcap & ARM_HWCAP_NEON) != 0)
80 features |= ARM_NEON;
81 }
82 else if (aux.a_type == AT_PLATFORM)
83 {
84- const char *plat = (const char*) aux.a_un.a_val;
85+ plat = (const char*) aux.a_un.a_val;
86+ plat_cnt++;
87
88 if (strncmp (plat, "v7l", 3) == 0)
89 features |= (ARM_V7 | ARM_V6);
90@@ -171,8 +191,52 @@ detect_cpu_features (void)
91 }
92 }
93 close (fd);
94+
95+ if (plat == NULL || plat_cnt != 1 || *plat != 'v')
96+ {
97+ /*
98+ * Something seems to be really wrong, most likely we are
99+ * running under qemu. Let's use machine type from "uname" for
100+ * CPU capabilities detection:
101+ * http://www.mail-archive.com/qemu-devel at nongnu.org/msg22212.html
102+ */
103+ struct utsname u;
104+ hwcap = 0; /* clear hwcap, because it is bogus */
105+ if (uname (&u) == 0)
106+ {
107+ if (strcmp (u.machine, "armv7l") == 0)
108+ {
109+ features |= (ARM_V7 | ARM_V6);
110+ hwcap |= ARM_HWCAP_VFP; /* qemu is supposed to emulate vfp */
111+ hwcap |= ARM_HWCAP_NEON; /* qemu is supposed to emulate neon */
112+ }
113+ else if (strcmp (u.machine, "armv6l") == 0)
114+ {
115+ features |= ARM_V6;
116+ hwcap |= ARM_HWCAP_VFP; /* qemu is supposed to emulate vfp */
117+ }
118+ }
119+ }
120+ else if (strncmp (plat, "v7l", 3) == 0)
121+ {
122+ features |= (ARM_V7 | ARM_V6);
123+ }
124+ else if (strncmp (plat, "v6l", 3) == 0)
125+ {
126+ features |= ARM_V6;
127+ }
128 }
129
130+ /* hardcode these values to avoid depending on specific
131+ * versions of the hwcap header, e.g. HWCAP_NEON
132+ */
133+ if ((hwcap & ARM_HWCAP_VFP) != 0)
134+ features |= ARM_VFP;
135+ if ((hwcap & ARM_HWCAP_IWMMXT) != 0)
136+ features |= ARM_IWMMXT;
137+ if ((hwcap & ARM_HWCAP_NEON) != 0)
138+ features |= ARM_NEON;
139+
140 return features;
141 }
142
143--
1441.7.4.4
145
diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0008-Generic-C-implementation-of-pixman_blt-with-overlapp.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.27.2/0002-Generic-C-implementation-of-pixman_blt-with-overlapp.patch
index 34f96ed1d..abd501a10 100644
--- a/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0008-Generic-C-implementation-of-pixman_blt-with-overlapp.patch
+++ b/meta-oe/recipes-graphics/xorg-lib/pixman-0.27.2/0002-Generic-C-implementation-of-pixman_blt-with-overlapp.patch
@@ -1,8 +1,13 @@
1From 0c7aa6a3ebc29d7986d2417371df210f3e9a65b4 Mon Sep 17 00:00:00 2001 1From 211b2bcdb19f86f3868a18520df7dcb4fd122f05 Mon Sep 17 00:00:00 2001
2From: Siarhei Siamashka <siarhei.siamashka@nokia.com> 2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
3Date: Tue, 16 Mar 2010 16:55:28 +0100 3Date: Sun, 19 Aug 2012 14:48:00 +0200
4Subject: [PATCH 8/8] Generic C implementation of pixman_blt with overlapping support 4Subject: [PATCH 2/2] Generic C implementation of pixman_blt with overlapping
5 support
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
5 9
10This was ported from meta-oe's patch [1]:
6Uses memcpy/memmove functions to copy pixels, can handle the 11Uses memcpy/memmove functions to copy pixels, can handle the
7case when both source and destination areas are in the same 12case when both source and destination areas are in the same
8image (this is useful for scrolling). 13image (this is useful for scrolling).
@@ -13,16 +18,22 @@ src_stride == dst_stride). Copying direction is undefined
13for the images with different source and destination stride 18for the images with different source and destination stride
14which happen to be in the overlapped areas (but this is an 19which happen to be in the overlapped areas (but this is an
15unrealistic case anyway). 20unrealistic case anyway).
21
22[1] http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0008-Generic-C-implementation-of-pixman_blt-with-overlapp.patch
23
24Upstream-Status: Unknown - this patch is in meta-oe for a while
25
26Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
16--- 27---
17 pixman/pixman-general.c | 21 ++++++++++++++++++--- 28 pixman/pixman-general.c | 21 ++++++++++++++++++---
18 pixman/pixman-private.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 29 pixman/pixman-private.h | 43 +++++++++++++++++++++++++++++++++++++++++++
19 2 files changed, 61 insertions(+), 3 deletions(-) 30 2 files changed, 61 insertions(+), 3 deletions(-)
20 31
21diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c 32diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
22index 2ccdfcd..90461b6 100644 33index d4b2daa..a86b206 100644
23--- a/pixman/pixman-general.c 34--- a/pixman/pixman-general.c
24+++ b/pixman/pixman-general.c 35+++ b/pixman/pixman-general.c
25@@ -227,9 +227,24 @@ general_blt (pixman_implementation_t *imp, 36@@ -215,9 +215,24 @@ general_blt (pixman_implementation_t *imp,
26 int width, 37 int width,
27 int height) 38 int height)
28 { 39 {
@@ -51,10 +62,10 @@ index 2ccdfcd..90461b6 100644
51 62
52 static pixman_bool_t 63 static pixman_bool_t
53diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h 64diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
54index cbd48f3..c20d9f0 100644 65index d5e6a72..c77d256 100644
55--- a/pixman/pixman-private.h 66--- a/pixman/pixman-private.h
56+++ b/pixman/pixman-private.h 67+++ b/pixman/pixman-private.h
57@@ -10,6 +10,7 @@ 68@@ -24,6 +24,7 @@
58 69
59 #include "pixman.h" 70 #include "pixman.h"
60 #include <time.h> 71 #include <time.h>
@@ -62,9 +73,9 @@ index cbd48f3..c20d9f0 100644
62 #include <assert.h> 73 #include <assert.h>
63 #include <stdio.h> 74 #include <stdio.h>
64 #include <string.h> 75 #include <string.h>
65@@ -998,4 +999,46 @@ void pixman_timer_register (pixman_timer_t *timer); 76@@ -1096,6 +1097,48 @@ void pixman_timer_register (pixman_timer_t *timer);
66 77 extern const uint8_t linear_to_srgb[4096];
67 #endif /* PIXMAN_TIMERS */ 78 extern const uint16_t srgb_to_linear[256];
68 79
69+/* a helper function, can blit 8-bit images with src/dst overlapping support */ 80+/* a helper function, can blit 8-bit images with src/dst overlapping support */
70+static inline void 81+static inline void
@@ -108,7 +119,9 @@ index cbd48f3..c20d9f0 100644
108+ } 119+ }
109+} 120+}
110+ 121+
122 #endif /* __ASSEMBLER__ */
123
111 #endif /* PIXMAN_PRIVATE_H */ 124 #endif /* PIXMAN_PRIVATE_H */
112-- 125--
1131.6.6.1 1261.7.4.4
114 127
diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman_0.26.2.bbappend b/meta-oe/recipes-graphics/xorg-lib/pixman_0.27.2.bbappend
index b5be2b50c..a04a549a5 100644
--- a/meta-oe/recipes-graphics/xorg-lib/pixman_0.26.2.bbappend
+++ b/meta-oe/recipes-graphics/xorg-lib/pixman_0.27.2.bbappend
@@ -1,9 +1,8 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" 1FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:"
2 2
3PRINC := "${@int(PRINC) + 10}" 3SRC_URI += " \
4
5SRC_URI += " file://0008-Generic-C-implementation-of-pixman_blt-with-overlapp.patch \
6 file://0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch \ 4 file://0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch \
5 file://0002-Generic-C-implementation-of-pixman_blt-with-overlapp.patch \
7" 6"
8 7
9NEON = " --disable-arm-neon " 8NEON = " --disable-arm-neon "