aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-04-01 22:15:15 +0300
committerAlex Kost <alezost@gmail.com>2015-04-03 15:21:12 +0300
commit946dc71f632e053083c98f845b04b1bcf1588c02 (patch)
tree5adb79d7f91e4e65fe8dbac6e64052b98f99f727 /gnu
parent0492f4a2b9bf81af9f565404d956285a2c76dd0c (diff)
downloadguix-946dc71f632e053083c98f845b04b1bcf1588c02.tar
guix-946dc71f632e053083c98f845b04b1bcf1588c02.tar.gz
gnu: xorg: Add patch to fix sis driver crashes.
* gnu/packages/patches/xf86-video-sis-fix-exa-crash.patch: New file. * gnu/packages/xorg.scm (xf86-video-sis): Use it. * gnu-system.am (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/patches/xf86-video-sis-fix-exa-crash.patch45
-rw-r--r--gnu/packages/xorg.scm3
2 files changed, 47 insertions, 1 deletions
diff --git a/gnu/packages/patches/xf86-video-sis-fix-exa-crash.patch b/gnu/packages/patches/xf86-video-sis-fix-exa-crash.patch
new file mode 100644
index 0000000000..f5cd0b9a9e
--- /dev/null
+++ b/gnu/packages/patches/xf86-video-sis-fix-exa-crash.patch
@@ -0,0 +1,45 @@
+Fix X server crash when sis driver is used with EXA acceleration.
+
+Source: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/xserver-xorg-video-sis/trusty/revision/24/debian/patches/fix-exa-crash.diff
+
+The patch was originally proposed by nihui:
+https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-sis/+bug/1066464/comments/13
+
+--- a/src/sis310_accel.c
++++ b/src/sis310_accel.c
+@@ -1874,7 +1874,7 @@
+ {
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pDst->drawable.pScreen);
+ SISPtr pSiS = SISPTR(pScrn);
+- unsigned char *dst = pDst->devPrivate.ptr;
++ unsigned char *dst = ((unsigned char *) pSiS->FbBase) + exaGetPixmapOffset(pDst);
+ int dst_pitch = exaGetPixmapPitch(pDst);
+
+ (pSiS->SyncAccel)(pScrn);
+@@ -1882,7 +1882,7 @@
+ if(pDst->drawable.bitsPerPixel < 8)
+ return FALSE;
+
+- dst += (x * pDst->drawable.bitsPerPixel / 8) + (y * src_pitch);
++ dst += (x * pDst->drawable.bitsPerPixel / 8) + (y * dst_pitch);
+ while(h--) {
+ SiSMemCopyToVideoRam(pSiS, dst, (unsigned char *)src,
+ (w * pDst->drawable.bitsPerPixel / 8));
+@@ -1953,7 +1953,7 @@
+ {
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pSrc->drawable.pScreen);
+ SISPtr pSiS = SISPTR(pScrn);
+- unsigned char *src = pSrc->devPrivate.ptr;
++ unsigned char *src = ((unsigned char *) pSiS->FbBase) + exaGetPixmapOffset(pSrc);
+ int src_pitch = exaGetPixmapPitch(pSrc);
+ int size = src_pitch < dst_pitch ? src_pitch : dst_pitch;
+
+@@ -1964,7 +1964,7 @@
+
+ src += (x * pSrc->drawable.bitsPerPixel / 8) + (y * src_pitch);
+ while(h--) {
+- SiSMemCopyFromVideoRam(pSiS, (unsigned char *)dst, src, size);
++ SiSMemCopyFromVideoRam(pSiS, (unsigned char *)dst, src, (w * pSrc->drawable.bitsPerPixel / 8));
+ src += src_pitch;
+ dst += dst_pitch;
+ }
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index cfb4cc1643..998f0803fc 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -2932,7 +2932,8 @@ graphics cards.")
(sha256
(base32
"1l0w84x39gq4y9j81dny9r6rma1xkqvxpsavpkd8h7h8panbcbmy"))
- (patches (list (search-patch "xf86-video-sis-update-api.patch")))))
+ (patches (list (search-patch "xf86-video-sis-update-api.patch")
+ (search-patch "xf86-video-sis-fix-exa-crash.patch")))))
(build-system gnu-build-system)
(inputs `(("mesa" ,mesa)
("xf86dgaproto" ,xf86dgaproto)