diff options
author | Zhang Le <r0bertz@gentoo.org> | 2010-02-27 13:47:58 +0800 |
---|---|---|
committer | Zhang Le <r0bertz@gentoo.org> | 2010-02-27 13:47:58 +0800 |
commit | 81543f4418d5d25592919933706ac14a5f064011 (patch) | |
tree | d9cb7ceab97b5f5b5576659696e8d62d62014f05 | |
parent | added xorg-server-1.7.5.ebuild and smi 16bpp workaround patch and clean up (diff) | |
download | loongson-81543f4418d5d25592919933706ac14a5f064011.tar.gz loongson-81543f4418d5d25592919933706ac14a5f064011.tar.bz2 loongson-81543f4418d5d25592919933706ac14a5f064011.zip |
partly fix siliconmotion 16bpp
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
4 files changed, 209 insertions, 18 deletions
diff --git a/x11-drivers/xf86-video-siliconmotion/Manifest b/x11-drivers/xf86-video-siliconmotion/Manifest index a1c6d23..cc1d82a 100644 --- a/x11-drivers/xf86-video-siliconmotion/Manifest +++ b/x11-drivers/xf86-video-siliconmotion/Manifest @@ -1 +1,3 @@ -EBUILD xf86-video-siliconmotion-9999.ebuild 388 RMD160 8b4b67e2c4fdded99326f7db92092f2e3dad0bfe SHA1 c6b42eb1e0149d0d6ad97df74d3fa2b464e89f49 SHA256 f3c5666a75d60d0cfd7bcad9d5f43d3b42b3382cfcd87fd8a55c982f816adef9 +AUX xf86-video-siliconmotion-1.7.3-fix-loongson.patch 4788 RMD160 a67bd3e41b170149679ecec39874c19a9f7fc70b SHA1 a570c486bb519477ca136af590531670c9d442c8 SHA256 0785b8fd501922f1359572eb0244d8f5696073c3121f3ada30f7e119c1914020 +DIST xf86-video-siliconmotion-1.7.3.tar.bz2 330623 RMD160 12c61e9785d280c4ab8cb253dc4879dffa8c5975 SHA1 f3edf5853a17c3725c11ea983edcf4b6bd54d10a SHA256 ebda468be42695c08ceaa4043da3cf5bcd5f9ab15d1482311fd6e826a8060b2b +EBUILD xf86-video-siliconmotion-1.7.3.ebuild 675 RMD160 4adbe6e3f92da5556010430ddb2a0e8193a7e393 SHA1 ca4eb9aa5433893eda2912e48be20dda7f489a27 SHA256 f06cde02c3db5ac99862c06d057b833a4122e0f63522c2e690b1ea005e9c433a diff --git a/x11-drivers/xf86-video-siliconmotion/files/xf86-video-siliconmotion-1.7.3-fix-loongson.patch b/x11-drivers/xf86-video-siliconmotion/files/xf86-video-siliconmotion-1.7.3-fix-loongson.patch new file mode 100644 index 0000000..e3b6974 --- /dev/null +++ b/x11-drivers/xf86-video-siliconmotion/files/xf86-video-siliconmotion-1.7.3-fix-loongson.patch @@ -0,0 +1,182 @@ +diff -ur orig/src/smi_video.c mod/src/smi_video.c +--- orig/src/smi_video.c 2010-02-05 13:11:18.000000000 +0100 ++++ mod/src/smi_video.c 2010-02-05 13:20:36.000000000 +0100 +@@ -276,6 +276,7 @@ + XVIMAGE_YUY2, + XVIMAGE_YV12, + XVIMAGE_I420, ++ XVIMAGE_UYVY, + { + FOURCC_RV15, /* id */ + XvRGB, /* type */ +@@ -1103,7 +1104,7 @@ + vpr00 |= 0x0010000E; + } else { + /* +- Bit 21 = 10: Vertical Interpolation = enabled ++ Bit 21 = 1: Vertical Interpolation = enabled + Bit 24 = 1: Select Video Window I Source Addr = 1 + 1= Video window I source addr = capture port buffer ? + */ +@@ -1464,6 +1465,117 @@ + LEAVE(); + } + ++static void myXVCopyYUV12ToPacked(const unsigned char *srcy, const unsigned char *srcv, const unsigned char *srcu, ++ unsigned char *dst, int srcPitchy, int srcPitchuv, int dstPitch, int h, int w) ++{ ++ int i, j; ++ unsigned char const *y, *u, *v; ++ int dstinc, yinc, uinc, vinc; ++ ++ y = srcy; ++ u = srcu; ++ v = srcv; ++ ++ dstinc = dstPitch - 2*w; ++ yinc = srcPitchy - w; ++ uinc = srcPitchuv - w/2; ++ vinc = srcPitchuv - w/2; ++ ++ for (i = 0; i < h; i++) { ++ asm ( ++// ".set arch=loongson2f\n\t" ++ ".set noreorder\n\t" ++ "move $8, %8 \n\t" ++ "1: \n\t" ++ "beqz $8, 2f \n\t" ++ "xor $f0, $f0, $f0 \n\t" ++ "ldc1 $f4, (%0) \n\t" ++ "punpcklbh $f2, $f4, $f0 \n\t" ++ "punpckhbh $f4, $f4, $f0 \n\t" ++ "ldc1 $f16, 8(%0) \n\t" ++ "punpcklbh $f14, $f16, $f0 \n\t" ++ "punpckhbh $f16, $f16, $f0 \n\t" ++ ++ "lwc1 $f8, (%1) \n\t" ++ "lwc1 $f12, (%2) \n\t" ++ "punpcklbh $f8, $f8, $f12 \n\t" ++ "punpcklbh $f6, $f0, $f8 \n\t" ++ "punpckhbh $f8, $f0, $f8 \n\t" ++ "lwc1 $f18, 4(%1) \n\t" ++ "lwc1 $f12, 4(%2) \n\t" ++ "punpcklbh $f18, $f18, $f12 \n\t" ++ "punpcklbh $f10, $f0, $f18 \n\t" ++ "punpckhbh $f12, $f0, $f18 \n\t" ++ ++ "or $f2, $f2, $f6 \n\t" ++ "or $f4, $f4, $f8 \n\t" ++ "or $f14, $f14, $f10 \n\t" ++ "or $f16, $f16, $f12 \n\t" ++ ++ "sdc1 $f2, (%3) \n\t" ++ "sdc1 $f4, 8(%3) \n\t" ++ "add %0, 16 \n\t" ++ "add %1, 8 \n\t" ++ "add %2, 8 \n\t" ++ "sdc1 $f14, 0x10(%3) \n\t" ++ "sdc1 $f16, 0x18(%3) \n\t" ++ "add $8, -1 \n\t" ++ "b 1b \n\t" ++ "add %3, 32 \n\t" ++ "2: \n\t" ++ ".set reorder\n\t" ++ : "=r" (y), "=r" (u), "=r" (v), "=r" (dst) ++ : "0" (y), "1" (u), "2" (v), "3" (dst), "r" (w>>4) ++ : "memory","$8" ++ ); ++ ++ asm ( ++// ".set arch=loongson2f\n\t" ++ ".set noreorder\n\t" ++ "move $8, %8 \n\t" ++ "1: \n\t" ++ "beqz $8, 2f \n\t" ++ "xor $f0, $f0, $f0 \n\t" ++ "ldc1 $f4, (%0) \n\t" ++ "punpcklbh $f2, $f4, $f0 \n\t" ++ "punpckhbh $f4, $f4, $f0 \n\t" ++ ++ "lwc1 $f8, (%1) \n\t" ++ "lwc1 $f12, (%2) \n\t" ++ "punpcklbh $f8, $f8, $f12 \n\t" ++ "punpcklbh $f6, $f0, $f8 \n\t" ++ "punpckhbh $f8, $f0, $f8 \n\t" ++ ++ "or $f2, $f2, $f6 \n\t" ++ "or $f4, $f4, $f8 \n\t" ++ ++ "sdc1 $f2, (%3) \n\t" ++ "sdc1 $f4, 8(%3) \n\t" ++ "add %0, 8 \n\t" ++ "add %1, 4 \n\t" ++ "add %2, 4 \n\t" ++ "add $8, -1 \n\t" ++ "b 1b \n\t" ++ "add %3, 16 \n\t" ++ "2:\n\t" ++ ".set reorder\n\t" ++ : "=r" (y), "=r" (u), "=r" (v), "=r" (dst) ++ : "0" (y), "1" (u), "2" (v), "3" (dst), "r" ((w&0xf)/8) ++ : "memory","$8" ++ ); ++ ++ for (j = (w&7)/2; j; j--) { ++ *dst++ = *y++; ++ *dst++ = *u++; ++ *dst++ = *y++; ++ *dst++ = *v++; ++ } ++ y += yinc; ++ u = (i%2) ? (u + uinc): (u - w/2); ++ v = (i%2) ? (v + vinc): (v - w/2); ++ dst += dstinc; ++ } ++} + + static int + SMI_PutImage( +@@ -1592,7 +1704,7 @@ + offset3 = tmp; + } + nLines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; +- xf86XVCopyYUV12ToPacked(buf + (top * srcPitch) + (left >> 1), ++ myXVCopyYUV12ToPacked(buf + (top * srcPitch) + (left >> 1), + buf + offset2, buf + offset3, dstStart, + srcPitch, srcPitch2, dstPitch, nLines, + nPixels); +@@ -1747,7 +1859,7 @@ + { + SMIPtr pSmi = SMIPTR(pScrn); + CARD32 vpr00; +- int hstretch, vstretch; ++ uint_least32_t hstretch, vstretch; + + ENTER(); + +@@ -1774,13 +1886,13 @@ + } + + if (drw_w > vid_w) { +- hstretch = (2560 * vid_w / drw_w + 5) / 10; ++ hstretch = ((uint_least32_t)(vid_w - 1) << 16) / (drw_w - 1); + } else { + hstretch = 0; + } + + if (drw_h > vid_h) { +- vstretch = (2560 * vid_h / drw_h + 5) / 10; ++ vstretch = ((uint_least32_t)(vid_h - 1) << 16) / (drw_h - 1); + vpr00 |= 1 << 21; + } else { + vstretch = 0; +@@ -1791,7 +1903,8 @@ + WRITE_VPR(pSmi, 0x18, (dstBox->x2) | (dstBox->y2 << 16)); + WRITE_VPR(pSmi, 0x1C, offset >> 3); + WRITE_VPR(pSmi, 0x20, (pitch >> 3) | ((pitch >> 3) << 16)); +- WRITE_VPR(pSmi, 0x24, (hstretch << 8) | vstretch); ++ WRITE_VPR(pSmi, 0x24, (hstretch & 0xff00) | ((vstretch & 0xff00) >> 8)); ++ WRITE_VPR(pSmi, 0x68, ((hstretch & 0xff) << 8) | (vstretch & 0xff)); + + LEAVE(); + } diff --git a/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.3.ebuild b/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.3.ebuild new file mode 100644 index 0000000..d6a58b9 --- /dev/null +++ b/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.3.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.3.ebuild,v 1.4 2009/12/15 15:44:20 armin76 Exp $ + +# Must be before x-modular eclass is inherited +#SNAPSHOT="yes" +XDPVER=4 + +inherit x-modular + +DESCRIPTION="Silicon Motion video driver" +KEYWORDS="alpha amd64 ia64 x86 ~x86-fbsd" +RDEPEND=">=x11-base/xorg-server-1.0.99" +DEPEND="${RDEPEND} + x11-proto/fontsproto + x11-proto/randrproto + x11-proto/renderproto + x11-proto/videoproto + x11-proto/xextproto + x11-proto/xproto" + +PATCHES=( + "${FILESDIR}/${P}-fix-loongson.patch" + ) diff --git a/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-9999.ebuild b/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-9999.ebuild deleted file mode 100644 index 11942eb..0000000 --- a/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-9999.ebuild +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header$ -EAPI="2" - -inherit x-modular - -DESCRIPTION="Silicon Motion video driver" -KEYWORDS="" -RDEPEND=">=x11-base/xorg-server-1.5.0" -DEPEND="${RDEPEND} - x11-proto/fontsproto - x11-proto/randrproto - x11-proto/renderproto - x11-proto/videoproto - x11-proto/xextproto - x11-proto/xproto" |