[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-sis: Changes to 'upstream-unstable'



 configure.ac        |   53 ++++------
 man/Makefile.am     |   34 ------
 man/sis.man         |   20 ---
 src/initextx.c      |   18 +--
 src/osdef.h         |   24 ++--
 src/sis.h           |   29 ++++-
 src/sis6326_video.c |    6 -
 src/sis_dga.c       |    6 -
 src/sis_dri.c       |   24 ++--
 src/sis_driver.c    |  269 +++++++++++++++++++++++++++++-----------------------
 src/sis_memcpy.c    |   10 -
 src/sis_opt.c       |   16 +--
 src/sis_utility.c   |   48 ++++-----
 src/sis_vga.c       |   11 +-
 src/sis_video.c     |    8 -
 src/sispcirename.h  |   29 +++++
 src/vgatypes.h      |   12 --
 17 files changed, 322 insertions(+), 295 deletions(-)

New commits:
commit e067fc080c653a5d47cd319ca1a7afeebe6c7c4e
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Mar 23 19:52:38 2012 -0700

    xf86-video-sis 0.10.4
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/configure.ac b/configure.ac
index 62ad933..ab40a65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-sis],
-        [0.10.3],
+        [0.10.4],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-sis])
 AC_CONFIG_SRCDIR([Makefile.am])

commit f5dafa24d825a7d279c8177422c66b997b82d240
Author: Johannes Obermayr <johannesobermayr@gmx.de>
Date:   Mon Feb 6 23:15:31 2012 +0100

    Fix build with XInput version 12.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/sis_driver.c b/src/sis_driver.c
index d733f48..7a5be4e 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -85,7 +85,7 @@
 #include <X11/extensions/dpms.h>
 #endif
 
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 15
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
 #include <inputstr.h> /* for inputInfo */
 #endif
 
@@ -9358,7 +9358,7 @@ SISMergedPointerMoved(int scrnIndex, int x, int y)
             x = (int)dx;
             y = (int)dy;
         }
-#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 11
+#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 13
 	miPointerSetPosition(inputInfo.pointer, Absolute, x, y);
 #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
 	miPointerSetPosition(inputInfo.pointer, x, y);

commit bdaf1ba97cf8b0abb5aeee97a822ee466bf8f5f5
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jan 17 15:21:26 2012 +1000

    Undo typos from last commit
    
    Reported-by: Tormod Volden <debian.tormod@gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index a599108..62ad933 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,7 +100,7 @@ AM_CONDITIONAL(DRI, test x$DRI = xyes)
 if test "$DRI" = yes; then
         PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
         AC_DEFINE(SISDRI,1,[Enable DRI driver support])
-        AC_DEFINE(SIDDRI_DEVEL,1,[Enable developmental DRI driver support])
+        AC_DEFINE(SISDRI_DEVEL,1,[Enable developmental DRI driver support])
 fi
 
 # technically this should be a configure flag.  meh.
diff --git a/src/sis_dri.c b/src/sis_dri.c
index d0c4fba..97ed951 100644
--- a/src/sis_dri.c
+++ b/src/sis_dri.c
@@ -369,7 +369,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
    */
   pDRIInfo->SAREASize =
     ((sizeof(XF86DRISAREARec) + getpagesize() - 1) & getpagesize()); /* round to page */
-    /* ((sizeof(SISDRISAREARec) + 0xfff) & 0x1000); */ /* round to page */
+    /* ((sizeof(XF86DRISAREARec) + 0xfff) & 0x1000); */ /* round to page */
   /* + shared memory device private rec */
 #else
   /* For now the mapping works by using a fixed size defined

commit 9c1f8f775ca692858fd88e325ef815cc49e55805
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jan 4 13:58:01 2012 +1000

    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@who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>

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..f2ca3a9 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
@@ -195,7 +201,7 @@
 #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..d0c4fba 100644
--- a/src/sis_dri.c
+++ b/src/sis_dri.c
@@ -369,7 +369,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
    */
   pDRIInfo->SAREASize =
     ((sizeof(XF86DRISAREARec) + getpagesize() - 1) & getpagesize()); /* round to page */
-    /* ((sizeof(XF86DRISAREARec) + 0xfff) & 0x1000); */ /* 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
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)) {

commit 16724f3ecd322c64d9ee164fb122d4285d9cef08
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Oct 31 15:03:21 2011 +1000

    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@who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>

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;
      }

commit 3e0d8e11927b8c68f6531eef39eb5bca557e887b
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Dec 19 17:28:33 2011 -0500

    Fall back to shadowfb if XAA is unavailable
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/sis_driver.c b/src/sis_driver.c
index 7ac9487..6f7a15e 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -6858,8 +6858,10 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 #ifdef SIS_USE_XAA
        if(!pSiS->useEXA) {
 	  if (!xf86LoadSubModule(pScrn, "xaa")) {
-	    SISErrorLog(pScrn, "Could not load xaa module\n");
-	    goto my_error_1;
+	      xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+			 "Falling back to shadowfb\n");
+	      pSiS->NoAccel = 1;
+	      pSiS->ShadowFB = 1;
 	  }
        }
 #endif
@@ -6878,7 +6880,6 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 	  }
        }
 #endif
-       xf86DrvMsg(pScrn->scrnIndex, X_INFO, "2D acceleration enabled\n");
     }
 
     /* Load shadowfb (if needed) */

commit 2b459f385dc2f1b5e769e2ce84b6f4ec099c0a23
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Mon Oct 31 11:57:49 2011 -0700

    Build fix for older servers (error: conflicting types for 'pciTag')
    
    /usr/include/xorg/xf86Pci.h:254:25: note: previous declaration of 'pciTag' was here
    
    Reported-by: Johannes Obermayr <johannesobermayr@gmx.de>
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/src/sispcirename.h b/src/sispcirename.h
index 54cc07f..a354ac4 100644
--- a/src/sispcirename.h
+++ b/src/sispcirename.h
@@ -36,6 +36,10 @@ enum region_type {
     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
@@ -57,6 +61,7 @@ pciTag(int busnum, int devnum, int funcnum)
 
 	return tag;
 }
+#endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12 */
 
 #ifndef XSERVER_LIBPCIACCESS
 

commit 0ab07a477a4916923a13c073c3fd6e575e79f725
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sun Oct 30 11:09:30 2011 -0700

    Use pci_device_map_legacy rather than xf86MapDomainMemory on newer servers
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index f8d09af..036a448 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,7 +114,7 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
 CPPFLAGS="$SAVE_CPPFLAGS"
 
 if test "x$XSERVER_LIBPCIACCESS" = xyes; then
-    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
+    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.12.901])
     XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 fi
 AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
diff --git a/src/sis_vga.c b/src/sis_vga.c
index 5e6d0b4..4c887b8 100644
--- a/src/sis_vga.c
+++ b/src/sis_vga.c
@@ -1716,8 +1716,8 @@ SiSVGAMapMem(ScrnInfoPtr pScrn)
 
 #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0)
 #if XSERVER_LIBPCIACCESS
-    pSiS->VGAMemBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO_32BIT,
-			pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize);
+    (void) pci_device_map_legacy(pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize,
+                                 PCI_DEV_MAP_FLAG_WRITABLE, &pSiS->VGAMemBase);
 #else
     pSiS->VGAMemBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO_32BIT,
 			pSiS->PciTag, pSiS->VGAMapPhys, pSiS->VGAMapSize);
@@ -1737,7 +1737,12 @@ SiSVGAUnmapMem(ScrnInfoPtr pScrn)
 
     if(pSiS->VGAMemBase == NULL) return;
 
