.cvsignore | 19 ------- .gitignore | 20 ++++++++ configure.ac | 17 ++++++ man/Makefile.am | 1 src/Makefile.am | 1 src/voodoo.h | 1 src/voodoo_driver.c | 42 ++++++++++++++-- src/voodoo_hardware.c | 9 ++- src/voodoo_pcirename.h | 122 +++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 200 insertions(+), 32 deletions(-)
New commits: commit 7ff6addc069e46060fb0cc8bb8d015d34c90533e Author: Adam Jackson <[EMAIL PROTECTED]> Date: Wed Mar 19 17:09:04 2008 -0400 voodoo 1.2.0 diff --git a/configure.ac b/configure.ac index 1f7e09e..b7cc28c 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-voodoo], - 1.1.1, + 1.2.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-voodoo) commit b5b0845ed8ef7a2fa2e771961c1155f32258392e Author: Adam Jackson <[EMAIL PROTECTED]> Date: Wed Mar 19 17:07:12 2008 -0400 Death to RCS tags. diff --git a/src/voodoo_driver.c b/src/voodoo_driver.c index 7bb15e8..5ad741e 100644 --- a/src/voodoo_driver.c +++ b/src/voodoo_driver.c @@ -39,7 +39,6 @@ * ANY KIND OR FORM. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/voodoo/voodoo_driver.c,v 1.27 2001/08/07 07:04:46 keithp Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" commit 8d0a15ff1ee1153175e6049b9cebea0c4f14dd2c Author: Adam Jackson <[EMAIL PROTECTED]> Date: Wed Mar 19 17:07:10 2008 -0400 Fix distcheck diff --git a/src/Makefile.am b/src/Makefile.am index b3a34f9..5eb704e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,4 +32,5 @@ voodoo_drv_la_SOURCES = \ voodoo_dga.c \ voodoo_driver.c \ voodoo.h \ + voodoo_pcirename.h \ voodoo_hardware.c commit 51b6eec500f23e4c9a012a1ab4fe9b4012bc3703 Author: Dave Airlie <[EMAIL PROTECTED]> Date: Mon Mar 10 15:21:01 2008 +1000 voodoo: finish pciaccess conversion thanks to pcpa for pointing these out diff --git a/src/voodoo_driver.c b/src/voodoo_driver.c index a70b389..7bb15e8 100644 --- a/src/voodoo_driver.c +++ b/src/voodoo_driver.c @@ -265,7 +265,10 @@ VoodooProbe(DriverPtr drv, int flags) } /* PCI BUS */ - if (xf86GetPciVideoInfo() ) { +#ifndef XSERVER_LIBPCIACCESS + if (xf86GetPciVideoInfo() ) +#endif + { numUsed = xf86MatchPciInstances(VOODOO_NAME, PCI_VENDOR_3DFX, VoodooChipsets, VoodooPCIChipsets, devSections,numDevSections, diff --git a/src/voodoo_hardware.c b/src/voodoo_hardware.c index c943ab4..82efaf3 100644 --- a/src/voodoo_hardware.c +++ b/src/voodoo_hardware.c @@ -145,12 +145,13 @@ static void wait_idle(VoodooPtr pVoo) static void pci_enable(VoodooPtr pVoo, int wr, int dac, int fifo) { - CARD32 x = pciReadLong(pVoo->PciTag, 0x40); + CARD32 x; + PCI_READ_LONG(pVoo->PciInfo, &x, 0x40); x &= ~7; x |= wr; x |= fifo<<1; x |= dac<<2; - pciWriteLong(pVoo->PciTag, 0x40, x); + PCI_WRITE_LONG(pVoo->PciInfo, x, 0x40); } /* @@ -160,9 +161,9 @@ static void pci_enable(VoodooPtr pVoo, int wr, int dac, int fifo) static void vclock_enable(VoodooPtr pVoo, int enable) { if(enable) - pciWriteLong(pVoo->PciTag, 0xC0, 0); + PCI_WRITE_LONG(pVoo->PciInfo, 0, 0xc0); else - pciWriteLong(pVoo->PciTag, 0xE0, 0); + PCI_WRITE_LONG(pVoo->PciInfo, 0, 0xe0); } /* commit 5d60be68f07479e54b2efeea31e82f858f0d116b Author: Matthieu Herrb <[EMAIL PROTECTED]> Date: Sun Mar 9 00:10:07 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 2a2703732fb045f2f87d80eb56c8d9c1a58031f2 Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed Feb 27 14:09:59 2008 +1000 oops forgot pcirename file diff --git a/src/voodoo_pcirename.h b/src/voodoo_pcirename.h new file mode 100644 index 0000000..c93988a --- /dev/null +++ b/src/voodoo_pcirename.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 TRIDENTPCIRENAME_H +#define TRIDENTPCIRENAME_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 /* TRIDENTPCIRENAME_H */ commit a24db8c2967b4ff9039712488a1748cc47b50bae Author: Dave Airlie <[EMAIL PROTECTED]> Date: Wed Feb 27 13:54:43 2008 +1000 pciaccess conversion diff --git a/configure.ac b/configure.ac index 5c9d152..1f7e09e 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,21 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server) # Checks for libraries. # Checks for header files. +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) + AC_HEADER_STDC AC_SUBST([XORG_CFLAGS]) diff --git a/src/voodoo.h b/src/voodoo.h index 8aa0435..750c42b 100644 --- a/src/voodoo.h +++ b/src/voodoo.h @@ -1,3 +1,4 @@ +#include "voodoo_pcirename.h" #include <string.h> typedef struct { diff --git a/src/voodoo_driver.c b/src/voodoo_driver.c index f4dcd96..a70b389 100644 --- a/src/voodoo_driver.c +++ b/src/voodoo_driver.c @@ -400,8 +400,9 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags) pVoo->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); pVoo->PciInfo = xf86GetPciInfoForEntity(pVoo->pEnt->index); +#ifndef XSERVER_LIBPCIACCESS pVoo->PciTag = pciTag(pVoo->PciInfo->bus, pVoo->PciInfo->device, pVoo->PciInfo->func); - +#endif /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); @@ -446,13 +447,38 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags) } /* MMIO at 0 , FB at 4Mb, Texture at 8Mb */ + pVoo->PhysBase = PCI_REGION_BASE(pVoo->PciInfo, 0, REGION_MEM) + 0x400000; + +#ifndef XSERVER_LIBPCIACCESS pVoo->MMIO = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVoo->PciTag, - pVoo->PciInfo->memBase[0], 0x400000); + pVoo->PciInfo->memBase[0], 0x400000); pVoo->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVoo->PciTag, - pVoo->PciInfo->memBase[0] + 0x400000, 0x400000); - - pVoo->PhysBase = pVoo->PciInfo->memBase[0] + 0x400000; + pVoo->PciInfo->memBase[0] + 0x400000, 0x400000); +#else + { + void** result = (void**)&pVoo->MMIO; + int err = pci_device_map_range(pVoo->PciInfo, + PCI_REGION_BASE(pVoo->PciInfo, 0, REGION_MEM), + 0x400000, + PCI_DEV_MAP_FLAG_WRITABLE, + result); + if (err) + return FALSE; + } + + { + void** result = (void**)&pVoo->FBBase; + int err = pci_device_map_range(pVoo->PciInfo, + PCI_REGION_BASE(pVoo->PciInfo, 0, REGION_MEM) + 0x400000, + 0x400000, + PCI_DEV_MAP_FLAG_WRITABLE| + PCI_DEV_MAP_FLAG_WRITE_COMBINE, + result); + if (err) + return FALSE; + } +#endif VoodooHardwareInit(pVoo); /* commit b6b34bf93deaf37c032c27cd863a1f6981747451 Author: Alan Coopersmith <[EMAIL PROTECTED]> Date: Thu Mar 1 11:11:53 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 +*~ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]