From 1a1edbb79eb3e9bfb7eae67e0953c2ae5f1ff96b Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sat, 9 Jul 2011 11:04:39 +0200 Subject: pixman: update to 0.22.2 Signed-off-by: Koen Kooi --- ...mplementation-of-pixman_blt-with-overlapp.patch | 114 --------------------- ...of-overlapping-src-dst-for-pixman_blt_mmx.patch | 91 ---------------- ...f-overlapping-src-dst-for-pixman_blt_sse2.patch | 91 ---------------- ...f-overlapping-src-dst-for-pixman_blt_neon.patch | 94 ----------------- ...mplementation-of-pixman_blt-with-overlapp.patch | 114 +++++++++++++++++++++ ...of-overlapping-src-dst-for-pixman_blt_mmx.patch | 91 ++++++++++++++++ ...f-overlapping-src-dst-for-pixman_blt_sse2.patch | 91 ++++++++++++++++ ...f-overlapping-src-dst-for-pixman_blt_neon.patch | 94 +++++++++++++++++ meta-oe/recipes-graphics/xorg-lib/pixman_0.22.0.bb | 23 ----- meta-oe/recipes-graphics/xorg-lib/pixman_0.22.2.bb | 24 +++++ 10 files changed, 414 insertions(+), 413 deletions(-) delete mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch delete mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch delete mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch delete mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch create mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch create mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch create mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch create mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch delete mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman_0.22.0.bb create mode 100644 meta-oe/recipes-graphics/xorg-lib/pixman_0.22.2.bb diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch deleted file mode 100644 index d925930898..0000000000 --- a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch +++ /dev/null @@ -1,114 +0,0 @@ -From e17f676f1f42239fb4304d75191f373bb06e8fc0 Mon Sep 17 00:00:00 2001 -From: Siarhei Siamashka -Date: Tue, 16 Mar 2010 16:55:28 +0100 -Subject: [PATCH 1/4] Generic C implementation of pixman_blt with overlapping support - -Uses memcpy/memmove functions to copy pixels, can handle the -case when both source and destination areas are in the same -image (this is useful for scrolling). - -It is assumed that copying direction is only important when -using the same image for both source and destination (and -src_stride == dst_stride). Copying direction is undefined -for the images with different source and destination stride -which happen to be in the overlapped areas (but this is an -unrealistic case anyway). ---- - pixman/pixman-general.c | 21 ++++++++++++++++++--- - pixman/pixman-private.h | 43 +++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 61 insertions(+), 3 deletions(-) - -diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c -index 727affc..fa448f7 100644 ---- a/pixman/pixman-general.c -+++ b/pixman/pixman-general.c -@@ -238,9 +238,24 @@ general_blt (pixman_implementation_t *imp, - int width, - int height) - { -- /* We can't blit unless we have sse2 or mmx */ -- -- return FALSE; -+ uint8_t *dst_bytes = (uint8_t *)dst_bits; -+ uint8_t *src_bytes = (uint8_t *)src_bits; -+ int bpp; -+ -+ if (src_bpp != dst_bpp || src_bpp & 7) -+ return FALSE; -+ -+ bpp = src_bpp >> 3; -+ width *= bpp; -+ src_stride *= 4; -+ dst_stride *= 4; -+ pixman_blt_helper (src_bytes + src_y * src_stride + src_x * bpp, -+ dst_bytes + dst_y * dst_stride + dst_x * bpp, -+ src_stride, -+ dst_stride, -+ width, -+ height); -+ return TRUE; - } - - static pixman_bool_t -diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h -index 60060a9..5369ad9 100644 ---- a/pixman/pixman-private.h -+++ b/pixman/pixman-private.h -@@ -10,6 +10,7 @@ - - #include "pixman.h" - #include -+#include - #include - #include - #include -@@ -899,4 +900,46 @@ void pixman_timer_register (pixman_timer_t *timer); - - #endif /* PIXMAN_TIMERS */ - -+/* a helper function, can blit 8-bit images with src/dst overlapping support */ -+static inline void -+pixman_blt_helper (uint8_t *src_bytes, -+ uint8_t *dst_bytes, -+ int src_stride, -+ int dst_stride, -+ int width, -+ int height) -+{ -+ /* -+ * The second part of this check is not strictly needed, but it prevents -+ * unnecessary upside-down processing of areas which belong to different -+ * images. Upside-down processing can be slower with fixed-distance-ahead -+ * prefetch and perceived as having more tearing. -+ */ -+ if (src_bytes < dst_bytes + width && -+ src_bytes + src_stride * height > dst_bytes) -+ { -+ src_bytes += src_stride * height - src_stride; -+ dst_bytes += dst_stride * height - dst_stride; -+ dst_stride = -dst_stride; -+ src_stride = -src_stride; -+ /* Horizontal scrolling to the left needs memmove */ -+ if (src_bytes + width > dst_bytes) -+ { -+ while (--height >= 0) -+ { -+ memmove (dst_bytes, src_bytes, width); -+ dst_bytes += dst_stride; -+ src_bytes += src_stride; -+ } -+ return; -+ } -+ } -+ while (--height >= 0) -+ { -+ memcpy (dst_bytes, src_bytes, width); -+ dst_bytes += dst_stride; -+ src_bytes += src_stride; -+ } -+} -+ - #endif /* PIXMAN_PRIVATE_H */ --- -1.6.6.1 - diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch deleted file mode 100644 index 45de8ec7ee..0000000000 --- a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 6d8b811414c73df7f75cc192e3b1f1d777615bdc Mon Sep 17 00:00:00 2001 -From: Siarhei Siamashka -Date: Thu, 22 Oct 2009 05:45:47 +0300 -Subject: [PATCH 2/4] Support of overlapping src/dst for pixman_blt_mmx - ---- - pixman/pixman-mmx.c | 55 +++++++++++++++++++++++++++++--------------------- - 1 files changed, 32 insertions(+), 23 deletions(-) - -diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c -index 0272347..5bcbd0e 100644 ---- a/pixman/pixman-mmx.c -+++ b/pixman/pixman-mmx.c -@@ -2996,34 +2996,43 @@ pixman_blt_mmx (uint32_t *src_bits, - { - uint8_t * src_bytes; - uint8_t * dst_bytes; -- int byte_width; -+ int bpp; - -- if (src_bpp != dst_bpp) -+ if (src_bpp != dst_bpp || src_bpp & 7) - return FALSE; - -- if (src_bpp == 16) -- { -- src_stride = src_stride * (int) sizeof (uint32_t) / 2; -- dst_stride = dst_stride * (int) sizeof (uint32_t) / 2; -- src_bytes = (uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x)); -- dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); -- byte_width = 2 * width; -- src_stride *= 2; -- dst_stride *= 2; -- } -- else if (src_bpp == 32) -+ bpp = src_bpp >> 3; -+ width *= bpp; -+ src_stride *= 4; -+ dst_stride *= 4; -+ src_bytes = (uint8_t *)src_bits + src_y * src_stride + src_x * bpp; -+ dst_bytes = (uint8_t *)dst_bits + dst_y * dst_stride + dst_x * bpp; -+ -+ if (src_bpp != 16 && src_bpp != 32) - { -- src_stride = src_stride * (int) sizeof (uint32_t) / 4; -- dst_stride = dst_stride * (int) sizeof (uint32_t) / 4; -- src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x)); -- dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); -- byte_width = 4 * width; -- src_stride *= 4; -- dst_stride *= 4; -+ pixman_blt_helper (src_bytes, dst_bytes, src_stride, dst_stride, -+ width, height); -+ return TRUE; - } -- else -+ -+ if (src_bytes < dst_bytes && src_bytes + src_stride * height > dst_bytes) - { -- return FALSE; -+ src_bytes += src_stride * height - src_stride; -+ dst_bytes += dst_stride * height - dst_stride; -+ dst_stride = -dst_stride; -+ src_stride = -src_stride; -+ -+ if (src_bytes + width > dst_bytes) -+ { -+ /* TODO: reverse scanline copy using MMX */ -+ while (--height >= 0) -+ { -+ memmove (dst_bytes, src_bytes, width); -+ dst_bytes += dst_stride; -+ src_bytes += src_stride; -+ } -+ return TRUE; -+ } - } - - while (height--) -@@ -3033,7 +3042,7 @@ pixman_blt_mmx (uint32_t *src_bits, - uint8_t *d = dst_bytes; - src_bytes += src_stride; - dst_bytes += dst_stride; -- w = byte_width; -+ w = width; - - while (w >= 2 && ((unsigned long)d & 3)) - { --- -1.6.6.1 - diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch deleted file mode 100644 index 7bb2fb60ff..0000000000 --- a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch +++ /dev/null @@ -1,91 +0,0 @@ -From c9ca9dc0f345fa3e2e0f16b2627150e0b696fd7a Mon Sep 17 00:00:00 2001 -From: Siarhei Siamashka -Date: Thu, 22 Oct 2009 05:45:54 +0300 -Subject: [PATCH 3/4] Support of overlapping src/dst for pixman_blt_sse2 - ---- - pixman/pixman-sse2.c | 55 +++++++++++++++++++++++++++++-------------------- - 1 files changed, 32 insertions(+), 23 deletions(-) - -diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c -index 533b858..9fa7191 100644 ---- a/pixman/pixman-sse2.c -+++ b/pixman/pixman-sse2.c -@@ -4691,34 +4691,43 @@ pixman_blt_sse2 (uint32_t *src_bits, - { - uint8_t * src_bytes; - uint8_t * dst_bytes; -- int byte_width; -+ int bpp; - -- if (src_bpp != dst_bpp) -+ if (src_bpp != dst_bpp || src_bpp & 7) - return FALSE; - -- if (src_bpp == 16) -- { -- src_stride = src_stride * (int) sizeof (uint32_t) / 2; -- dst_stride = dst_stride * (int) sizeof (uint32_t) / 2; -- src_bytes =(uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x)); -- dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); -- byte_width = 2 * width; -- src_stride *= 2; -- dst_stride *= 2; -- } -- else if (src_bpp == 32) -+ bpp = src_bpp >> 3; -+ width *= bpp; -+ src_stride *= 4; -+ dst_stride *= 4; -+ src_bytes = (uint8_t *)src_bits + src_y * src_stride + src_x * bpp; -+ dst_bytes = (uint8_t *)dst_bits + dst_y * dst_stride + dst_x * bpp; -+ -+ if (src_bpp != 16 && src_bpp != 32) - { -- src_stride = src_stride * (int) sizeof (uint32_t) / 4; -- dst_stride = dst_stride * (int) sizeof (uint32_t) / 4; -- src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x)); -- dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); -- byte_width = 4 * width; -- src_stride *= 4; -- dst_stride *= 4; -+ pixman_blt_helper (src_bytes, dst_bytes, src_stride, dst_stride, -+ width, height); -+ return TRUE; - } -- else -+ -+ if (src_bytes < dst_bytes && src_bytes + src_stride * height > dst_bytes) - { -- return FALSE; -+ src_bytes += src_stride * height - src_stride; -+ dst_bytes += dst_stride * height - dst_stride; -+ dst_stride = -dst_stride; -+ src_stride = -src_stride; -+ -+ if (src_bytes + width > dst_bytes) -+ { -+ /* TODO: reverse scanline copy using SSE2 */ -+ while (--height >= 0) -+ { -+ memmove (dst_bytes, src_bytes, width); -+ dst_bytes += dst_stride; -+ src_bytes += src_stride; -+ } -+ return TRUE; -+ } - } - - while (height--) -@@ -4728,7 +4737,7 @@ pixman_blt_sse2 (uint32_t *src_bits, - uint8_t *d = dst_bytes; - src_bytes += src_stride; - dst_bytes += dst_stride; -- w = byte_width; -+ w = width; - - while (w >= 2 && ((unsigned long)d & 3)) - { --- -1.6.6.1 - diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch deleted file mode 100644 index 6bcc2fa30a..0000000000 --- a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.0/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 604f22b515d4d678df4c301ecec3c7da4987ee16 Mon Sep 17 00:00:00 2001 -From: Siarhei Siamashka -Date: Wed, 18 Nov 2009 06:08:48 +0200 -Subject: [PATCH 4/4] Support of overlapping src/dst for pixman_blt_neon - ---- - pixman/pixman-arm-neon.c | 62 +++++++++++++++++++++++++++++++++++++-------- - 1 files changed, 51 insertions(+), 11 deletions(-) - -diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c -index e5127a6..b67fed9 100644 ---- a/pixman/pixman-arm-neon.c -+++ b/pixman/pixman-arm-neon.c -@@ -234,26 +234,66 @@ pixman_blt_neon (uint32_t *src_bits, - int width, - int height) - { -- if (src_bpp != dst_bpp) -+ uint8_t * src_bytes; -+ uint8_t * dst_bytes; -+ int bpp; -+ -+ if (src_bpp != dst_bpp || src_bpp & 7) - return FALSE; - -+ bpp = src_bpp >> 3; -+ width *= bpp; -+ src_stride *= 4; -+ dst_stride *= 4; -+ src_bytes = (uint8_t *)src_bits + src_y * src_stride + src_x * bpp; -+ dst_bytes = (uint8_t *)dst_bits + dst_y * dst_stride + dst_x * bpp; -+ -+ if (src_bpp != 16 && src_bpp != 32) -+ { -+ pixman_blt_helper (src_bytes, dst_bytes, src_stride, dst_stride, -+ width, height); -+ return TRUE; -+ } -+ -+ if (src_bytes < dst_bytes && src_bytes + src_stride * height > dst_bytes) -+ { -+ src_bytes += src_stride * height - src_stride; -+ dst_bytes += dst_stride * height - dst_stride; -+ dst_stride = -dst_stride; -+ src_stride = -src_stride; -+ -+ if (src_bytes + width > dst_bytes) -+ { -+ /* TODO: reverse scanline copy using NEON */ -+ while (--height >= 0) -+ { -+ memmove (dst_bytes, src_bytes, width); -+ dst_bytes += dst_stride; -+ src_bytes += src_stride; -+ } -+ return TRUE; -+ } -+ } -+ - switch (src_bpp) - { - case 16: - pixman_composite_src_0565_0565_asm_neon ( -- width, height, -- (uint16_t *)(((char *) dst_bits) + -- dst_y * dst_stride * 4 + dst_x * 2), dst_stride * 2, -- (uint16_t *)(((char *) src_bits) + -- src_y * src_stride * 4 + src_x * 2), src_stride * 2); -+ width >> 1, -+ height, -+ (uint16_t *) dst_bytes, -+ dst_stride >> 1, -+ (uint16_t *) src_bytes, -+ src_stride >> 1); - return TRUE; - case 32: - pixman_composite_src_8888_8888_asm_neon ( -- width, height, -- (uint32_t *)(((char *) dst_bits) + -- dst_y * dst_stride * 4 + dst_x * 4), dst_stride, -- (uint32_t *)(((char *) src_bits) + -- src_y * src_stride * 4 + src_x * 4), src_stride); -+ width >> 2, -+ height, -+ (uint32_t *) dst_bytes, -+ dst_stride >> 2, -+ (uint32_t *) src_bytes, -+ src_stride >> 2); - return TRUE; - default: - return FALSE; --- -1.6.6.1 - diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch new file mode 100644 index 0000000000..d925930898 --- /dev/null +++ b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch @@ -0,0 +1,114 @@ +From e17f676f1f42239fb4304d75191f373bb06e8fc0 Mon Sep 17 00:00:00 2001 +From: Siarhei Siamashka +Date: Tue, 16 Mar 2010 16:55:28 +0100 +Subject: [PATCH 1/4] Generic C implementation of pixman_blt with overlapping support + +Uses memcpy/memmove functions to copy pixels, can handle the +case when both source and destination areas are in the same +image (this is useful for scrolling). + +It is assumed that copying direction is only important when +using the same image for both source and destination (and +src_stride == dst_stride). Copying direction is undefined +for the images with different source and destination stride +which happen to be in the overlapped areas (but this is an +unrealistic case anyway). +--- + pixman/pixman-general.c | 21 ++++++++++++++++++--- + pixman/pixman-private.h | 43 +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 61 insertions(+), 3 deletions(-) + +diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c +index 727affc..fa448f7 100644 +--- a/pixman/pixman-general.c ++++ b/pixman/pixman-general.c +@@ -238,9 +238,24 @@ general_blt (pixman_implementation_t *imp, + int width, + int height) + { +- /* We can't blit unless we have sse2 or mmx */ +- +- return FALSE; ++ uint8_t *dst_bytes = (uint8_t *)dst_bits; ++ uint8_t *src_bytes = (uint8_t *)src_bits; ++ int bpp; ++ ++ if (src_bpp != dst_bpp || src_bpp & 7) ++ return FALSE; ++ ++ bpp = src_bpp >> 3; ++ width *= bpp; ++ src_stride *= 4; ++ dst_stride *= 4; ++ pixman_blt_helper (src_bytes + src_y * src_stride + src_x * bpp, ++ dst_bytes + dst_y * dst_stride + dst_x * bpp, ++ src_stride, ++ dst_stride, ++ width, ++ height); ++ return TRUE; + } + + static pixman_bool_t +diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h +index 60060a9..5369ad9 100644 +--- a/pixman/pixman-private.h ++++ b/pixman/pixman-private.h +@@ -10,6 +10,7 @@ + + #include "pixman.h" + #include ++#include + #include + #include + #include +@@ -899,4 +900,46 @@ void pixman_timer_register (pixman_timer_t *timer); + + #endif /* PIXMAN_TIMERS */ + ++/* a helper function, can blit 8-bit images with src/dst overlapping support */ ++static inline void ++pixman_blt_helper (uint8_t *src_bytes, ++ uint8_t *dst_bytes, ++ int src_stride, ++ int dst_stride, ++ int width, ++ int height) ++{ ++ /* ++ * The second part of this check is not strictly needed, but it prevents ++ * unnecessary upside-down processing of areas which belong to different ++ * images. Upside-down processing can be slower with fixed-distance-ahead ++ * prefetch and perceived as having more tearing. ++ */ ++ if (src_bytes < dst_bytes + width && ++ src_bytes + src_stride * height > dst_bytes) ++ { ++ src_bytes += src_stride * height - src_stride; ++ dst_bytes += dst_stride * height - dst_stride; ++ dst_stride = -dst_stride; ++ src_stride = -src_stride; ++ /* Horizontal scrolling to the left needs memmove */ ++ if (src_bytes + width > dst_bytes) ++ { ++ while (--height >= 0) ++ { ++ memmove (dst_bytes, src_bytes, width); ++ dst_bytes += dst_stride; ++ src_bytes += src_stride; ++ } ++ return; ++ } ++ } ++ while (--height >= 0) ++ { ++ memcpy (dst_bytes, src_bytes, width); ++ dst_bytes += dst_stride; ++ src_bytes += src_stride; ++ } ++} ++ + #endif /* PIXMAN_PRIVATE_H */ +-- +1.6.6.1 + diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch new file mode 100644 index 0000000000..45de8ec7ee --- /dev/null +++ b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch @@ -0,0 +1,91 @@ +From 6d8b811414c73df7f75cc192e3b1f1d777615bdc Mon Sep 17 00:00:00 2001 +From: Siarhei Siamashka +Date: Thu, 22 Oct 2009 05:45:47 +0300 +Subject: [PATCH 2/4] Support of overlapping src/dst for pixman_blt_mmx + +--- + pixman/pixman-mmx.c | 55 +++++++++++++++++++++++++++++--------------------- + 1 files changed, 32 insertions(+), 23 deletions(-) + +diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c +index 0272347..5bcbd0e 100644 +--- a/pixman/pixman-mmx.c ++++ b/pixman/pixman-mmx.c +@@ -2996,34 +2996,43 @@ pixman_blt_mmx (uint32_t *src_bits, + { + uint8_t * src_bytes; + uint8_t * dst_bytes; +- int byte_width; ++ int bpp; + +- if (src_bpp != dst_bpp) ++ if (src_bpp != dst_bpp || src_bpp & 7) + return FALSE; + +- if (src_bpp == 16) +- { +- src_stride = src_stride * (int) sizeof (uint32_t) / 2; +- dst_stride = dst_stride * (int) sizeof (uint32_t) / 2; +- src_bytes = (uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x)); +- dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); +- byte_width = 2 * width; +- src_stride *= 2; +- dst_stride *= 2; +- } +- else if (src_bpp == 32) ++ bpp = src_bpp >> 3; ++ width *= bpp; ++ src_stride *= 4; ++ dst_stride *= 4; ++ src_bytes = (uint8_t *)src_bits + src_y * src_stride + src_x * bpp; ++ dst_bytes = (uint8_t *)dst_bits + dst_y * dst_stride + dst_x * bpp; ++ ++ if (src_bpp != 16 && src_bpp != 32) + { +- src_stride = src_stride * (int) sizeof (uint32_t) / 4; +- dst_stride = dst_stride * (int) sizeof (uint32_t) / 4; +- src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x)); +- dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); +- byte_width = 4 * width; +- src_stride *= 4; +- dst_stride *= 4; ++ pixman_blt_helper (src_bytes, dst_bytes, src_stride, dst_stride, ++ width, height); ++ return TRUE; + } +- else ++ ++ if (src_bytes < dst_bytes && src_bytes + src_stride * height > dst_bytes) + { +- return FALSE; ++ src_bytes += src_stride * height - src_stride; ++ dst_bytes += dst_stride * height - dst_stride; ++ dst_stride = -dst_stride; ++ src_stride = -src_stride; ++ ++ if (src_bytes + width > dst_bytes) ++ { ++ /* TODO: reverse scanline copy using MMX */ ++ while (--height >= 0) ++ { ++ memmove (dst_bytes, src_bytes, width); ++ dst_bytes += dst_stride; ++ src_bytes += src_stride; ++ } ++ return TRUE; ++ } + } + + while (height--) +@@ -3033,7 +3042,7 @@ pixman_blt_mmx (uint32_t *src_bits, + uint8_t *d = dst_bytes; + src_bytes += src_stride; + dst_bytes += dst_stride; +- w = byte_width; ++ w = width; + + while (w >= 2 && ((unsigned long)d & 3)) + { +-- +1.6.6.1 + diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch new file mode 100644 index 0000000000..7bb2fb60ff --- /dev/null +++ b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch @@ -0,0 +1,91 @@ +From c9ca9dc0f345fa3e2e0f16b2627150e0b696fd7a Mon Sep 17 00:00:00 2001 +From: Siarhei Siamashka +Date: Thu, 22 Oct 2009 05:45:54 +0300 +Subject: [PATCH 3/4] Support of overlapping src/dst for pixman_blt_sse2 + +--- + pixman/pixman-sse2.c | 55 +++++++++++++++++++++++++++++-------------------- + 1 files changed, 32 insertions(+), 23 deletions(-) + +diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c +index 533b858..9fa7191 100644 +--- a/pixman/pixman-sse2.c ++++ b/pixman/pixman-sse2.c +@@ -4691,34 +4691,43 @@ pixman_blt_sse2 (uint32_t *src_bits, + { + uint8_t * src_bytes; + uint8_t * dst_bytes; +- int byte_width; ++ int bpp; + +- if (src_bpp != dst_bpp) ++ if (src_bpp != dst_bpp || src_bpp & 7) + return FALSE; + +- if (src_bpp == 16) +- { +- src_stride = src_stride * (int) sizeof (uint32_t) / 2; +- dst_stride = dst_stride * (int) sizeof (uint32_t) / 2; +- src_bytes =(uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x)); +- dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); +- byte_width = 2 * width; +- src_stride *= 2; +- dst_stride *= 2; +- } +- else if (src_bpp == 32) ++ bpp = src_bpp >> 3; ++ width *= bpp; ++ src_stride *= 4; ++ dst_stride *= 4; ++ src_bytes = (uint8_t *)src_bits + src_y * src_stride + src_x * bpp; ++ dst_bytes = (uint8_t *)dst_bits + dst_y * dst_stride + dst_x * bpp; ++ ++ if (src_bpp != 16 && src_bpp != 32) + { +- src_stride = src_stride * (int) sizeof (uint32_t) / 4; +- dst_stride = dst_stride * (int) sizeof (uint32_t) / 4; +- src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x)); +- dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x)); +- byte_width = 4 * width; +- src_stride *= 4; +- dst_stride *= 4; ++ pixman_blt_helper (src_bytes, dst_bytes, src_stride, dst_stride, ++ width, height); ++ return TRUE; + } +- else ++ ++ if (src_bytes < dst_bytes && src_bytes + src_stride * height > dst_bytes) + { +- return FALSE; ++ src_bytes += src_stride * height - src_stride; ++ dst_bytes += dst_stride * height - dst_stride; ++ dst_stride = -dst_stride; ++ src_stride = -src_stride; ++ ++ if (src_bytes + width > dst_bytes) ++ { ++ /* TODO: reverse scanline copy using SSE2 */ ++ while (--height >= 0) ++ { ++ memmove (dst_bytes, src_bytes, width); ++ dst_bytes += dst_stride; ++ src_bytes += src_stride; ++ } ++ return TRUE; ++ } + } + + while (height--) +@@ -4728,7 +4737,7 @@ pixman_blt_sse2 (uint32_t *src_bits, + uint8_t *d = dst_bytes; + src_bytes += src_stride; + dst_bytes += dst_stride; +- w = byte_width; ++ w = width; + + while (w >= 2 && ((unsigned long)d & 3)) + { +-- +1.6.6.1 + diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch new file mode 100644 index 0000000000..6bcc2fa30a --- /dev/null +++ b/meta-oe/recipes-graphics/xorg-lib/pixman-0.22.2/0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch @@ -0,0 +1,94 @@ +From 604f22b515d4d678df4c301ecec3c7da4987ee16 Mon Sep 17 00:00:00 2001 +From: Siarhei Siamashka +Date: Wed, 18 Nov 2009 06:08:48 +0200 +Subject: [PATCH 4/4] Support of overlapping src/dst for pixman_blt_neon + +--- + pixman/pixman-arm-neon.c | 62 +++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 51 insertions(+), 11 deletions(-) + +diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c +index e5127a6..b67fed9 100644 +--- a/pixman/pixman-arm-neon.c ++++ b/pixman/pixman-arm-neon.c +@@ -234,26 +234,66 @@ pixman_blt_neon (uint32_t *src_bits, + int width, + int height) + { +- if (src_bpp != dst_bpp) ++ uint8_t * src_bytes; ++ uint8_t * dst_bytes; ++ int bpp; ++ ++ if (src_bpp != dst_bpp || src_bpp & 7) + return FALSE; + ++ bpp = src_bpp >> 3; ++ width *= bpp; ++ src_stride *= 4; ++ dst_stride *= 4; ++ src_bytes = (uint8_t *)src_bits + src_y * src_stride + src_x * bpp; ++ dst_bytes = (uint8_t *)dst_bits + dst_y * dst_stride + dst_x * bpp; ++ ++ if (src_bpp != 16 && src_bpp != 32) ++ { ++ pixman_blt_helper (src_bytes, dst_bytes, src_stride, dst_stride, ++ width, height); ++ return TRUE; ++ } ++ ++ if (src_bytes < dst_bytes && src_bytes + src_stride * height > dst_bytes) ++ { ++ src_bytes += src_stride * height - src_stride; ++ dst_bytes += dst_stride * height - dst_stride; ++ dst_stride = -dst_stride; ++ src_stride = -src_stride; ++ ++ if (src_bytes + width > dst_bytes) ++ { ++ /* TODO: reverse scanline copy using NEON */ ++ while (--height >= 0) ++ { ++ memmove (dst_bytes, src_bytes, width); ++ dst_bytes += dst_stride; ++ src_bytes += src_stride; ++ } ++ return TRUE; ++ } ++ } ++ + switch (src_bpp) + { + case 16: + pixman_composite_src_0565_0565_asm_neon ( +- width, height, +- (uint16_t *)(((char *) dst_bits) + +- dst_y * dst_stride * 4 + dst_x * 2), dst_stride * 2, +- (uint16_t *)(((char *) src_bits) + +- src_y * src_stride * 4 + src_x * 2), src_stride * 2); ++ width >> 1, ++ height, ++ (uint16_t *) dst_bytes, ++ dst_stride >> 1, ++ (uint16_t *) src_bytes, ++ src_stride >> 1); + return TRUE; + case 32: + pixman_composite_src_8888_8888_asm_neon ( +- width, height, +- (uint32_t *)(((char *) dst_bits) + +- dst_y * dst_stride * 4 + dst_x * 4), dst_stride, +- (uint32_t *)(((char *) src_bits) + +- src_y * src_stride * 4 + src_x * 4), src_stride); ++ width >> 2, ++ height, ++ (uint32_t *) dst_bytes, ++ dst_stride >> 2, ++ (uint32_t *) src_bytes, ++ src_stride >> 2); + return TRUE; + default: + return FALSE; +-- +1.6.6.1 + diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman_0.22.0.bb b/meta-oe/recipes-graphics/xorg-lib/pixman_0.22.0.bb deleted file mode 100644 index 1d2df5dc2a..0000000000 --- a/meta-oe/recipes-graphics/xorg-lib/pixman_0.22.0.bb +++ /dev/null @@ -1,23 +0,0 @@ -require pixman.inc - -LICENSE = "MIT & MIT-style & Public Domain" -LIC_FILES_CHKSUM = "file://COPYING;md5=14096c769ae0cbb5fcb94ec468be11b3\ - file://pixman/pixman-matrix.c;endline=25;md5=ba6e8769bfaaee2c41698755af04c4be \ - file://pixman/pixman-arm-neon-asm.h;endline=24;md5=9a9cc1e51abbf1da58f4d9528ec9d49b \ - " - -PR = "${INC_PR}.0" - -SRC_URI = "http://xorg.freedesktop.org/archive/individual/lib/${BPN}-${PV}.tar.gz \ - file://0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch \ - file://0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch \ - file://0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch \ - file://0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch \ -" -SRC_URI[md5sum] = "cb8f3cb5ce2c8d7294f73ecb7021fda6" -SRC_URI[sha256sum] = "6b7622256e43912fb77fd456b0753f407268d450f5990c8f86e7c6f006e30da0" - -NEON = " --disable-arm-neon " -NEON_armv7a = " " - -EXTRA_OECONF = "${NEON} --disable-gtk" diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman_0.22.2.bb b/meta-oe/recipes-graphics/xorg-lib/pixman_0.22.2.bb new file mode 100644 index 0000000000..6884d671a4 --- /dev/null +++ b/meta-oe/recipes-graphics/xorg-lib/pixman_0.22.2.bb @@ -0,0 +1,24 @@ +require pixman.inc + +LICENSE = "MIT & MIT-style & Public Domain" +LIC_FILES_CHKSUM = "file://COPYING;md5=14096c769ae0cbb5fcb94ec468be11b3\ + file://pixman/pixman-matrix.c;endline=25;md5=ba6e8769bfaaee2c41698755af04c4be \ + file://pixman/pixman-arm-neon-asm.h;endline=24;md5=9a9cc1e51abbf1da58f4d9528ec9d49b \ + " + +PR = "${INC_PR}.0" + +SRC_URI = "http://xorg.freedesktop.org/archive/individual/lib/${BPN}-${PV}.tar.gz \ + file://0001-Generic-C-implementation-of-pixman_blt-with-overlapp.patch \ + file://0002-Support-of-overlapping-src-dst-for-pixman_blt_mmx.patch \ + file://0003-Support-of-overlapping-src-dst-for-pixman_blt_sse2.patch \ + file://0004-Support-of-overlapping-src-dst-for-pixman_blt_neon.patch \ +" + +SRC_URI[md5sum] = "3dd0d9ed05dbf0e5e75d526ebae42e11" +SRC_URI[sha256sum] = "51f4f26be030e476a1b481a8f76e6695b45d1dce084beae5251236c3bb2a1f89" + +NEON = " --disable-arm-neon " +NEON_armv7a = " " + +EXTRA_OECONF = "${NEON} --disable-gtk" -- cgit 1.2.3-korg