unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: xorg: Add patch to fix sis driver crashes.
@ 2015-04-01 20:05 Alex Kost
  2015-04-01 22:49 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Kost @ 2015-04-01 20:05 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 93 bytes --]

Without this patch, recent versions of Xorg server crash on some SiS
chipsets.  OK to push?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-xorg-Add-patch-to-fix-sis-driver-crashes.patch --]
[-- Type: text/x-diff, Size: 3986 bytes --]

From 914a844f4c66e3aebb11e3281b71bef41847f338 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Wed, 1 Apr 2015 22:15:15 +0300
Subject: [PATCH] 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.
---
 gnu-system.am                                      |  1 +
 .../patches/xf86-video-sis-fix-exa-crash.patch     | 45 ++++++++++++++++++++++
 gnu/packages/xorg.scm                              |  3 +-
 3 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/xf86-video-sis-fix-exa-crash.patch

diff --git a/gnu-system.am b/gnu-system.am
index cb68e72..cb014e2 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -556,6 +556,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/xf86-video-openchrome-glibc-2.20.patch	\
   gnu/packages/patches/xf86-video-r128-glibc-2.20.patch		\
   gnu/packages/patches/xf86-video-siliconmotion-remove-mibstore.patch \
+  gnu/packages/patches/xf86-video-sis-fix-exa-crash.patch	\
   gnu/packages/patches/xf86-video-sis-update-api.patch		\
   gnu/packages/patches/xf86-video-tdfx-remove-mibstore.patch	\
   gnu/packages/patches/xf86-video-tga-remove-mibstore.patch	\
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 0000000..f5cd0b9
--- /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 cfb4cc1..998f080 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)
-- 
2.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gnu: xorg: Add patch to fix sis driver crashes.
  2015-04-01 20:05 [PATCH] gnu: xorg: Add patch to fix sis driver crashes Alex Kost
@ 2015-04-01 22:49 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2015-04-01 22:49 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> writes:

> Without this patch, recent versions of Xorg server crash on some SiS
> chipsets.  OK to push?
>
>
> From 914a844f4c66e3aebb11e3281b71bef41847f338 Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Wed, 1 Apr 2015 22:15:15 +0300
> Subject: [PATCH] gnu: xorg: Add patch to fix sis driver crashes.

Okay, please push!

    Thanks,
      Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-01 22:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01 20:05 [PATCH] gnu: xorg: Add patch to fix sis driver crashes Alex Kost
2015-04-01 22:49 ` Mark H Weaver

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).