[xorg-x11-drv-sis] Sync with latest git again Add a hack to replace the now-removed miPointerAbsoluteCursor Add a hack
Peter Hutterer
whot at fedoraproject.org
Wed Jan 4 04:10:07 UTC 2012
commit 835efca0943a59aeebe7b17d2ec1200c4bd00678
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Wed Jan 4 14:10:53 2012 +1000
Sync with latest git again
Add a hack to replace the now-removed miPointerAbsoluteCursor
Add a hack to allow build without DRI
...86DRI-from-the-driver-specific-DRI-define.patch | 207 ++++++++++++++++++++
...erSetPosition-not-miPointerAbsoluteCursor.patch | 60 ++++++
sis-0.10.3-git.patch | 9 +-
xorg-x11-drv-sis.spec | 11 +-
4 files changed, 279 insertions(+), 8 deletions(-)
---
diff --git a/0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch b/0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch
new file mode 100644
index 0000000..d5a386a
--- /dev/null
+++ b/0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch
@@ -0,0 +1,207 @@
+From b7c731f7a3706694c05a0063815822beaf9d8390 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Wed, 4 Jan 2012 13:58:01 +1000
+Subject: [PATCH] Untangle XF86DRI from the driver-specific DRI define
+
+XF86DRI is defined by xorg-server.h, so --disable-dri in the sis driver
+itself does exactly nothing other than not fill in the CFLAGS and thus stop
+the driver from compiling.
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+ configure.ac | 4 ++--
+ src/sis.h | 18 ++++++++++++------
+ src/sis_dri.c | 6 +++---
+ src/sis_driver.c | 14 +++++++-------
+ src/sis_opt.c | 4 ++--
+ 5 files changed, 26 insertions(+), 20 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 036a448..a599108 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -99,8 +99,8 @@ AC_MSG_RESULT([$DRI])
+ AM_CONDITIONAL(DRI, test x$DRI = xyes)
+ if test "$DRI" = yes; then
+ PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
+- AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
+- AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
++ AC_DEFINE(SISDRI,1,[Enable DRI driver support])
++ AC_DEFINE(SIDDRI_DEVEL,1,[Enable developmental DRI driver support])
+ fi
+
+ # technically this should be a configure flag. meh.
+diff --git a/src/sis.h b/src/sis.h
+index 9af31a5..de7b279 100644
+--- a/src/sis.h
++++ b/src/sis.h
+@@ -181,7 +181,13 @@
+
+ #undef SISHAVEDRMWRITE
+ #undef SISNEWDRI
+-#ifdef XF86DRI
++
++/* if the server was built without DRI support, force-disable DRI */
++#ifndef XF86DRI
++#undef SISDRI
++#endif
++
++#ifdef SISDRI
+ #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,3,0)
+ #define SISHAVEDRMWRITE
+ #endif
+@@ -191,11 +197,11 @@
+ #undef SIS315DRI /* define this if dri is adapted for 315/330 series */
+ #include "xf86drm.h"
+ #include "sarea.h"
+-#define _XF86DRI_SERVER_
++#define _SISDRI_SERVER_
+ #include "dri.h"
+ #include "GL/glxint.h"
+ #include "sis_dri.h"
+-#endif /* XF86DRI */
++#endif /* SISDRI */
+
+ /* Configurable stuff: ------------------------------------- */
+
+@@ -812,7 +818,7 @@ typedef struct {
+ ScrnInfoPtr pScrn_2;
+ UChar *BIOS;
+ struct SiS_Private *SiS_Pr;
+-#ifdef XF86DRI
++#ifdef SISDRI
+ SISAGPHTYPE agpHandle;
+ ULong agpAddr;
+ UChar *agpBase;
+@@ -1092,7 +1098,7 @@ typedef struct {
+ unsigned int cmdQueueSize_div2;
+ unsigned int cmdQueueSize_div4;
+ unsigned int cmdQueueSize_4_3;
+-#ifdef XF86DRI
++#ifdef SISDRI
+ SISAGPHTYPE agpHandle;
+ ULong agpAddr;
+ UChar *agpBase;
+@@ -1151,7 +1157,7 @@ typedef struct {
+
+ /* DRI */
+ Bool loadDRI;
+-#ifdef XF86DRI
++#ifdef SISDRI
+ Bool directRenderingEnabled;
+ DRIInfoPtr pDRIInfo;
+ int drmSubFD;
+diff --git a/src/sis_dri.c b/src/sis_dri.c
+index 97ed951..0ab576e 100644
+--- a/src/sis_dri.c
++++ b/src/sis_dri.c
+@@ -368,14 +368,14 @@ SISDRIScreenInit(ScreenPtr pScreen)
+ * for SAREA mapping that includes a device private record
+ */
+ pDRIInfo->SAREASize =
+- ((sizeof(XF86DRISAREARec) + getpagesize() - 1) & getpagesize()); /* round to page */
+- /* ((sizeof(XF86DRISAREARec) + 0xfff) & 0x1000); */ /* round to page */
++ ((sizeof(SISDRISAREARec) + getpagesize() - 1) & getpagesize()); /* round to page */
++ /* ((sizeof(SISDRISAREARec) + 0xfff) & 0x1000); */ /* round to page */
+ /* + shared memory device private rec */
+ #else
+ /* For now the mapping works by using a fixed size defined
+ * in the SAREA header
+ */
+- if(sizeof(XF86DRISAREARec) + sizeof(SISSAREAPriv) > SAREA_MAX) {
++ if(sizeof(SISDRISAREARec) + sizeof(SISSAREAPriv) > SAREA_MAX) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "[dri] Data does not fit in SAREA. Disabling the DRI.\n");
+ return FALSE;
+diff --git a/src/sis_driver.c b/src/sis_driver.c
+index 3218239..d733f48 100644
+--- a/src/sis_driver.c
++++ b/src/sis_driver.c
+@@ -90,7 +90,7 @@
+ #endif
+
+
+-#ifdef XF86DRI
++#ifdef SISDRI
+ #include "dri.h"
+ #endif
+
+@@ -6895,7 +6895,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
+ }
+
+ /* Load the dri and glx modules if requested. */
+-#ifdef XF86DRI
++#ifdef SISDRI
+ if(pSiS->loadDRI) {
+ if(!xf86LoaderCheckSymbol("DRIScreenInit")) {
+ if(xf86LoadSubModule(pScrn, "dri")) {
+@@ -8731,7 +8731,7 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ pSiS->cmdQueueLen = 0; /* Force an EngineIdle() at start */
+
+-#ifdef XF86DRI
++#ifdef SISDRI
+ if(pSiS->loadDRI) {
+ #ifdef SISDUALHEAD
+ /* No DRI in dual head mode */
+@@ -9044,7 +9044,7 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ }
+ #endif
+
+-#ifdef XF86DRI
++#ifdef SISDRI
+ if(pSiS->loadDRI) {
+ if(pSiS->directRenderingEnabled) {
+ /* Now that mi, drm and others have done their thing,
+@@ -9778,7 +9778,7 @@ SISEnterVT(int scrnIndex, int flags)
+
+ SISAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+
+-#ifdef XF86DRI
++#ifdef SISDRI
+ if(pSiS->directRenderingEnabled) {
+ DRIUnlock(screenInfo.screens[scrnIndex]);
+ }
+@@ -9804,7 +9804,7 @@ SISLeaveVT(int scrnIndex, int flags)
+ {
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SISPtr pSiS = SISPTR(pScrn);
+-#ifdef XF86DRI
++#ifdef SISDRI
+ ScreenPtr pScreen;
+
+ if(pSiS->directRenderingEnabled) {
+@@ -9888,7 +9888,7 @@ SISCloseScreen(int scrnIndex, ScreenPtr pScreen)
+ SiSCtrlExtUnregister(pSiS, pScrn->scrnIndex);
+ }
+
+-#ifdef XF86DRI
++#ifdef SISDRI
+ if(pSiS->directRenderingEnabled) {
+ SISDRICloseScreen(pScreen);
+ pSiS->directRenderingEnabled = FALSE;
+diff --git a/src/sis_opt.c b/src/sis_opt.c
+index d39ff6e..3fa12c9 100644
+--- a/src/sis_opt.c
++++ b/src/sis_opt.c
+@@ -480,7 +480,7 @@ SiSOptions(ScrnInfoPtr pScrn)
+ #endif
+ pSiS->ShadowFB = FALSE;
+ pSiS->loadDRI = FALSE;
+-#ifdef XF86DRI
++#ifdef SISDRI
+ pSiS->agpWantedPages = AGP_PAGES;
+ #endif
+ pSiS->VESA = -1;
+@@ -2034,7 +2034,7 @@ SiSOptions(ScrnInfoPtr pScrn)
+ }
+ }
+
+-#ifdef XF86DRI
++#ifdef SISDRI
+ /* DRI */
+ from = X_DEFAULT;
+ if(xf86GetOptValBool(pSiS->Options, OPTION_DRI, &pSiS->loadDRI)) {
+--
+1.7.7.4
+
diff --git a/0001-Use-miPointerSetPosition-not-miPointerAbsoluteCursor.patch b/0001-Use-miPointerSetPosition-not-miPointerAbsoluteCursor.patch
new file mode 100644
index 0000000..9bd65f0
--- /dev/null
+++ b/0001-Use-miPointerSetPosition-not-miPointerAbsoluteCursor.patch
@@ -0,0 +1,60 @@
+From 1e3c6ba82f34afdfa9fe9835c37b4d88e86d1d10 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Mon, 31 Oct 2011 15:03:21 +1000
+Subject: [PATCH] Use miPointerSetPosition, not miPointerAbsoluteCursor
+
+miPointerAbsoluteCursor was removed in '09.
+
+Technically this shouldn't just work on the VCP since any master pointer may
+end up in the dead area. However, I suspect the Venn diagramm of MPX users
+and sis merged framebuffer users shows little overlap.
+
+miPointerSetPosition's prototype changed a few times, these are a bunch of
+untested ifdefs that should be correct according to the git history.
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+ src/sis_driver.c | 19 ++++++++++++++++++-
+ 1 files changed, 18 insertions(+), 1 deletions(-)
+
+diff --git a/src/sis_driver.c b/src/sis_driver.c
+index 6f7a15e..3218239 100644
+--- a/src/sis_driver.c
++++ b/src/sis_driver.c
+@@ -85,6 +85,10 @@
+ #include <X11/extensions/dpms.h>
+ #endif
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 15
++#include <inputstr.h> /* for inputInfo */
++#endif
++
+
+ #ifdef XF86DRI
+ #include "dri.h"
+@@ -9346,9 +9350,22 @@ SISMergedPointerMoved(int scrnIndex, int x, int y)
+ }
+ }
+ if(doit) {
+- UpdateCurrentTime();
+ sigstate = xf86BlockSIGIO();
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 15
++ {
++ double dx = x, dy = y;
++ miPointerSetPosition(inputInfo.pointer, Absolute, &dx, &dy);
++ x = (int)dx;
++ y = (int)dy;
++ }
++#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11
++ miPointerSetPosition(inputInfo.pointer, Absolute, x, y);
++#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
++ miPointerSetPosition(inputInfo.pointer, x, y);
++#else
++ UpdateCurrentTime();
+ miPointerAbsoluteCursor(x, y, currentTime.milliseconds);
++#endif
+ xf86UnblockSIGIO(sigstate);
+ return;
+ }
+--
+1.7.7.4
diff --git a/sis-0.10.3-git.patch b/sis-0.10.3-git.patch
index 2d5076b..d355e15 100644
--- a/sis-0.10.3-git.patch
+++ b/sis-0.10.3-git.patch
@@ -1388,10 +1388,10 @@ index 7322efb..2006858 100644
sizeof(SISBPortPrivRec)))) {
return NULL;
diff --git a/src/sispcirename.h b/src/sispcirename.h
-index c4beac6..a354ac4 100644
+index c4beac6..54cc07f 100644
--- a/src/sispcirename.h
+++ b/src/sispcirename.h
-@@ -29,11 +29,40 @@
+@@ -29,11 +29,35 @@
#ifndef SISPCIRENAME_H
#define SISPCIRENAME_H
@@ -1402,10 +1402,6 @@ index c4beac6..a354ac4 100644
REGION_IO
};
-+#include "xf86Module.h"
-+
-+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12
-+
+#if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
+#define PCI_DOM_MASK 0x01fful
+#else
@@ -1427,7 +1423,6 @@ index c4beac6..a354ac4 100644
+
+ return tag;
+}
-+#endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12 */
+
#ifndef XSERVER_LIBPCIACCESS
diff --git a/xorg-x11-drv-sis.spec b/xorg-x11-drv-sis.spec
index 2607022..911849c 100644
--- a/xorg-x11-drv-sis.spec
+++ b/xorg-x11-drv-sis.spec
@@ -5,7 +5,7 @@
Summary: Xorg X11 sis video driver
Name: xorg-x11-drv-sis
Version: 0.10.3
-Release: 12%{?dist}
+Release: 13%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -13,6 +13,8 @@ Group: User Interface/X Hardware Support
Source0: ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
Patch0: sis-0.10.3-git.patch
+Patch1: 0001-Use-miPointerSetPosition-not-miPointerAbsoluteCursor.patch
+Patch2: 0001-Untangle-XF86DRI-from-the-driver-specific-DRI-define.patch
ExcludeArch: s390 s390x
@@ -29,6 +31,8 @@ X.Org X11 sis video driver.
%prep
%setup -q -n %{tarball}-%{version}
%patch0 -p1 -b .git
+%patch1 -p1 -b .miPointerSetPosition
+%patch2 -p1 -b .xf86dri
%build
%configure --disable-static --disable-dri
@@ -52,6 +56,11 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man4/sis.4*
%changelog
+* Wed Jan 04 2012 Peter Hutterer <peter.hutterer at redhat.com> 0.10.3-13
+- Sync with latest git again
+- Add a hack to replace the now-removed miPointerAbsoluteCursor
+- Add a hack to allow build without DRI
+
* Wed Jan 04 2012 Peter Hutterer <peter.hutterer at redhat.com> - 0.10.3-12
- Rebuild for server 1.12
More information about the scm-commits
mailing list