xserver-xorg-video-i128: Changes to 'upstream-unstable'
.cvsignore | 19 --------
.gitignore | 20 ++++++++
configure.ac | 16 ++++++
man/Makefile.am | 1
src/IBMRGB.h | 2
src/Makefile.am | 1
src/Ti302X.h | 2
src/i128.h | 5 +-
src/i128IBMDAC.c | 2
src/i128_driver.c | 112 +++++++++++++++++++++++++++++++----------------
src/i128accel.c | 2
src/i128dga.c | 4 -
src/i128exa.c | 1
src/i128init.c | 3 -
src/i128pcirename.h | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/i128reg.h | 2
16 files changed, 238 insertions(+), 76 deletions(-)
New commits:
commit fae990d08f50c760c3ba09fa9d949e42104ebf60
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Mar 19 14:16:19 2008 -0400
i128 1.3.0
diff --git a/configure.ac b/configure.ac
index ec371c7..350130b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-i128],
- 1.2.1,
+ 1.3.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-i128)
commit 560fc83e29f95fbed700010ce149b72d6cd21109
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Mar 19 14:15:14 2008 -0400
Fix distcheck
diff --git a/src/Makefile.am b/src/Makefile.am
index 60d1884..d7ff091 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,6 +36,7 @@ i128_drv_la_SOURCES = \
i128.h \
i128IBMDAC.c \
i128init.c \
+ i128pcirename.h \
i128reg.h \
IBMRGB.h \
Ti302X.h
commit a85f46b433a0e0508fa6dacde7d77283460bf14a
Author: Adam Jackson <ajax@redhat.com>
Date: Wed Mar 19 14:12:45 2008 -0400
Death to RCS tags.
diff --git a/src/IBMRGB.h b/src/IBMRGB.h
index 9a36565..53a2c0a 100644
--- a/src/IBMRGB.h
+++ b/src/IBMRGB.h
@@ -1,8 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h,v 1.1 2000/10/04 23:34:58 robin Exp $ */
-/* $XConsortium: $ */
#define IBMRGB_REF_FREQ_1 14.31818
#define IBMRGB_REF_FREQ_2 50.00000
diff --git a/src/Ti302X.h b/src/Ti302X.h
index a03835a..c693464 100644
--- a/src/Ti302X.h
+++ b/src/Ti302X.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h,v 1.2 2001/03/03 22:26:11 tsi Exp $ */
/*
* Copyright 1994-2000 by Robin Cutshaw <robin@XFree86.Org>
*
@@ -21,7 +20,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
-/* $XConsortium: $ */
#include "compiler.h"
diff --git a/src/i128.h b/src/i128.h
index 428539c..db647da 100644
--- a/src/i128.h
+++ b/src/i128.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v 1.5 2001/04/01 14:00:11 tsi Exp $ */
/*
* Number Nine I128 functions
*
diff --git a/src/i128IBMDAC.c b/src/i128IBMDAC.c
index 8e83e2b..4e6fd97 100644
--- a/src/i128IBMDAC.c
+++ b/src/i128IBMDAC.c
@@ -21,7 +21,6 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128IBMDAC.c,v 1.3tsi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/src/i128_driver.c b/src/i128_driver.c
index 1d67178..b9fdb15 100644
--- a/src/i128_driver.c
+++ b/src/i128_driver.c
@@ -26,7 +26,6 @@
#include "config.h"
#endif
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.34tsi Exp $ */
/* All drivers should typically include these */
diff --git a/src/i128accel.c b/src/i128accel.c
index 5b29552..4db3e8d 100644
--- a/src/i128accel.c
+++ b/src/i128accel.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128accel.c,v 1.7 2000/12/06 01:07:34 robin Exp $ */
/*
* Copyright 1997-2000 by Robin Cutshaw <robin@XFree86.Org>
diff --git a/src/i128dga.c b/src/i128dga.c
index 789a944..48823aa 100644
--- a/src/i128dga.c
+++ b/src/i128dga.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128dga.c,v 1.3tsi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/src/i128init.c b/src/i128init.c
index 52fef07..29906cf 100644
--- a/src/i128init.c
+++ b/src/i128init.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c,v 1.5 2000/11/03 00:50:53 robin Exp $ */
/*
* Copyright 1995-2000 by Robin Cutshaw <robin@XFree86.Org>
* Copyright 1998 by Number Nine Visual Technology, Inc.
@@ -27,7 +26,6 @@
#include "config.h"
#endif
-/* $XConsortium: $ */
#include "xf86.h"
diff --git a/src/i128reg.h b/src/i128reg.h
index 01e2f41..56b9c33 100644
--- a/src/i128reg.h
+++ b/src/i128reg.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h,v 1.2 2000/10/23 14:11:39 robin Exp $ */
/*
* Copyright 1994 by Robin Cutshaw <robin@XFree86.Org>
*
@@ -21,7 +20,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
-/* $XConsortium: i128reg.h /main/4 1996/05/12 20:56:19 kaleb $ */
#ifndef I128REG_H
#define I128REG_H
commit e4cfc0c48a5943e0c399f59d36a7765a92e823e7
Author: Matthieu Herrb <matthieu@bluenote.herrb.net>
Date: Sat Mar 8 23:30:44 2008 +0100
Makefile.am: nuke RCS Id
diff --git a/man/Makefile.am b/man/Makefile.am
index bf7ec17..f0eb29b 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,3 @@
-# $Id$
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
#
commit 64987900b7398943005d0a43f6b39ce3c2d1f4f1
Author: Dave Airlie <airlied@redhat.com>
Date: Fri Feb 29 16:00:53 2008 +1000
i128: fixup typo
diff --git a/src/i128dga.c b/src/i128dga.c
index e860217..789a944 100644
--- a/src/i128dga.c
+++ b/src/i128dga.c
@@ -265,7 +265,7 @@ I128_OpenFramebuffer(
int *flags
){
I128Ptr pI128 = I128PTR(pScrn);
- unsigned long FbAddress = PCI_REGION_BASE(pI128->PciInfo, 0, MEM_REGION) & 0xFFC00000;
+ unsigned long FbAddress = PCI_REGION_BASE(pI128->PciInfo, 0, REGION_MEM) & 0xFFC00000;
*name = NULL; /* no special device */
*mem = (unsigned char*)FbAddress;
commit 7273b0f586f04fe9c29ac206d5d9bf51fa92cc22
Author: Dave Airlie <airlied@redhat.com>
Date: Wed Feb 27 13:45:31 2008 +1000
i128: drop ansi C wrapper
diff --git a/src/i128IBMDAC.c b/src/i128IBMDAC.c
index 5616d71..8e83e2b 100644
--- a/src/i128IBMDAC.c
+++ b/src/i128IBMDAC.c
@@ -28,7 +28,6 @@
#endif
#include "xf86.h"
-#include "xf86_ansic.h"
#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "cursorstr.h"
diff --git a/src/i128_driver.c b/src/i128_driver.c
index f2800e2..1d67178 100644
--- a/src/i128_driver.c
+++ b/src/i128_driver.c
@@ -34,9 +34,6 @@
#include "xf86_OSproc.h"
#include "xf86Resources.h"
-/* All drivers need this */
-#include "xf86_ansic.h"
-
#include "compiler.h"
/* Drivers for PCI hardware need this */
diff --git a/src/i128accel.c b/src/i128accel.c
index da1f9af..5b29552 100644
--- a/src/i128accel.c
+++ b/src/i128accel.c
@@ -35,7 +35,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
#include "xf86Pci.h"
#include "xf86PciInfo.h"
diff --git a/src/i128dga.c b/src/i128dga.c
index d6ce301..e860217 100644
--- a/src/i128dga.c
+++ b/src/i128dga.c
@@ -6,7 +6,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
#include "xf86Pci.h"
#include "xf86PciInfo.h"
#include "xaa.h"
diff --git a/src/i128exa.c b/src/i128exa.c
index a2d6c7e..36aa78f 100644
--- a/src/i128exa.c
+++ b/src/i128exa.c
@@ -34,7 +34,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86_ansic.h"
#include "xf86Pci.h"
#include "xf86PciInfo.h"
diff --git a/src/i128init.c b/src/i128init.c
index 00ec646..52fef07 100644
--- a/src/i128init.c
+++ b/src/i128init.c
@@ -31,7 +31,6 @@
#include "xf86.h"
-#include "xf86_ansic.h"
#include "xf86PciInfo.h"
#include "xf86Pci.h"
commit 8c8779a65ff3f017f02b6024a20ba4ceb8c48e4e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed Feb 27 13:18:57 2008 +1000
i128: pciaccess conversion
diff --git a/configure.ac b/configure.ac
index 7dbb74d..ec371c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,6 +58,20 @@ PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES])
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# 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"])
+AC_CHECK_HEADER(xf1bpp.h,[AC_DEFINE(HAVE_XF1BPP, 1, [Have 1bpp support])],[])
+AC_CHECK_HEADER(xf4bpp.h,[AC_DEFINE(HAVE_XF4BPP, 1, [Have 4bpp support])],[])
+CPPFLAGS="$SAVE_CPPFLAGS"
+
+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)
# Checks for header files.
AC_HEADER_STDC
diff --git a/src/i128.h b/src/i128.h
index 24d53b8..428539c 100644
--- a/src/i128.h
+++ b/src/i128.h
@@ -12,6 +12,8 @@
#ifndef I128_H
#define I128_H
+#include "i128pcirename.h"
+
#include "compiler.h"
#include "xaa.h"
#include "exa.h"
@@ -35,7 +37,9 @@ struct source_format {
typedef struct {
EntityInfoPtr pEnt;
pciVideoPtr PciInfo;
+#ifndef XSERVER_LIBPCIACCESS
PCITAG PciTag;
+#endif
xf86AccessRec Access;
int Chipset;
int ChipRev;
diff --git a/src/i128_driver.c b/src/i128_driver.c
index 99356da..f2800e2 100644
--- a/src/i128_driver.c
+++ b/src/i128_driver.c
@@ -386,6 +386,7 @@ I128Probe(DriverPtr drv, int flags)
* All of the cards this driver supports are PCI, so the "probing" just
* amounts to checking the PCI data that the server has already collected.
*/
+#ifndef XSERVER_LIBPCIACCESS
if (xf86GetPciVideoInfo() == NULL) {
/*
* We won't let anything in the config file override finding no
@@ -393,6 +394,7 @@ I128Probe(DriverPtr drv, int flags)
*/
return FALSE;
}
+#endif
numUsed = xf86MatchPciInstances(I128_NAME, PCI_VENDOR_NUMNINE,
I128Chipsets, I128PciChipsets, devSections,
@@ -569,8 +571,10 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
/* Find the PCI info for this screen */
pI128->PciInfo = xf86GetPciInfoForEntity(pI128->pEnt->index);
+#ifndef XSERVER_LIBPCIACCESS
pI128->PciTag = pciTag(pI128->PciInfo->bus, pI128->PciInfo->device,
pI128->PciInfo->func);
+#endif
pI128->Primary = xf86IsPrimaryPci(pI128->PciInfo);
@@ -717,9 +721,9 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
* Set the Chipset and ChipRev.
*/
from = X_PROBED;
- pI128->Chipset = pI128->PciInfo->chipType;
+ pI128->Chipset = PCI_DEV_DEVICE_ID(pI128->PciInfo);
pScrn->chipset = (char *)xf86TokenToString(I128Chipsets, pI128->Chipset);
- pI128->ChipRev = pI128->PciInfo->chipRev;
+ pI128->ChipRev = PCI_DEV_REVISION(pI128->PciInfo);
/*
* This shouldn't happen because such problems should be caught in
@@ -737,15 +741,15 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
}
xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset);
- if (pI128->PciInfo->subsysVendor == 0x105D)
+ if (PCI_SUB_VENDOR_ID(pI128->PciInfo) == 0x105D)
xf86DrvMsg(pScrn->scrnIndex, from, "Subsystem Vendor: \"Number Nine\"\n");
- else if (pI128->PciInfo->subsysVendor == 0x10F0)
+ else if (PCI_SUB_VENDOR_ID(pI128->PciInfo) == 0x10F0)
xf86DrvMsg(pScrn->scrnIndex, from, "Subsystem Vendor: \"Peritek\"\n");
else
xf86DrvMsg(pScrn->scrnIndex, from, "Subsystem Vendor: \"%x\"\n",
- pI128->PciInfo->subsysVendor);
+ PCI_SUB_VENDOR_ID(pI128->PciInfo));
- iobase = (pI128->PciInfo->ioBase[5] & 0xFFFFFF00) + hwp->PIOOffset;
+ iobase = (PCI_REGION_BASE(pI128->PciInfo, 5, REGION_IO) & 0xFFFFFF00) + hwp->PIOOffset;
pI128->RegRec.iobase = iobase;
pI128->io.rbase_g = inl(iobase) & 0xFFFFFF00;
@@ -789,9 +793,18 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
else
pI128->MemoryType = I128_MEMORY_WRAM;
} else if (pI128->Chipset == PCI_CHIP_I128_2) {
+#ifndef XSERVER_LIBPCIACCESS
if (((((pciConfigPtr)pI128->PciInfo->thisCard)->pci_command & 0x03)
- == 0x03) && (pI128->PciInfo->subsysCard == 0x08))
+ == 0x03) && (PCI_SUB_DEVICE_ID(pI128->PciInfo) == 0x08))
pI128->MemoryType = I128_MEMORY_DRAM;
+#else
+ {
+ unsigned short temp;
+ pci_device_cfg_read_u16(pI128->PciInfo, &temp, 0x4);
+ if ((temp & 0x03 == 0x03) && (PCI_SUB_DEVICE_ID(pI128->PciInfo) == 0x08))
+ pI128->MemoryType = I128_MEMORY_DRAM;
+ }
+#endif
}
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Memory type %s\n",
@@ -806,10 +819,10 @@ I128PreInit(ScrnInfoPtr pScrn, int flags)
outl(pI128->RegRec.iobase + 0x20, pI128->io.config2);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Linear framebuffer at 0x%lX\n",
- (unsigned long)pI128->PciInfo->memBase[0]);
+ (unsigned long)PCI_REGION_BASE(pI128->PciInfo, 0, REGION_MEM));
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MMIO registers at 0x%lX\n",
- (unsigned long)pI128->PciInfo->ioBase[5]);
+ (unsigned long)PCI_REGION_BASE(pI128->PciInfo, 5, REGION_IO));
if (xf86RegisterResources(pI128->pEnt->index, NULL, ResExclusive)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -1288,7 +1301,7 @@ I128CountRam(ScrnInfoPtr pScrn)
switch(pI128->Chipset) {
case PCI_CHIP_I128_T2R4:
/* Use the subsystem ID to determine the memory size */
- switch ((pI128->PciInfo->subsysCard) & 0x0007) {
+ switch ((PCI_SUB_DEVICE_ID(pI128->PciInfo)) & 0x0007) {
case 0x00: /* 4MB card */
SizeFound = 4 * 1024; break;
case 0x01: /* 8MB card */
@@ -1310,7 +1323,7 @@ I128CountRam(ScrnInfoPtr pScrn)
}
break;
case PCI_CHIP_I128_T2R:
- switch ((pI128->PciInfo->subsysCard) & 0xFFF7) {
+ switch ((PCI_SUB_DEVICE_ID(pI128->PciInfo)) & 0xFFF7) {
case 0x00: /* 4MB card, no daughtercard */
SizeFound = 4 * 1024; break;
case 0x01: /* 4MB card, 4MB daughtercard */
@@ -1360,22 +1373,49 @@ I128MapMem(ScrnInfoPtr pScrn)
/*
* Map IO registers to virtual address space
*/
-
+#ifndef XSERVER_LIBPCIACCESS
pI128->mem.mw0_ad = (unsigned char *)xf86MapPciMem(pScrn->scrnIndex,
VIDMEM_FRAMEBUFFER,
pI128->PciTag,
pI128->PciInfo->memBase[0] & 0xFFC00000,
pI128->MemorySize*1024);
+#else
+ {
+ void** result = (void**)&pI128->mem.mw0_ad;
+ int err = pci_device_map_range(pI128->PciInfo,
+ PCI_REGION_BASE(pI128->PciInfo, 0, REGION_MEM) & 0xffc00000,
+ pI128->MemorySize * 1024,
+ PCI_DEV_MAP_FLAG_WRITABLE |
+ PCI_DEV_MAP_FLAG_WRITE_COMBINE,
+ result);
+ if (err)
+ return FALSE;
+ }
+#endif
+
if (pI128->mem.mw0_ad == NULL)
return FALSE;
pI128->MemoryPtr = pI128->mem.mw0_ad;
+#ifndef XSERVER_LIBPCIACCESS
pI128->mem.rbase_g = (CARD32 *)xf86MapPciMem(pScrn->scrnIndex,
VIDMEM_MMIO | VIDMEM_MMIO_32BIT,
pI128->PciTag,
pI128->PciInfo->memBase[4] & 0xFFFF0000,
64*1024);
+#else
+ {
+ void** result = (void**)&pI128->mem.rbase_g;
+ int err = pci_device_map_range(pI128->PciInfo,
+ PCI_REGION_BASE(pI128->PciInfo, 4, REGION_MEM) & 0xffff0000,
+ 64 * 1024,
+ PCI_DEV_MAP_FLAG_WRITABLE,
+ result);
+ if (err)
+ return FALSE;
+ }
+#endif
if (pI128->mem.rbase_g == NULL)
return FALSE;
@@ -2069,38 +2109,39 @@ I128DumpBaseRegisters(ScrnInfoPtr pScrn)
" PCI Registers\n");
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" MW0_AD 0x%08lx addr 0x%08lx %spre-fetchable\n",
- pI128->PciInfo->memBase[0],
- pI128->PciInfo->memBase[0] & 0xFFC00000,
- pI128->PciInfo->memBase[0] & 0x8 ? "" : "not-");
+ PCI_REGION_BASE(pI128->PciInfo, 0, REGION_MEM),
+ PCI_REGION_BASE(pI128->PciInfo, 0, REGION_MEM) & 0xFFC00000,
+ PCI_REGION_BASE(pI128->PciInfo, 0, REGION_MEM) & 0x8 ? "" : "not-");
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" MW1_AD 0x%08lx addr 0x%08lx %spre-fetchable\n",
- pI128->PciInfo->memBase[1],
- pI128->PciInfo->memBase[1] & 0xFFC00000,
- pI128->PciInfo->memBase[1] & 0x8 ? "" : "not-");
+ PCI_REGION_BASE(pI128->PciInfo, 1, REGION_MEM),
+ PCI_REGION_BASE(pI128->PciInfo, 1, REGION_MEM) & 0xFFC00000,
+ PCI_REGION_BASE(pI128->PciInfo, 1, REGION_MEM) & 0x8 ? "" : "not-");
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" XYW_AD(A) 0x%08lx addr 0x%08lx\n",
- pI128->PciInfo->memBase[2],
- pI128->PciInfo->memBase[2] & 0xFFC00000);
+ PCI_REGION_BASE(pI128->PciInfo, 2, REGION_MEM),
+ PCI_REGION_BASE(pI128->PciInfo, 2, REGION_MEM) & 0xFFC00000);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" XYW_AD(B) 0x%08lx addr 0x%08lx\n",
- pI128->PciInfo->memBase[3],
- pI128->PciInfo->memBase[3] & 0xFFC00000);
+ PCI_REGION_BASE(pI128->PciInfo, 3, REGION_MEM),
+ PCI_REGION_BASE(pI128->PciInfo, 3, REGION_MEM) & 0xFFC00000);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" RBASE_G 0x%08lx addr 0x%08lx\n",
- pI128->PciInfo->memBase[4],
- pI128->PciInfo->memBase[4] & 0xFFFF0000);
+ PCI_REGION_BASE(pI128->PciInfo, 4, REGION_MEM),
+ PCI_REGION_BASE(pI128->PciInfo, 4, REGION_MEM) & 0xFFFF0000);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" IO 0x%08lx addr 0x%08lx\n",
- pI128->PciInfo->ioBase[5],
- pI128->PciInfo->ioBase[5] & 0xFFFFFF00);
+ PCI_REGION_BASE(pI128->PciInfo, 5, REGION_IO),
+ PCI_REGION_BASE(pI128->PciInfo, 5, REGION_IO) & 0xFFFFFF00);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" SSC 0x%08x addr 0x%08x\n",
- pI128->PciInfo->subsysCard,
- pI128->PciInfo->subsysCard & 0xFFFFFF00);
+ PCI_SUB_DEVICE_ID(pI128->PciInfo),
+ PCI_SUB_DEVICE_ID(pI128->PciInfo) & 0xFFFFFF00);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" SSV 0x%08x addr 0x%08x\n",
- pI128->PciInfo->subsysVendor,
- pI128->PciInfo->subsysVendor & 0xFFFFFF00);
+ PCI_SUB_VENDOR_ID(pI128->PciInfo),
+ PCI_SUB_VENDOR_ID(pI128->PciInfo) & 0xFFFFFF00);
+#ifndef XSERVER_LIBPCIACCESS
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" RBASE_E 0x%08lx addr 0x%08lx %sdecode-enabled\n\n",
pI128->PciInfo->biosBase,
@@ -2111,6 +2152,7 @@ I128DumpBaseRegisters(ScrnInfoPtr pScrn)
" PCICMDST 0x%08x 0x%08x\n",
((pciConfigPtr)pI128->PciInfo->thisCard)->pci_command,
((pciConfigPtr)pI128->PciInfo->thisCard)->pci_status);
+#endif
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
" IO Mapped Registers\n");
diff --git a/src/i128dga.c b/src/i128dga.c
index 1ceae5f..d6ce301 100644
--- a/src/i128dga.c
+++ b/src/i128dga.c
@@ -266,7 +266,7 @@ I128_OpenFramebuffer(
int *flags
){
I128Ptr pI128 = I128PTR(pScrn);
- unsigned long FbAddress = pI128->PciInfo->memBase[0] & 0xFFC00000;
+ unsigned long FbAddress = PCI_REGION_BASE(pI128->PciInfo, 0, MEM_REGION) & 0xFFC00000;
*name = NULL; /* no special device */
*mem = (unsigned char*)FbAddress;
diff --git a/src/i128pcirename.h b/src/i128pcirename.h
new file mode 100644
index 0000000..f0f5cf8
--- /dev/null
+++ b/src/i128pcirename.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2007 George Sapountzis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Macros for porting drivers from legacy xfree86 PCI code to the pciaccess
+ * library. The main purpose being to facilitate source code compatibility.
+ */
+
+#ifndef CIRPCIRENAME_H
+#define CIRPCIRENAME_H
+
+enum region_type {
+ REGION_MEM,
+ REGION_IO
+};
+
+#ifndef XSERVER_LIBPCIACCESS
+
+/* pciVideoPtr */
+#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor)
+#define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->chipType)
+#define PCI_DEV_REVISION(_pcidev) ((_pcidev)->chipRev)
+
+#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subsysVendor)
+#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subsysCard)
+
+#define PCI_DEV_TAG(_pcidev) pciTag((_pcidev)->bus, \
+ (_pcidev)->device, \
+ (_pcidev)->func)
+#define PCI_DEV_BUS(_pcidev) ((_pcidev)->bus)
+#define PCI_DEV_DEV(_pcidev) ((_pcidev)->device)
+#define PCI_DEV_FUNC(_pcidev) ((_pcidev)->func)
+
+/* pciConfigPtr */
+#define PCI_CFG_TAG(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->tag)
+#define PCI_CFG_BUS(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->busnum)
+#define PCI_CFG_DEV(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->devnum)
+#define PCI_CFG_FUNC(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->funcnum)
+
+/* region addr: xfree86 uses different fields for memory regions and I/O ports */
+#define PCI_REGION_BASE(_pcidev, _b, _type) \
+ (((_type) == REGION_MEM) ? (_pcidev)->memBase[(_b)] \
+ : (_pcidev)->ioBase[(_b)])
+
+/* region size: xfree86 uses the log2 of the region size,
+ * but with zero meaning no region, not size of one XXX */
+#define PCI_REGION_SIZE(_pcidev, _b) \
+ (((_pcidev)->size[(_b)] > 0) ? (1 << (_pcidev)->size[(_b)]) : 0)
+
+/* read/write PCI configuration space */
+#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \
+ *(_value_ptr) = pciReadByte(PCI_CFG_TAG(_pcidev), (_offset))
+
+#define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \
+ *(_value_ptr) = pciReadLong(PCI_CFG_TAG(_pcidev), (_offset))
+
+#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
+ pciWriteLong(PCI_CFG_TAG(_pcidev), (_offset), (_value))
+
+#else /* XSERVER_LIBPCIACCESS */
+
+typedef struct pci_device *pciVideoPtr;
+
+#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor_id)
+#define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->device_id)
+#define PCI_DEV_REVISION(_pcidev) ((_pcidev)->revision)
+
+#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subvendor_id)
+#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subdevice_id)
+
+/* pci-rework functions take a 'pci_device' parameter instead of a tag */
+#define PCI_DEV_TAG(_pcidev) (_pcidev)
+
+/* PCI_DEV macros, typically used in printf's, add domain ? XXX */
+#define PCI_DEV_BUS(_pcidev) ((_pcidev)->bus)
+#define PCI_DEV_DEV(_pcidev) ((_pcidev)->dev)
+#define PCI_DEV_FUNC(_pcidev) ((_pcidev)->func)
+
+/* pci-rework functions take a 'pci_device' parameter instead of a tag */
+#define PCI_CFG_TAG(_pcidev) (_pcidev)
+
+/* PCI_CFG macros, typically used in DRI init, contain the domain */
+#define PCI_CFG_BUS(_pcidev) (((_pcidev)->domain << 8) | \
+ (_pcidev)->bus)
+#define PCI_CFG_DEV(_pcidev) ((_pcidev)->dev)
+#define PCI_CFG_FUNC(_pcidev) ((_pcidev)->func)
+
+#define PCI_REGION_BASE(_pcidev, _b, _type) ((_pcidev)->regions[(_b)].base_addr)
+#define PCI_REGION_SIZE(_pcidev, _b) ((_pcidev)->regions[(_b)].size)
+
+#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \
+ pci_device_cfg_read_u8((_pcidev), (_value_ptr), (_offset))
+
+#define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \
+ pci_device_cfg_read_u32((_pcidev), (_value_ptr), (_offset))
+
+#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
+ pci_device_cfg_write_u32((_pcidev), (_value), (_offset))
+
+#endif /* XSERVER_LIBPCIACCESS */
+
+#endif /* CIRPCIRENAME_H */
commit 6b837746d1652150c0ed4d61442a975cf687f624
Author: Brice Goglin <bgoglin@debian.org>
Date: Tue Aug 7 11:26:28 2007 +0200
Define I128_*_VERSION* using PACKAGE_VERSION_*
diff --git a/src/i128_driver.c b/src/i128_driver.c
index f86fc92..99356da 100644
--- a/src/i128_driver.c
+++ b/src/i128_driver.c
@@ -116,9 +116,9 @@ static unsigned int I128DDC1Read(ScrnInfoPtr pScrn);
#define I128_VERSION 4000
#define I128_NAME "I128"
#define I128_DRIVER_NAME "i128"
-#define I128_MAJOR_VERSION 1
-#define I128_MINOR_VERSION 2
-#define I128_PATCHLEVEL 1
+#define I128_MAJOR_VERSION PACKAGE_VERSION_MAJOR
+#define I128_MINOR_VERSION PACKAGE_VERSION_MINOR
+#define I128_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
/*
* This contains the functions needed by the server after loading the
commit e639c549b13dca121e7e4af2ce62afd84e44e044
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Tue Feb 27 10:29:16 2007 -0800
renamed: .cvsignore -> .gitignore
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index fb1befd..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,19 +0,0 @@
-Makefile
-Makefile.in
-*.la
-*.lo
-aclocal.m4
-autom4te.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-depcomp
-install-sh
-libtool
-ltmain.sh
-missing
-stamp-h1
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2df4a8d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,20 @@
+Makefile
+Makefile.in
+*.la
+*.lo
+aclocal.m4
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+stamp-h1
+*~
Reply to: