diff -Nurpa -x '*~' -x '*.orig' -x '*.rej' -x '*.swp' xf86-video-sis-0.9.1/configure.ac xf86-video-sis-0.9.1/configure.ac --- xf86-video-sis-0.9.1/configure.ac 2013-04-28 15:35:31.981780749 +0300 +++ xf86-video-sis-0.9.1/configure.ac 2013-04-28 15:35:32.032781314 +0300 @@ -20,20 +20,26 @@ # # Process this file with autoconf to produce a configure script -AC_PREREQ(2.57) +# Initialize Autoconf +AC_PREREQ(2.60) AC_INIT([xf86-video-sis], 0.9.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-sis) - AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR(.) +# Initialize Automake AM_INIT_AUTOMAKE([dist-bzip2]) - AM_MAINTAINER_MODE +# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.8) +XORG_DEFAULT_OPTIONS + # Checks for programs. AC_DISABLE_STATIC AC_PROG_LIBTOOL @@ -66,7 +72,7 @@ PKG_CHECK_MODULES(XEXT, [xextproto >= 7. HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]), HAVE_XEXTPROTO_71="no") AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) -sdkdir=$(pkg-config --variable=sdkdir xorg-server) +sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` # Checks for libraries. @@ -104,6 +110,19 @@ fi # technically this should be a configure flag. meh. AC_DEFINE(XF86EXA, 1, [Build support for Exa]) +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" +AC_CHECK_DECL(XSERVER_LIBPCIACCESS, + [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], + [#include "xorg-server.h"]) +CPPFLAGS="$SAVE_CPPFLAGS" + +if test "x$XSERVER_LIBPCIACCESS" = xyes; then + PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.12.901]) + XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" +fi +AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) + AC_SUBST([DRI_CFLAGS]) AC_SUBST([XORG_CFLAGS]) AC_SUBST([moduledir]) diff -Nurpa -x '*~' -x '*.orig' -x '*.rej' -x '*.swp' xf86-video-sis-0.9.1/src/sis_driver.c xf86-video-sis-0.9.1/src/sis_driver.c --- xf86-video-sis-0.9.1/src/sis_driver.c 2013-04-28 15:35:31.984780782 +0300 +++ xf86-video-sis-0.9.1/src/sis_driver.c 2013-04-28 15:35:32.036781357 +0300 @@ -6015,7 +6015,11 @@ SISUnmapIOPMem(ScrnInfoPtr pScrn) if(pSiSEnt->MapCountIOPBase) { pSiSEnt->MapCountIOPBase--; if((pSiSEnt->MapCountIOPBase == 0) || (pSiSEnt->forceUnmapIOPBase)) { - xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOPBase, 2048); +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiSEnt->IOPBase, 2048); +#else + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOPBase, 2048); +#endif pSiSEnt->IOPBase = NULL; pSiSEnt->MapCountIOPBase = 0; pSiSEnt->forceUnmapIOPBase = FALSE; @@ -6024,7 +6028,11 @@ SISUnmapIOPMem(ScrnInfoPtr pScrn) } } else { #endif +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiS->IOPBase, 2048); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOPBase, 2048); +#endif pSiS->IOPBase = NULL; #ifdef SISDUALHEAD } @@ -6249,7 +6257,11 @@ SISUnmapMem(ScrnInfoPtr pScrn) if(pSiSEnt->MapCountIOBase) { pSiSEnt->MapCountIOBase--; if((pSiSEnt->MapCountIOBase == 0) || (pSiSEnt->forceUnmapIOBase)) { +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiSEnt->IOBase, (pSiS->mmioSize * 1024)); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBase, (pSiS->mmioSize * 1024)); +#endif pSiSEnt->IOBase = NULL; pSiSEnt->MapCountIOBase = 0; pSiSEnt->forceUnmapIOBase = FALSE; @@ -6260,7 +6272,11 @@ SISUnmapMem(ScrnInfoPtr pScrn) if(pSiSEnt->MapCountIOBaseDense) { pSiSEnt->MapCountIOBaseDense--; if((pSiSEnt->MapCountIOBaseDense == 0) || (pSiSEnt->forceUnmapIOBaseDense)) { +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiSEnt->IOBaseDense, (pSiS->mmioSize * 1024)); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOBaseDense, (pSiS->mmioSize * 1024)); +#endif pSiSEnt->IOBaseDense = NULL; pSiSEnt->MapCountIOBaseDense = 0; pSiSEnt->forceUnmapIOBaseDense = FALSE; @@ -6271,7 +6287,11 @@ SISUnmapMem(ScrnInfoPtr pScrn) if(pSiSEnt->MapCountFbBase) { pSiSEnt->MapCountFbBase--; if((pSiSEnt->MapCountFbBase == 0) || (pSiSEnt->forceUnmapFbBase)) { +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiSEnt->RealFbBase, pSiS->FbMapSize); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->RealFbBase, pSiS->FbMapSize); +#endif pSiSEnt->FbBase = pSiSEnt->RealFbBase = NULL; pSiSEnt->MapCountFbBase = 0; pSiSEnt->forceUnmapFbBase = FALSE; @@ -6281,13 +6301,25 @@ SISUnmapMem(ScrnInfoPtr pScrn) } } else { #endif +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiS->IOBase, (pSiS->mmioSize * 1024)); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBase, (pSiS->mmioSize * 1024)); +#endif pSiS->IOBase = NULL; #ifdef __alpha__ +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiS->IOBaseDense, (pSiS->mmioSize * 1024)); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOBaseDense, (pSiS->mmioSize * 1024)); +#endif pSiS->IOBaseDense = NULL; #endif +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(pSiS->PciInfo, (pointer)pSiS->RealFbBase, pSiS->FbMapSize); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->RealFbBase, pSiS->FbMapSize); +#endif pSiS->FbBase = pSiS->RealFbBase = NULL; #ifdef SISDUALHEAD } @@ -10941,7 +10973,13 @@ SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, #ifdef SIS_USE_BIOS_SCRATCH if(SISPTR(pScrn)->Primary) { + +#if XSERVER_LIBPCIACCESS + (void) pci_device_map_legacy(SISPTR(pScrn)->PciInfo, 0, 0x2000, 1, &base); // HA HA HA MAGIC NUMBER +#else base = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO, 0, 0x2000); +#endif + if(!base) { SISErrorLog(pScrn, "(Could not map BIOS scratch area)\n"); return ret; @@ -10954,7 +10992,11 @@ SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, *(base + offset) = value; } +#if XSERVER_LIBPCIACCESS + (void) pci_device_unmap_legacy(SISPTR(pScrn)->PciInfo, base, 0x2000); +#else xf86UnMapVidMem(pScrn->scrnIndex, base, 0x2000); +#endif } #endif return ret; diff -Nurpa -x '*~' -x '*.orig' -x '*.rej' -x '*.swp' xf86-video-sis-0.9.1/src/sis_vga.c xf86-video-sis-0.9.1/src/sis_vga.c --- xf86-video-sis-0.9.1/src/sis_vga.c 2008-11-04 15:36:22.000000000 +0200 +++ xf86-video-sis-0.9.1/src/sis_vga.c 2013-04-28 15:35:32.032781314 +0300 @@ -1740,8 +1740,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); @@ -1761,7 +1761,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