+#if XSERVER_LIBPCIACCESS
+    (void) pci_device_unmap_legacy(pSiS->PciInfo, pSiS->VGAMemBase, pSiS->VGAMapSize);
+#else
     xf86UnMapVidMem(pScrn->scrnIndex, pSiS->VGAMemBase, pSiS->VGAMapSize);
+#endif
+
     pSiS->VGAMemBase = NULL;
 }
 #endif

commit 77046f9be08295dbca69b51987df3308a284d87e
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sat Oct 29 17:44:55 2011 -0700

    Convert use of LookupWindow to dixLookupWindow
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/src/sis_driver.c b/src/sis_driver.c
index a8af80c..7ac9487 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -90,6 +90,26 @@
 #include "dri.h"
 #endif
 
+/*
+ * LookupWindow was removed with video abi 11.
+ */
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
+#ifndef DixGetAttrAccess
+#define DixGetAttrAccess   (1<<4)
+#endif
+#endif
+
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 2)
+static inline int
+dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access)
+{
+    *pWin = LookupWindow(id, client);
+    if (!*pWin)
+	return BadWindow;
+    return Success;
+}
+#endif
+
 /* Globals (yes, these ARE really required to be global) */
 
 #ifdef SISUSEDEVPORT
@@ -2146,10 +2166,12 @@ SiSProcXineramaGetState(ClientPtr client)
     WindowPtr			pWin;
     xPanoramiXGetStateReply	rep;
     register int		n;
+    int				rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
-    pWin = LookupWindow(stuff->window, client);
-    if(!pWin) return BadWindow;
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (rc != Success)
+        return rc;
 
     rep.type = X_Reply;
     rep.length = 0;
@@ -2170,10 +2192,12 @@ SiSProcXineramaGetScreenCount(ClientPtr client)
     WindowPtr				pWin;
     xPanoramiXGetScreenCountReply	rep;
     register int			n;
+    int					rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
-    pWin = LookupWindow(stuff->window, client);
-    if(!pWin) return BadWindow;
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (rc != Success)
+        return rc;
 
     rep.type = X_Reply;
     rep.length = 0;
@@ -2194,10 +2218,12 @@ SiSProcXineramaGetScreenSize(ClientPtr client)
     WindowPtr				pWin;
     xPanoramiXGetScreenSizeReply	rep;
     register int			n;
+    int					rc;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
-    pWin = LookupWindow (stuff->window, client);
-    if(!pWin)  return BadWindow;
+    rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+    if (rc != Success)
+        return rc;
 
     rep.type = X_Reply;
     rep.length = 0;

commit 06f8213bffd27360d5cc3df0cad19b102cc928e2
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sat Oct 29 17:32:21 2011 -0700

    pciTag was removed from xorg-server, so provide it in-driver until this is updated to use libpciaccess
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/src/sispcirename.h b/src/sispcirename.h
index c4beac6..54cc07f 100644
--- a/src/sispcirename.h
+++ b/src/sispcirename.h
@@ -29,11 +29,35 @@
 #ifndef SISPCIRENAME_H
 #define SISPCIRENAME_H
 
+#include <stdint.h>
+
 enum region_type {
     REGION_MEM,
     REGION_IO 
 };
 
+#if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
+#define PCI_DOM_MASK    0x01fful
+#else
+#define PCI_DOM_MASK 0x0ffu
+#endif
+
+#ifndef PCI_DOM_MASK
+# define PCI_DOM_MASK 0x0ffu
+#endif
+#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
+
+static inline uint32_t
+pciTag(int busnum, int devnum, int funcnum)
+{
+	uint32_t tag;
+	tag  = (busnum & (PCI_DOMBUS_MASK)) << 16;
+	tag |= (devnum & 0x00001fu) << 11;
+	tag |= (funcnum & 0x000007u) << 8;
+
+	return tag;
+}
+
 #ifndef XSERVER_LIBPCIACCESS
 
 /* pciVideoPtr */

