diff --git a/configure.ac b/configure.ac index 62cc318..8458c06 100644 --- a/configure.ac +++ b/configure.ac @@ -20,46 +20,46 @@ # # Process this file with autoconf to produce a configure script -AC_PREREQ(2.57) +# Initialize Autoconf +AC_PREREQ([2.60]) AC_INIT([xf86-video-tseng], - 1.2.4, + [1.2.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], - xf86-video-tseng) - + [xf86-video-tseng]) AC_CONFIG_SRCDIR([Makefile.am]) -AM_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR(.) +# Initialize Automake AM_INIT_AUTOMAKE([foreign dist-bzip2]) - AM_MAINTAINER_MODE -# Require xorg-macros: XORG_DEFAULT_OPTIONS +# 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.3 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.3) + [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. +# Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL -AC_PROG_CC AH_TOP([#include "xorg-server.h"]) +# Define a configure option for an alternate module directory AC_ARG_WITH(xorg-module-dir, - AC_HELP_STRING([--with-xorg-module-dir=DIR], + AS_HELP_STRING([--with-xorg-module-dir=DIR], [Default xorg module directory [[default=$libdir/xorg/modules]]]), [moduledir="$withval"], [moduledir="$libdir/xorg/modules"]) -# Checks for extensions +# Store the list of server defined optional extensions in REQUIRED_MODULES XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(RENDER, renderproto) XORG_DRIVER_CHECK_EXT(XV, videoproto) XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) -# Checks for pkg-config packages +# Obtain compiler/linker options for the driver dependencies PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES]) # Checks for libraries. @@ -78,17 +78,14 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then fi AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) -# Checks for header files. -AC_HEADER_STDC - -AC_SUBST([XORG_CFLAGS]) AC_SUBST([moduledir]) DRIVER_NAME=tseng AC_SUBST([DRIVER_NAME]) -AC_OUTPUT([ - Makefile - src/Makefile - man/Makefile +AC_CONFIG_FILES([ + Makefile + src/Makefile + man/Makefile ]) +AC_OUTPUT diff --git a/man/Makefile.am b/man/Makefile.am index 8f2454b..b3688ce 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -31,25 +31,11 @@ EXTRA_DIST = @DRIVER_NAME@.man CLEANFILES = $(driverman_DATA) -SED = sed - -# Strings to replace in man pages -XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 - -MAN_SUBSTS = \ - -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ - -e 's|__xservername__|Xorg|g' \ - -e 's|__xconfigfile__|xorg.conf|g' \ - -e 's|__projectroot__|$(prefix)|g' \ - -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ - -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ - -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ - -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ - -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure + SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man .man.$(DRIVER_MAN_SUFFIX): - sed $(MAN_SUBSTS) < $< > $@ + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ diff --git a/man/tseng.man b/man/tseng.man index 403782f..984c8e7 100644 --- a/man/tseng.man +++ b/man/tseng.man @@ -1,4 +1,3 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.man,v 1.2 2001/01/27 18:20:55 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH TSENG __drivermansuffix__ __vendorversion__ diff --git a/src/tseng_cursor.c b/src/tseng_cursor.c index d4fb847..2412b31 100644 --- a/src/tseng_cursor.c +++ b/src/tseng_cursor.c @@ -159,7 +159,7 @@ TsengSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) } } -void +static void TsengLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits) { vgaHWPtr hwp = VGAHWPTR(pScrn); diff --git a/src/tseng_dga.c b/src/tseng_dga.c index 70ebe23..528ba4c 100644 --- a/src/tseng_dga.c +++ b/src/tseng_dga.c @@ -74,9 +74,9 @@ TsengDGAInit(ScreenPtr pScreen) if (!pTseng->DGAnumModes) { pMode = firstMode = pScrn->modes; while (pMode) { - newmodes = xrealloc(modes, (num + 1) * sizeof (DGAModeRec)); + newmodes = realloc(modes, (num + 1) * sizeof (DGAModeRec)); if (!newmodes) { - xfree(modes); + free(modes); return FALSE; } modes = newmodes; @@ -135,7 +135,7 @@ Tseng_OpenFramebuffer( TsengPtr pTseng = TsengPTR(pScrn); *name = NULL; /* no special device */ - *mem = (unsigned char*)pTseng->FbAddress; + *mem = (unsigned char*)(uintptr_t)pTseng->FbAddress; *size = pTseng->FbMapSize; *offset = 0; /* Always */ *flags = 0; /* Root permissions OS-dependent */ diff --git a/src/tseng_driver.c b/src/tseng_driver.c index 445c17e..d36b62c 100644 --- a/src/tseng_driver.c +++ b/src/tseng_driver.c @@ -269,9 +269,9 @@ TsengFreeRec(ScrnInfoPtr pScrn) pTseng = TsengPTR(pScrn); if (pTseng->SavedReg.RAMDAC) - xfree(pTseng->SavedReg.RAMDAC); + free(pTseng->SavedReg.RAMDAC); - xfree(pScrn->driverPrivate); + free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } @@ -395,10 +395,10 @@ TsengProbe(DriverPtr drv, int flags) foundScreen = TRUE; } } - xfree(usedChips); + free(usedChips); } - xfree(devSections); + free(devSections); return foundScreen; } @@ -806,7 +806,7 @@ TsengProcessOptions(ScrnInfoPtr pScrn) xf86CollectOptions(pScrn, NULL); /* Process the options */ - if (!(pTseng->Options = xalloc(sizeof(TsengOptions)))) + if (!(pTseng->Options = malloc(sizeof(TsengOptions)))) return FALSE; memcpy(pTseng->Options, TsengOptions, sizeof(TsengOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTseng->Options); @@ -883,7 +883,7 @@ TsengGetFbAddress(ScrnInfoPtr pScrn) PDEBUG(" TsengGetFbAddress\n"); /* base0 is the framebuffer and base1 is the PCI IO space. */ - if (PCI_REGION_BASE(pTseng->PciInfo, 0, REGION_MEM)) { + if (!PCI_REGION_BASE(pTseng->PciInfo, 0, REGION_MEM)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid Framebuffer address in PCI config space;\n"); return FALSE; diff --git a/src/tseng_mode.c b/src/tseng_mode.c index f075226..a3ff87d 100644 --- a/src/tseng_mode.c +++ b/src/tseng_mode.c @@ -41,7 +41,11 @@ vgaHWWriteBank(vgaHWPtr hwp, CARD8 value) if (hwp->MMIOBase) MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + VGA_BANK, value); else +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 outb(hwp->PIOOffset + VGA_BANK, value); +#else + pci_io_write8(hwp->io, VGA_BANK, value); +#endif } CARD8 @@ -50,7 +54,11 @@ vgaHWReadBank(vgaHWPtr hwp) if (hwp->MMIOBase) return MMIO_IN8(hwp->MMIOBase, hwp->MMIOOffset + VGA_BANK); else +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 return inb(hwp->PIOOffset + VGA_BANK); +#else + return pci_io_read8(hwp->io, VGA_BANK); +#endif } #define VGA_SEGMENT 0x3CD @@ -61,7 +69,11 @@ vgaHWWriteSegment(vgaHWPtr hwp, CARD8 value) if (hwp->MMIOBase) MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + VGA_SEGMENT, value); else +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 outb(hwp->PIOOffset + VGA_SEGMENT, value); +#else + pci_io_write8(hwp->io, VGA_SEGMENT, value); +#endif } CARD8 @@ -70,7 +82,11 @@ vgaHWReadSegment(vgaHWPtr hwp) if (hwp->MMIOBase) return MMIO_IN8(hwp->MMIOBase, hwp->MMIOOffset + VGA_SEGMENT); else +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 return inb(hwp->PIOOffset + VGA_SEGMENT); +#else + return pci_io_read8(hwp->io, VGA_SEGMENT); +#endif } /* @@ -84,8 +100,12 @@ vgaHWWriteModeControl(vgaHWPtr hwp, CARD8 value) if (hwp->MMIOBase) MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + hwp->IOBase + VGA_MODE_CONTROL, value); - else - outb(hwp->IOBase + hwp->PIOOffset + VGA_MODE_CONTROL, value); + else +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 + outb(hwp->PIOOffset + VGA_MODE_CONTROL, value); +#else + pci_io_write8(hwp->io, VGA_MODE_CONTROL, value); +#endif } /* @@ -110,14 +130,22 @@ vgaHWHerculesSecondPage(vgaHWPtr hwp, Bool Enable) MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + VGA_HERCULES, tmp); } else { - tmp = inb(hwp->PIOOffset + VGA_HERCULES); +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 + tmp = inb(hwp->PIOOffset + VGA_HERCULES); +#else + tmp = pci_io_read8(hwp->io, VGA_HERCULES); +#endif if (Enable) tmp |= 0x02; else tmp &= ~0x02; - outb(hwp->PIOOffset + VGA_HERCULES, tmp); +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12 + outb(hwp->PIOOffset + VGA_HERCULES, tmp); +#else + pci_io_write8(hwp->io, VGA_HERCULES, tmp); +#endif } } @@ -1502,7 +1530,7 @@ TsengModeInit(ScrnInfoPtr pScrn, DisplayModePtr OrigMode) /* clean up */ if (new->RAMDAC) - xfree(new->RAMDAC); + free(new->RAMDAC); return TRUE; }