diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-08-23 17:08:45 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-08-23 17:08:45 +0000 |
commit | efd1e439a38ba743fa9d49db78863aeb87797cec (patch) | |
tree | dcea241b0ea0a67be975e8f1927b9fd060582d0c /driver/xf86-video-ark | |
parent | e8f5db561fc7f2cf2a05226bb112ce6c41125bb5 (diff) |
xf86-video-ark 0.7.0
Diffstat (limited to 'driver/xf86-video-ark')
-rw-r--r-- | driver/xf86-video-ark/configure.ac | 15 | ||||
-rw-r--r-- | driver/xf86-video-ark/src/ark.h | 13 | ||||
-rw-r--r-- | driver/xf86-video-ark/src/ark_accel.c | 1 | ||||
-rw-r--r-- | driver/xf86-video-ark/src/ark_driver.c | 39 | ||||
-rw-r--r-- | driver/xf86-video-ark/src/ark_reg.h | 1 |
5 files changed, 58 insertions, 11 deletions
diff --git a/driver/xf86-video-ark/configure.ac b/driver/xf86-video-ark/configure.ac index 87a7472f1..987ae70ff 100644 --- a/driver/xf86-video-ark/configure.ac +++ b/driver/xf86-video-ark/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-ark], - 0.6.0, + 0.7.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-ark) @@ -62,10 +62,23 @@ AC_SUBST([CFLAGS]) AC_SUBST([INCLUDES]) # Checks for libraries. +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" # Checks for header files. AC_HEADER_STDC +if test "x$XSERVER_LIBPCIACCESS" = xyes; then + PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) + XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" +fi +AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) + + DRIVER_NAME=ark AC_SUBST([DRIVER_NAME]) diff --git a/driver/xf86-video-ark/src/ark.h b/driver/xf86-video-ark/src/ark.h index 0219c5c99..de301dcbc 100644 --- a/driver/xf86-video-ark/src/ark.h +++ b/driver/xf86-video-ark/src/ark.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark.h,v 1.2 2001/01/29 15:15:44 keithp Exp $ */ /* * ark */ @@ -27,8 +26,12 @@ typedef struct _ARKRegRec { typedef struct _ARKRec { +#ifndef XSERVER_LIBPCIACCESS pciVideoPtr PciInfo; PCITAG PciTag; +#else + struct pci_device *PciInfo; +#endif EntityInfoPtr pEnt; CARD32 IOAddress; CARD32 FBAddress; @@ -55,10 +58,10 @@ typedef struct _ARKRec { #define DRIVER_NAME "ark" -#define DRIVER_VERSION "0.6.0" -#define VERSION_MAJOR 0 -#define VERSION_MINOR 6 -#define PATCHLEVEL 0 +#define DRIVER_VERSION PACKAGE_VERSION +#define VERSION_MAJOR PACKAGE_VERSION_MAJOR +#define VERSION_MINOR PACKAGE_VERSION_MINOR +#define PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL #define ARK_VERSION ((VERSION_MAJOR << 24) | \ (VERSION_MINOR << 16) | \ PATCHLEVEL) diff --git a/driver/xf86-video-ark/src/ark_accel.c b/driver/xf86-video-ark/src/ark_accel.c index 315226d4a..8963e1632 100644 --- a/driver/xf86-video-ark/src/ark_accel.c +++ b/driver/xf86-video-ark/src/ark_accel.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c,v 1.6 2002/01/25 21:55:56 tsi Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> * diff --git a/driver/xf86-video-ark/src/ark_driver.c b/driver/xf86-video-ark/src/ark_driver.c index e5ee7e56d..9b0f79783 100644 --- a/driver/xf86-video-ark/src/ark_driver.c +++ b/driver/xf86-video-ark/src/ark_driver.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.22 2003/08/23 15:02:53 dawes Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> * @@ -366,7 +365,11 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", pARK->Chipset); } else { +#ifndef XSERVER_LIBPCIACCESS pARK->Chipset = pARK->PciInfo->chipType; +#else + pARK->Chipset = pARK->PciInfo->device_id; +#endif pScrn->chipset = (char *)xf86TokenToString(ARKChipsets, pARK->Chipset); } @@ -375,15 +378,21 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags) pARK->ChipRev = pEnt->device->chipRev; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", pARK->ChipRev); - } else + } else { +#ifndef XSERVER_LIBPCIACCESS pARK->ChipRev = pARK->PciInfo->chipRev; - +#else + pARK->ChipRev = pARK->PciInfo->revision; +#endif + } xfree(pEnt); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); +#ifndef XSERVER_LIBPCIACCESS pARK->PciTag = pciTag(pARK->PciInfo->bus, pARK->PciInfo->device, pARK->PciInfo->func); +#endif /* unlock CRTC[0-7] */ outb(hwp->PIOOffset + hwp->IOBase + 4, 0x11); @@ -1048,12 +1057,32 @@ static Bool ARKMapMem(ScrnInfoPtr pScrn) /* extended to cover MMIO space at 0xB8000 */ hwp->MapSize = 0x20000; +#ifndef XSERVER_LIBPCIACCESS pARK->MMIOBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO, pARK->PciTag, 0xb8000, 0x8000); pARK->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, pARK->PciTag, pARK->FBAddress, pScrn->videoRam * 1024); +#else + + pARK->MMIOBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO, + pARK->PciInfo, 0xb8000, 0x8000); + + { + void** result = (void**)&pARK->FBBase; + int err = pci_device_map_range(pARK->PciInfo, + pARK->FBAddress, + pScrn->videoRam * 1024, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, + result); + + if (err) + return FALSE; + } +#endif + if (!pARK->FBBase) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cound not map framebuffer\n"); @@ -1071,8 +1100,12 @@ static void ARKUnmapMem(ScrnInfoPtr pScrn) /* XXX vgaHWMapMem() isn't called explicitly, so is this correct? */ vgaHWUnmapMem(pScrn); +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pARK->FBBase, pScrn->videoRam * 1024); +#else + pci_device_unmap_range(pARK->PciInfo, pARK->FBBase, pScrn->videoRam * 1024); +#endif } diff --git a/driver/xf86-video-ark/src/ark_reg.h b/driver/xf86-video-ark/src/ark_reg.h index 727dbdf5b..f7732447a 100644 --- a/driver/xf86-video-ark/src/ark_reg.h +++ b/driver/xf86-video-ark/src/ark_reg.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_reg.h,v 1.1 2000/11/14 17:28:13 dawes Exp $ */ #ifndef _ARK_REG_H #define _ARK_REG_H |