commit 03644653d051e4f5b8498c790626a9bed2756a89
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sat Oct 29 17:25:18 2011 -0700

    Silence warnings by using newer xf86dgaproto
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index 8920c6f..f8d09af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto xf86dgaproto >= 2.1 $REQUIRED_MODULES])
 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
                   HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
                   HAVE_XEXTPROTO_71="no")
diff --git a/src/sis_driver.c b/src/sis_driver.c
index e19bfff..a8af80c 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -74,8 +74,7 @@
 
 #include "sis_driver.h"
 
-#define _XF86DGA_SERVER_
-#include <X11/extensions/xf86dgastr.h>
+#include <X11/extensions/xf86dgaproto.h>
 
 #include "globals.h"
 

commit 4b0aab53a1e8500578f86178761f4c805b2a5990
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Wed Oct 19 00:40:32 2011 -0700

    Build fix for ABI Version 12
    
    ABI Version 12 removes support for multiple PCI domains.  If you need to
    use this driver on a system with more than one PCI domain, you should
    either port this driver to using libpciaccess directly or stick with an
    older server.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/src/sis_driver.c b/src/sis_driver.c
index 17441ed..e19bfff 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -3214,7 +3214,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
     pSiS->pInt = NULL;
 
     /* Save PCI Domain Base */
-#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
+#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) || GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12
     pSiS->IODBase = 0;
 #else
     pSiS->IODBase = pScrn->domainIOBase;

commit 69aa104ed064ca08196e7310e232ddb5c9a590bd
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Wed Oct 19 00:35:02 2011 -0700

    Use unsigned long rather than deprecated IOADDRESS
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/src/osdef.h b/src/osdef.h
index cd6b907..5776910 100644
--- a/src/osdef.h
+++ b/src/osdef.h
@@ -110,12 +110,12 @@
 #warning sisfb will not work!
 #endif
 
-#define OutPortByte(p,v) outb((u8)(v),(IOADDRESS)(p))
-#define OutPortWord(p,v) outw((u16)(v),(IOADDRESS)(p))
-#define OutPortLong(p,v) outl((u32)(v),(IOADDRESS)(p))
-#define InPortByte(p)    inb((IOADDRESS)(p))
-#define InPortWord(p)    inw((IOADDRESS)(p))
-#define InPortLong(p)    inl((IOADDRESS)(p))
+#define OutPortByte(p,v) outb((u8)(v),(unsigned long)(p))
+#define OutPortWord(p,v) outw((u16)(v),(unsigned long)(p))
+#define OutPortLong(p,v) outl((u32)(v),(unsigned long)(p))
+#define InPortByte(p)    inb((unsigned long)(p))
+#define InPortWord(p)    inw((unsigned long)(p))
+#define InPortLong(p)    inl((unsigned long)(p))
 #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize)
 
 #endif /* LINUX_KERNEL */
@@ -129,12 +129,12 @@
 #define SIS300
 #define SIS315H
 
-#define OutPortByte(p,v) outSISREG((IOADDRESS)(p),(CARD8)(v))
-#define OutPortWord(p,v) outSISREGW((IOADDRESS)(p),(CARD16)(v))
-#define OutPortLong(p,v) outSISREGL((IOADDRESS)(p),(CARD32)(v))
-#define InPortByte(p)    inSISREG((IOADDRESS)(p))
-#define InPortWord(p)    inSISREGW((IOADDRESS)(p))
-#define InPortLong(p)    inSISREGL((IOADDRESS)(p))
+#define OutPortByte(p,v) outSISREG((unsigned long)(p),(CARD8)(v))
+#define OutPortWord(p,v) outSISREGW((unsigned long)(p),(CARD16)(v))
+#define OutPortLong(p,v) outSISREGL((unsigned long)(p),(CARD32)(v))
+#define InPortByte(p)    inSISREG((unsigned long)(p))
+#define InPortWord(p)    inSISREGW((unsigned long)(p))
+#define InPortLong(p)    inSISREGL((unsigned long)(p))
 #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
 
 #endif /* XF86 */
