summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/xorg-lib/pixman-0.21.4/0019-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
commitc58cc7d3796dcee6e93885c835ed04cb566abeb2 (patch)
tree3eea4d4ef6a4ef79e0f4e025d7012c1a5cc38835 /meta-oe/recipes-graphics/xorg-lib/pixman-0.21.4/0019-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch
parenteec6ab97f712e06eb52c9f7c99e19ffab3ce9d74 (diff)
downloadmeta-openembedded-c58cc7d3796dcee6e93885c835ed04cb566abeb2.tar.gz
move layer into meta-oe in preparation for future splits
As per TSC decision Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-graphics/xorg-lib/pixman-0.21.4/0019-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch')
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/pixman-0.21.4/0019-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.21.4/0019-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.21.4/0019-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch
new file mode 100644
index 000000000..5193d38f7
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/pixman-0.21.4/0019-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch
@@ -0,0 +1,91 @@
1From f5a54f7d5eb1169bc79f0e445e2998e98080ef13 Mon Sep 17 00:00:00 2001
2From: Siarhei Siamashka <siarhei.siamashka@nokia.com>
3Date: Thu, 22 Oct 2009 05:45:47 +0300
4Subject: [PATCH 19/24] Support of overlapping src/dst for pixman_blt_mmx
5
6---
7 pixman/pixman-mmx.c | 55 +++++++++++++++++++++++++++++---------------------
8 1 files changed, 32 insertions(+), 23 deletions(-)
9
10diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
11index 34637a4..f9dd473 100644
12--- a/pixman/pixman-mmx.c
13+++ b/pixman/pixman-mmx.c
14@@ -2996,34 +2996,43 @@ pixman_blt_mmx (uint32_t *src_bits,
15 {
16 uint8_t * src_bytes;
17 uint8_t * dst_bytes;
18- int byte_width;
19+ int bpp;
20
21- if (src_bpp != dst_bpp)
22+ if (src_bpp != dst_bpp || src_bpp & 7)
23 return FALSE;
24
25- if (src_bpp == 16)
26- {
27- src_stride = src_stride * (int) sizeof (uint32_t) / 2;
28- dst_stride = dst_stride * (int) sizeof (uint32_t) / 2;
29- src_bytes = (uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x));
30- dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x));
31- byte_width = 2 * width;
32- src_stride *= 2;
33- dst_stride *= 2;
34- }
35- else if (src_bpp == 32)
36+ bpp = src_bpp >> 3;
37+ width *= bpp;
38+ src_stride *= 4;
39+ dst_stride *= 4;
40+ src_bytes = (uint8_t *)src_bits + src_y * src_stride + src_x * bpp;
41+ dst_bytes = (uint8_t *)dst_bits + dst_y * dst_stride + dst_x * bpp;
42+
43+ if (src_bpp != 16 && src_bpp != 32)
44 {
45- src_stride = src_stride * (int) sizeof (uint32_t) / 4;
46- dst_stride = dst_stride * (int) sizeof (uint32_t) / 4;
47- src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x));
48- dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x));
49- byte_width = 4 * width;
50- src_stride *= 4;
51- dst_stride *= 4;
52+ pixman_blt_helper (src_bytes, dst_bytes, src_stride, dst_stride,
53+ width, height);
54+ return TRUE;
55 }
56- else
57+
58+ if (src_bytes < dst_bytes && src_bytes + src_stride * height > dst_bytes)
59 {
60- return FALSE;
61+ src_bytes += src_stride * height - src_stride;
62+ dst_bytes += dst_stride * height - dst_stride;
63+ dst_stride = -dst_stride;
64+ src_stride = -src_stride;
65+
66+ if (src_bytes + width > dst_bytes)
67+ {
68+ /* TODO: reverse scanline copy using MMX */
69+ while (--height >= 0)
70+ {
71+ memmove (dst_bytes, src_bytes, width);
72+ dst_bytes += dst_stride;
73+ src_bytes += src_stride;
74+ }
75+ return TRUE;
76+ }
77 }
78
79 while (height--)
80@@ -3033,7 +3042,7 @@ pixman_blt_mmx (uint32_t *src_bits,
81 uint8_t *d = dst_bytes;
82 src_bytes += src_stride;
83 dst_bytes += dst_stride;
84- w = byte_width;
85+ w = width;
86
87 while (w >= 2 && ((unsigned long)d & 3))
88 {
89--
901.6.6.1
91