diff --git a/src/sis.h b/src/sis.h
index f39379d..9af31a5 100644
--- a/src/sis.h
+++ b/src/sis.h
@@ -978,7 +978,7 @@ typedef struct {
     void 		*RealFbBase;	/* Real VRAM virtual linear address (for DHM and SiS76x UMA skipping) */
     CARD32		IOAddress;	/* MMIO physical address */
     void		*IOBase;	/* MMIO linear address */
-    IOADDRESS		IODBase;	/* Base of PIO memory area */
+    unsigned long	IODBase;	/* Base of PIO memory area */
 #ifdef __alpha__
     void		*IOBaseDense;	/* MMIO for Alpha platform */
 #endif
@@ -1355,7 +1355,7 @@ typedef struct {
     Bool		skipswitchcheck;
     unsigned int	VBFlagsInit;
     DisplayModePtr	currentModeLast;
-    IOADDRESS		MyPIOOffset;
+    unsigned long	MyPIOOffset;
     Bool		OverruleRanges;
     Bool		BenchMemCpy;
     Bool		NeedCopyFastVidCpy;
diff --git a/src/vgatypes.h b/src/vgatypes.h
index 4be31e4..d6e7b6e 100644
--- a/src/vgatypes.h
+++ b/src/vgatypes.h
@@ -69,8 +69,9 @@ typedef unsigned int BOOLEAN;
 
 #define SISIOMEMTYPE
 
-#ifdef SIS_LINUX_KERNEL
 typedef unsigned long SISIOADDRESS;
+
+#ifdef SIS_LINUX_KERNEL
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
 #include <linux/types.h>  /* Need __iomem */
 #undef SISIOMEMTYPE
@@ -78,15 +79,6 @@ typedef unsigned long SISIOADDRESS;
 #endif
 #endif
 
-#ifdef SIS_XORG_XF86
-#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
-typedef unsigned long IOADDRESS;
-typedef unsigned long SISIOADDRESS;
-#else
-typedef IOADDRESS SISIOADDRESS;
-#endif
-#endif
-
 typedef enum _SIS_CHIP_TYPE {
     SIS_VGALegacy = 0,
     SIS_530,

commit 28f3a899a1e317b665cc1925ce7a4e34818cfd1f
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Oct 7 12:32:22 2011 -0700

    Use malloc/calloc/realloc/free directly
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/src/initextx.c b/src/initextx.c
index 5c00398..1e84d0f 100644
--- a/src/initextx.c
+++ b/src/initextx.c
@@ -238,10 +238,10 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
 	 continue;
       }
 
-      if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+      if(!(new = malloc(sizeof(DisplayModeRec)))) return first;
       memset(new, 0, sizeof(DisplayModeRec));
-      if(!(new->name = xalloc(10))) {
-	 xfree(new);
+      if(!(new->name = malloc(10))) {
+	 free(new);
 	 return first;
       }
       if(!first) first = new;
@@ -385,11 +385,11 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
 		     }
 		  }
 
-		  if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+		  if(!(new = malloc(sizeof(DisplayModeRec)))) return first;
 
 		  memset(new, 0, sizeof(DisplayModeRec));
-		  if(!(new->name = xalloc(12))) {
-		     xfree(new);
+		  if(!(new->name = malloc(12))) {
+		     free(new);
 		     return first;
 		  }
 		  if(!first) first = new;
@@ -470,11 +470,11 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
 
 	 if(pSiS->SiS_Pr->CP_DataValid[i]) {
 
-	    if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+	    if(!(new = malloc(sizeof(DisplayModeRec)))) return first;
 
 	    memset(new, 0, sizeof(DisplayModeRec));
-	    if(!(new->name = xalloc(10))) {
-	       xfree(new);
+	    if(!(new->name = malloc(10))) {
+	       free(new);
 	       return first;
 	    }
 	    if(!first) first = new;
diff --git a/src/sis6326_video.c b/src/sis6326_video.c
index c6b18e2..66352b7 100644
--- a/src/sis6326_video.c
+++ b/src/sis6326_video.c
@@ -170,7 +170,7 @@ void SIS6326InitVideo(ScreenPtr pScreen)
 		adaptors = &newAdaptor;
 	} else {
 		/* need to free this someplace */
-		newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+		newAdaptors = malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
 		if(newAdaptors) {
 			memcpy(newAdaptors, adaptors, num_adaptors *
 				sizeof(XF86VideoAdaptorPtr));
@@ -185,7 +185,7 @@ void SIS6326InitVideo(ScreenPtr pScreen)
 	xf86XVScreenInit(pScreen, adaptors, num_adaptors);
 
     if(newAdaptors)
-	xfree(newAdaptors);
+	free(newAdaptors);
 }
 
 /* client libraries expect an encoding */
@@ -531,7 +531,7 @@ SIS6326SetupImageVideo(ScreenPtr pScreen)
        return NULL;
 #endif
 
-    if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+    if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
                             sizeof(SISPortPrivRec) +
                             sizeof(DevUnion))))
        return NULL;
diff --git a/src/sis_dga.c b/src/sis_dga.c
index d358645..16b0ee4 100644
--- a/src/sis_dga.c
+++ b/src/sis_dga.c
@@ -150,18 +150,18 @@ SISSetupDGAMode(
 
 	if(pMode->HDisplay != otherPitch) {
 
-	    newmodes = xrealloc(modes, (*num + 2) * sizeof(DGAModeRec));
+	    newmodes = realloc(modes, (*num + 2) * sizeof(DGAModeRec));
 	    oneMore  = TRUE;
 
 	} else {
 
-	    newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec));
+	    newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec));
 	    oneMore  = FALSE;
 
 	}
 
 	if(!newmodes) {
-	    xfree(modes);
+	    free(modes);
 	    return NULL;
 	}
 	modes = newmodes;
diff --git a/src/sis_dri.c b/src/sis_dri.c
index 3a476a2..97ed951 100644
--- a/src/sis_dri.c
+++ b/src/sis_dri.c
@@ -149,19 +149,19 @@ SISInitVisualConfigs(ScreenPtr pScreen)
   case 32:
     numConfigs = (useZ16) ? 8 : 16;
 
-    if(!(pConfigs = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
+    if(!(pConfigs = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
 						   numConfigs))) {
        return FALSE;
     }
-    if(!(pSISConfigs = (SISConfigPrivPtr)xcalloc(sizeof(SISConfigPrivRec),
+    if(!(pSISConfigs = (SISConfigPrivPtr)calloc(sizeof(SISConfigPrivRec),
 						    numConfigs))) {
-       xfree(pConfigs);
+       free(pConfigs);
        return FALSE;
     }
-    if(!(pSISConfigPtrs = (SISConfigPrivPtr*)xcalloc(sizeof(SISConfigPrivPtr),
+    if(!(pSISConfigPtrs = (SISConfigPrivPtr*)calloc(sizeof(SISConfigPrivPtr),
 							  numConfigs))) {
-       xfree(pConfigs);
-       xfree(pSISConfigs);
+       free(pConfigs);
+       free(pSISConfigs);
        return FALSE;
     }
     for(i=0; i<numConfigs; i++) pSISConfigPtrs[i] = &pSISConfigs[i];
@@ -319,7 +319,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
      pDRIInfo->busIdString = DRICreatePCIBusID(pSIS->PciInfo);
   } else {
 #endif
-     pDRIInfo->busIdString = xalloc(64);
+     pDRIInfo->busIdString = malloc(64);
      sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d",
 	     pSIS->PciBus, pSIS->PciDevice, pSIS->PciFunc);
 #ifdef SISHAVECREATEBUSID
@@ -383,7 +383,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
   pDRIInfo->SAREASize = SAREA_MAX;
 #endif
 
-  if(!(pSISDRI = (SISDRIPtr)xcalloc(sizeof(SISDRIRec), 1))) {
+  if(!(pSISDRI = (SISDRIPtr)calloc(sizeof(SISDRIRec), 1))) {
      DRIDestroyInfoRec(pSIS->pDRIInfo);
      pSIS->pDRIInfo = 0;
      return FALSE;
@@ -401,7 +401,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
 
   if(!DRIScreenInit(pScreen, pDRIInfo, &pSIS->drmSubFD)) {
      xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] DRIScreenInit failed. Disabling the DRI.\n");
-     xfree(pDRIInfo->devPrivate);
+     free(pDRIInfo->devPrivate);
      pDRIInfo->devPrivate = 0;
      DRIDestroyInfoRec(pSIS->pDRIInfo);
      pSIS->pDRIInfo = 0;
@@ -794,7 +794,7 @@ SISDRICloseScreen(ScreenPtr pScreen)
 
   if(pSIS->pDRIInfo) {
      if(pSIS->pDRIInfo->devPrivate) {
-	xfree(pSIS->pDRIInfo->devPrivate);
+	free(pSIS->pDRIInfo->devPrivate);
 	pSIS->pDRIInfo->devPrivate = NULL;
      }
      DRIDestroyInfoRec(pSIS->pDRIInfo);
@@ -802,12 +802,12 @@ SISDRICloseScreen(ScreenPtr pScreen)
   }
 
   if(pSIS->pVisualConfigs) {
-     xfree(pSIS->pVisualConfigs);
+     free(pSIS->pVisualConfigs);
      pSIS->pVisualConfigs = NULL;
   }
 
   if(pSIS->pVisualConfigsPriv) {
-     xfree(pSIS->pVisualConfigsPriv);
+     free(pSIS->pVisualConfigsPriv);
      pSIS->pVisualConfigsPriv = NULL;
   }
 
diff --git a/src/sis_driver.c b/src/sis_driver.c
index b31ecb1..17441ed 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -299,9 +299,9 @@ SISFreeRec(ScrnInfoPtr pScrn)
     pSiSEnt = pSiS->entityPrivate;
 #endif
 
-    if(pSiS->pstate) xfree(pSiS->pstate);
+    if(pSiS->pstate) free(pSiS->pstate);
     pSiS->pstate = NULL;
-    if(pSiS->fonts) xfree(pSiS->fonts);
+    if(pSiS->fonts) free(pSiS->fonts);
     pSiS->fonts = NULL;
 
 #ifdef SISDUALHEAD
@@ -312,11 +312,11 @@ SISFreeRec(ScrnInfoPtr pScrn)
 	   * and we need the BIOS image and SiS_Private for the first
 	   * head.
 	   */
-	  if(pSiSEnt->BIOS) xfree(pSiSEnt->BIOS);
+	  if(pSiSEnt->BIOS) free(pSiSEnt->BIOS);
 	  pSiSEnt->BIOS = pSiS->BIOS = NULL;
-	  if(pSiSEnt->SiS_Pr) xfree(pSiSEnt->SiS_Pr);
+	  if(pSiSEnt->SiS_Pr) free(pSiSEnt->SiS_Pr);
 	  pSiSEnt->SiS_Pr = pSiS->SiS_Pr = NULL;
-	  if(pSiSEnt->RenderAccelArray) xfree(pSiSEnt->RenderAccelArray);
+	  if(pSiSEnt->RenderAccelArray) free(pSiSEnt->RenderAccelArray);
 	  pSiSEnt->RenderAccelArray = pSiS->RenderAccelArray = NULL;
 	  pSiSEnt->pScrn_1 = NULL;
        } else {
@@ -327,21 +327,21 @@ SISFreeRec(ScrnInfoPtr pScrn)
        }


Reply to: