.cvsignore | 19 ------ .gitignore | 20 +++++++ configure.ac | 15 +++++ man/Makefile.am | 1 man/s3virge.man | 6 +- src/Makefile.am | 1 src/newmmio.h | 1 src/regs3v.h | 1 src/s3v.h | 3 - src/s3v_accel.c | 1 src/s3v_dac.c | 1 src/s3v_dga.c | 29 +--------- src/s3v_driver.c | 93 ++++++++++++++++++++++++++------- src/s3v_hwcurs.c | 1 src/s3v_i2c.c | 1 src/s3v_macros.h | 1 src/s3v_pcirename.h | 122 ++++++++++++++++++++++++++++++++++++++++++++ src/s3v_rop.h | 1 src/s3v_shadow.c | 1 src/s3v_xv.c | 144 ++-------------------------------------------------- 20 files changed, 245 insertions(+), 217 deletions(-)
New commits: commit 127d572255eb125e65f2b5b5743bfd17b15b003c Author: Adam Jackson <[EMAIL PROTECTED]> Date: Wed Mar 19 15:04:49 2008 -0400 s3virge 1.10.0 diff --git a/configure.ac b/configure.ac index 43e2a0d..628be19 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-s3virge], - 1.9.1, + 1.10.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-s3virge) commit 187d5ee412877a6af0099a8be1c85d055bc52736 Author: Adam Jackson <[EMAIL PROTECTED]> Date: Wed Mar 19 15:03:13 2008 -0400 Fix distcheck diff --git a/src/Makefile.am b/src/Makefile.am index 41d2177..4cbc5f6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,6 +39,7 @@ s3virge_drv_la_SOURCES = \ s3v_hwcurs.c \ s3v_i2c.c \ s3v_macros.h \ + s3v_pcirename.h \ s3v_rop.h \ s3v_shadow.c \ s3v_xv.c commit 02871fe68525edb40d0956dee7643caa773d2404 Author: Adam Jackson <[EMAIL PROTECTED]> Date: Wed Mar 19 15:01:59 2008 -0400 Death to RCS tags. diff --git a/src/newmmio.h b/src/newmmio.h index 59ba575..7f3e1e0 100644 --- a/src/newmmio.h +++ b/src/newmmio.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h,v 1.5 1999/03/21 07:35:15 dawes Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/regs3v.h b/src/regs3v.h index 6053054..ff09c1d 100644 --- a/src/regs3v.h +++ b/src/regs3v.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/regs3v.h,v 1.9 2002/01/25 21:56:08 tsi Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v.h b/src/s3v.h index 90800b6..42b1f83 100644 --- a/src/s3v.h +++ b/src/s3v.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v 1.31 2003/02/04 02:20:49 dawes Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_accel.c b/src/s3v_accel.c index faed1bd..528ab8a 100644 --- a/src/s3v_accel.c +++ b/src/s3v_accel.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c,v 1.25 2003/11/06 18:38:05 tsi Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_dac.c b/src/s3v_dac.c index 180b7f4..035d76c 100644 --- a/src/s3v_dac.c +++ b/src/s3v_dac.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_dac.c,v 1.4 2003/02/04 02:20:50 dawes Exp $ */ /* Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_dga.c b/src/s3v_dga.c index 626963f..7ad42db 100644 --- a/src/s3v_dga.c +++ b/src/s3v_dga.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_dga.c,v 1.7 2002/01/14 18:02:58 dawes Exp $ */ /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_driver.c b/src/s3v_driver.c index 79e6b54..13b8425 100644 --- a/src/s3v_driver.c +++ b/src/s3v_driver.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.93 2003/11/06 18:38:05 tsi Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_hwcurs.c b/src/s3v_hwcurs.c index 8ea3eeb..53c539f 100644 --- a/src/s3v_hwcurs.c +++ b/src/s3v_hwcurs.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_hwcurs.c,v 1.7 2003/02/04 02:20:50 dawes Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_i2c.c b/src/s3v_i2c.c index 2dd812b..cbac21f 100644 --- a/src/s3v_i2c.c +++ b/src/s3v_i2c.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_i2c.c,v 1.4 2000/03/31 20:13:32 dawes Exp $ */ /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_macros.h b/src/s3v_macros.h index c8d1ef8..8cd0114 100644 --- a/src/s3v_macros.h +++ b/src/s3v_macros.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_macros.h,v 1.11 2000/11/28 20:59:18 dawes Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_rop.h b/src/s3v_rop.h index 11e0bd3..8427fb9 100644 --- a/src/s3v_rop.h +++ b/src/s3v_rop.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_rop.h,v 1.3 1999/03/14 03:22:04 dawes Exp $ */ /* Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_shadow.c b/src/s3v_shadow.c index b2cdf9d..f61773a 100644 --- a/src/s3v_shadow.c +++ b/src/s3v_shadow.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_shadow.c,v 1.2 2000/03/06 22:59:30 dawes Exp $ */ /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. diff --git a/src/s3v_xv.c b/src/s3v_xv.c index ea015c4..7e7c243 100644 --- a/src/s3v_xv.c +++ b/src/s3v_xv.c @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c,v 1.10tsi Exp $ */ /* Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved. commit cda576024eb76835dfb08dd17ebe6c6c6b84769c Author: Dave Airlie <[EMAIL PROTECTED]> Date: Mon Mar 10 15:01:10 2008 +1000 oops fixed pointed out by pcpa diff --git a/src/s3v_driver.c b/src/s3v_driver.c index e5d8f8a..79e6b54 100644 --- a/src/s3v_driver.c +++ b/src/s3v_driver.c @@ -3685,9 +3685,9 @@ S3VEnableMmio(ScrnInfoPtr pScrn) * (EE 06/03/99) */ outb(vgaCRIndex, 0x59); /*@@@EE*/ - outb(vgaCRReg, PCI_REGION_MEM(ps3v->PciInfo, 0, REGION_MEM) >> 24); + outb(vgaCRReg, PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM) >> 24); outb(vgaCRIndex, 0x5A); - outb(vgaCRReg, PCI_REGION_MEM(ps3v->PciInfo, 0, REGION_MEM) >> 16); + outb(vgaCRReg, PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM) >> 16); outb(vgaCRIndex, 0x53); #endif /* Save register for restore */ commit 44aca1d9fe5c51e591aa5a33a3f46d3ad46dc0b9 Author: Dave Airlie <[EMAIL PROTECTED]> Date: Mon Mar 10 13:19:01 2008 +1000 s3virge: pciaccess conversion diff --git a/configure.ac b/configure.ac index d4cf68f..43e2a0d 100644 --- a/configure.ac +++ b/configure.ac @@ -58,10 +58,23 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_M 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"]) +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) + + AC_SUBST([XORG_CFLAGS]) AC_SUBST([moduledir]) diff --git a/src/s3v.h b/src/s3v.h index a20630d..90800b6 100644 --- a/src/s3v.h +++ b/src/s3v.h @@ -28,6 +28,8 @@ in this Software without prior written authorization from the XFree86 Project. #ifndef _S3V_H #define _S3V_H +#include "s3v_pcirename.h" + #include <string.h> /* All drivers should typically include these */ diff --git a/src/s3v_dga.c b/src/s3v_dga.c index 74d0bb1..626963f 100644 --- a/src/s3v_dga.c +++ b/src/s3v_dga.c @@ -332,7 +332,7 @@ S3V_OpenFramebuffer( S3VPtr ps3v = S3VPTR(pScrn); *name = NULL; /* no special device */ - *mem = (unsigned char*)ps3v->PciInfo->memBase[0]; + *mem = (unsigned char*)PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM); *size = ps3v->videoRambytes; *offset = 0; *flags = DGA_NEED_ROOT; diff --git a/src/s3v_driver.c b/src/s3v_driver.c index ea4f341..e5d8f8a 100644 --- a/src/s3v_driver.c +++ b/src/s3v_driver.c @@ -29,6 +29,7 @@ in this Software without prior written authorization from the XFree86 Project. #include "config.h" #endif +#include <unistd.h> #include "xf86Resources.h" /* Needed by Resources Access Control (RAC) */ #include "xf86RAC.h" @@ -418,7 +419,7 @@ s3virgeSetup(pointer module, pointer opts, int *errmaj, int *errmin) #endif /* XFree86LOADER */ -static unsigned char *find_bios_string(PCITAG Tag, int BIOSbase, char *match1, char *match2) +static unsigned char *find_bios_string(S3VPtr ps3v, int BIOSbase, char *match1, char *match2) { #define BIOS_BSIZE 1024 #define BIOS_BASE 0xc0000 @@ -429,8 +430,13 @@ static unsigned char *find_bios_string(PCITAG Tag, int BIOSbase, char *match1, c if (!init) { init = 1; - if (xf86ReadDomainMemory(Tag, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) +#ifndef XSERVER_LIBPCIACCESS + if (xf86ReadDomainMemory(ps3v->PciTag, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) return NULL; +#else + if (pci_device_read_rom(ps3v->PciInfo, bios)) + return NULL; +#endif if ((bios[0] != 0x55) || (bios[1] != 0xaa)) return NULL; } @@ -521,9 +527,12 @@ S3VProbe(DriverPtr drv, int flags) */ return FALSE; } + +#ifndef XSERVER_LIBPCIACCESS if (xf86GetPciVideoInfo() == NULL) { return FALSE; } +#endif numUsed = xf86MatchPciInstances(S3VIRGE_NAME, PCI_S3_VENDOR_ID, S3VChipsets, S3VPciChipsets, devSections, @@ -941,7 +950,7 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) ps3v->Chipset); } else { from = X_PROBED; - ps3v->Chipset = ps3v->PciInfo->chipType; + ps3v->Chipset = PCI_DEV_DEVICE_ID(ps3v->PciInfo); pScrn->chipset = (char *)xf86TokenToString(S3VChipsets, ps3v->Chipset); } @@ -950,7 +959,7 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", ps3v->ChipRev); } else { - ps3v->ChipRev = ps3v->PciInfo->chipRev; + ps3v->ChipRev = PCI_DEV_REVISION(ps3v->PciInfo); } xfree(pEnt); @@ -975,8 +984,10 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset); +#ifndef XSERVER_LIBPCIACCESS ps3v->PciTag = pciTag(ps3v->PciInfo->bus, ps3v->PciInfo->device, ps3v->PciInfo->func); +#endif /* Handle XVideo after we know chipset, so we can give an */ /* intelligent comment about support */ @@ -1197,7 +1208,7 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) * <= 8bpp: 191500 */ - if (find_bios_string(ps3v->PciTag, BIOS_BASE, "S3 86C325", + if (find_bios_string(ps3v, BIOS_BASE, "S3 86C325", "MELCO WGP-VG VIDEO BIOS") != NULL) { if (xf86GetVerbosity()) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MELCO BIOS found\n"); @@ -2298,15 +2309,30 @@ S3VMapMem(ScrnInfoPtr pScrn) /* so that we can use registers map */ /* structure - see newmmio.h */ /* around 0x10000 from MemBase */ +#ifndef XSERVER_LIBPCIACCESS ps3v->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, ps3v->PciTag, - ps3v->PciInfo->memBase[0] + S3_NEWMMIO_REGBASE, - S3_NEWMMIO_REGSIZE); + PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM) + S3_NEWMMIO_REGBASE, + S3_NEWMMIO_REGSIZE); ps3v->MapBaseDense = xf86MapPciMem(pScrn->scrnIndex, - VIDMEM_MMIO_32BIT, - ps3v->PciTag, - ps3v->PciInfo->memBase[0] + S3_NEWMMIO_REGBASE, - 0x8000); + VIDMEM_MMIO_32BIT, + ps3v->PciTag, + PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM) + S3_NEWMMIO_REGBASE, + 0x8000); +#else + { + void** result = (void**)&ps3v->MapBase; + int err = pci_device_map_range(ps3v->PciInfo, + PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM) + S3_NEWMMIO_REGBASE, + S3_NEWMMIO_REGSIZE, + PCI_DEV_MAP_FLAG_WRITABLE, + result); + + if (err) + return FALSE; + } + ps3v->MapBaseDense = ps3v->MapBase; +#endif if( !ps3v->MapBase ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -2315,10 +2341,26 @@ S3VMapMem(ScrnInfoPtr pScrn) } /* Map the framebuffer */ if (ps3v->videoRambytes) { /* not set in PreInit() */ +#ifndef XSERVER_LIBPCIACCESS ps3v->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - ps3v->PciTag, ps3v->PciInfo->memBase[0], + ps3v->PciTag, PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM), ps3v->videoRambytes ); +#else + { + void** result = (void**)&ps3v->FBBase; + int err = pci_device_map_range(ps3v->PciInfo, + PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM), + ps3v->videoRambytes, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, + result); + + if (err) + return FALSE; + } +#endif + if( !ps3v->FBBase ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not map framebuffer.\n"); @@ -2329,7 +2371,7 @@ S3VMapMem(ScrnInfoPtr pScrn) ps3v->FBStart = ps3v->FBBase; } - pScrn->memPhysBase = ps3v->PciInfo->memBase[0]; + pScrn->memPhysBase = PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM); pScrn->fbOffset = 0; /* Set up offset to hwcursor memory area */ @@ -2376,14 +2418,24 @@ S3VUnmapMem(ScrnInfoPtr pScrn) ps3v->PrimaryVidMapped = FALSE; } +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, (pointer)ps3v->MapBase, S3_NEWMMIO_REGSIZE); +#else + pci_device_unmap_range(ps3v->PciInfo, ps3v->MapBase, + S3_NEWMMIO_REGSIZE); +#endif + +#ifndef XSERVER_LIBPCIACCESS if (ps3v->FBBase) xf86UnMapVidMem(pScrn->scrnIndex, (pointer)ps3v->FBBase, ps3v->videoRambytes); xf86UnMapVidMem(pScrn->scrnIndex, (pointer)ps3v->MapBaseDense, 0x8000); - +#else + pci_device_unmap_range(ps3v->PciInfo, ps3v->FBBase, + ps3v->videoRambytes); +#endif return; } @@ -3633,9 +3685,9 @@ S3VEnableMmio(ScrnInfoPtr pScrn) * (EE 06/03/99) */ outb(vgaCRIndex, 0x59); /*@@@EE*/ - outb(vgaCRReg, ps3v->PciInfo->memBase[0] >> 24); + outb(vgaCRReg, PCI_REGION_MEM(ps3v->PciInfo, 0, REGION_MEM) >> 24); outb(vgaCRIndex, 0x5A); - outb(vgaCRReg, ps3v->PciInfo->memBase[0] >> 16); + outb(vgaCRReg, PCI_REGION_MEM(ps3v->PciInfo, 0, REGION_MEM) >> 16); outb(vgaCRIndex, 0x53); #endif /* Save register for restore */ diff --git a/src/s3v_pcirename.h b/src/s3v_pcirename.h new file mode 100644 index 0000000..9321046 --- /dev/null +++ b/src/s3v_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 S3PCIRENAME_H +#define S3PCIRENAME_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 75edb6b05afa2e739c214d5c1321acd6b68409f2 Author: Matthieu Herrb <[EMAIL PROTECTED]> Date: Sat Mar 8 23:46:56 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 e3833f9ae20f5bc25918a1f95216246711bbdf4e Author: Андрей Рандрианасулу <[EMAIL PROTECTED]> Date: Thu Oct 25 21:35:53 2007 -0400 Clean up: Remove some mga remains diff --git a/src/s3v_dga.c b/src/s3v_dga.c index 4449a67..74d0bb1 100644 --- a/src/s3v_dga.c +++ b/src/s3v_dga.c @@ -67,12 +67,7 @@ in this Software without prior written authorization from the XFree86 Project. #include "xaa.h" #include "xaalocal.h" #include "s3v.h" -#if 0 -#include "mga_bios.h" -#include "mga.h" -#include "mga_reg.h" -#include "mga_macros.h" -#endif + #include "dgaproc.h" @@ -84,10 +79,7 @@ static void S3V_SetViewport(ScrnInfoPtr, int, int, int); static void S3V_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void S3V_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); /* dummy... */ -#if 0 -static void MGA_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, - unsigned long); -#endif + static DGAFunctionRec S3V_DGAFuncs = { @@ -326,19 +318,7 @@ S3V_BlitRect( } } -#if 0 -static void -MGA_BlitTransRect( - ScrnInfoPtr pScrn, - int srcx, int srcy, - int w, int h, - int dstx, int dsty, - unsigned long color -){ - /* this one should be separate since the XAA function would - prohibit usage of ~0 as the key */ -} -#endif + static Bool S3V_OpenFramebuffer( diff --git a/src/s3v_xv.c b/src/s3v_xv.c index 5e5476d..ea015c4 100644 --- a/src/s3v_xv.c +++ b/src/s3v_xv.c @@ -64,11 +64,7 @@ static XF86VideoAdaptorPtr S3VSetupImageVideoOverlay(ScreenPtr); static int S3VSetPortAttributeOverlay(ScrnInfoPtr, Atom, INT32, pointer); static int S3VGetPortAttributeOverlay(ScrnInfoPtr, Atom ,INT32 *, pointer); -#if 0 -static XF86VideoAdaptorPtr MGASetupImageVideoTexture(ScreenPtr); -static int MGASetPortAttributeTexture(ScrnInfoPtr, Atom, INT32, pointer); -static int MGAGetPortAttributeTexture(ScrnInfoPtr, Atom ,INT32 *, pointer); -#endif + static void S3VStopVideo(ScrnInfoPtr, pointer, Bool); static void S3VQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *, unsigned int *, pointer); @@ -78,9 +74,6 @@ static int S3VPutImage(ScrnInfoPtr, short, short, short, short, short, static int S3VQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); -#if 0 -static void MGABlockHandler(int, pointer, pointer, pointer); -#endif static void S3VResetVideoOverlay(ScrnInfoPtr); @@ -132,28 +125,8 @@ void S3VInitVideo(ScreenPtr pScreen) && ps3v->XVideo ) { -#if 0 - if((pMga->Overlay8Plus24 /* || dualhead */ || pMga->TexturedVideo) && - (pScrn->bitsPerPixel != 24)) - { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using texture video\n"); - newAdaptor = MGASetupImageVideoTexture(pScreen); - pMga->TexturedVideo = TRUE; - } else { -#endif - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using overlay video\n"); newAdaptor = S3VSetupImageVideoOverlay(pScreen); - -#if 0 - pMga->TexturedVideo = FALSE; - }*/ - - if(!pMga->Overlay8Plus24 /* && !dualhead */) - S3VInitOffscreenImages(pScreen); - pMga->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = MGABlockHandler; -#endif } @@ -241,43 +214,9 @@ S3VSetPortAttributeOverlay( INT32 value, pointer data ){ -#if 0 - MGAPtr pMga = MGAPTR(pScrn); - MGAPortPrivPtr pPriv = pMga->portPrivate; - - CHECK_DMA_QUIESCENT(pMga, pScrn); - - if(attribute == xvBrightness) { - if((value < -128) || (value > 127)) - return BadValue; - pPriv->brightness = value; - OUTREG(MGAREG_BESLUMACTL, ((pPriv->brightness & 0xff) << 16) | - (pPriv->contrast & 0xff)); - } else - if(attribute == xvContrast) { - if((value < 0) || (value > 255)) - return BadValue; - pPriv->contrast = value; - OUTREG(MGAREG_BESLUMACTL, ((pPriv->brightness & 0xff) << 16) | - (pPriv->contrast & 0xff)); - } else - if(attribute == xvColorKey) { - pPriv->colorKey = value; - outMGAdac(0x55, (pPriv->colorKey & pScrn->mask.red) >> - pScrn->offset.red); - outMGAdac(0x56, (pPriv->colorKey & pScrn->mask.green) >> - pScrn->offset.green); - outMGAdac(0x57, (pPriv->colorKey & pScrn->mask.blue) >> - pScrn->offset.blue); - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); - } else -#endif return BadMatch; -#if 0 - return Success; -#endif } static int @@ -287,26 +226,10 @@ S3VGetPortAttributeOverlay( INT32 *value, pointer data ){ -#if 0 - MGAPtr pMga = MGAPTR(pScrn); - MGAPortPrivPtr pPriv = pMga->portPrivate; - - if(attribute == xvBrightness) { - *value = pPriv->brightness; - } else - if(attribute == xvContrast) { - *value = pPriv->contrast; - } else - if(attribute == xvColorKey) { - *value = pPriv->colorKey; - } else -#endif + return BadMatch; -#if 0 - return Success; -#endif } @@ -438,15 +361,8 @@ S3VSetupImageVideoOverlay(ScreenPtr pScreen) adapt->pFormats = Formats; adapt->nPorts = 1; adapt->pAttributes = NULL /*Attributes*/; -#if 0 - if (pMga->Chipset == PCI_CHIP_MGAG400) { - adapt->nImages = 4; - adapt->nAttributes = 3; - } else { -#endif - adapt->nImages = 3; - adapt->nAttributes = 0; - /* }*/ + adapt->nImages = 3; + adapt->nAttributes = 0; adapt->pImages = Images; adapt->PutVideo = NULL; adapt->PutStill = NULL; @@ -475,13 +391,6 @@ S3VStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) S3VPtr ps3v = S3VPTR(pScrn); S3VPortPrivPtr pPriv = ps3v->portPrivate; -#if 0 - MGAPtr pMga = MGAPTR(pScrn); - MGAPortPrivPtr pPriv = pMga->portPrivate; - - if(pMga->TexturedVideo) return; -#endif - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); if(shutdown) { @@ -602,12 +511,6 @@ S3VDisplayVideoOverlay( if(!ps3v->NeedSTREAMS) return; -#if 0 - /* got 64 scanlines to do it in */ - tmp = INREG(MGAREG_VCOUNT) + 64; - if(tmp > pScrn->currentMode->VDisplay) - tmp -= pScrn->currentMode->VDisplay; -#endif /* Reference at http://www.webartz.com/fourcc/ */ /* Looks like ViRGE only supports YUY2 and Y211?, */ @@ -860,14 +763,6 @@ S3VPutImage( dst_start = ps3v->FBStart + offset + left + (top * dstPitch); /*dst_start = pMga->FbStart + offset + left + (top * dstPitch);*/ -#if 0 - if(pMga->TexturedVideo && pMga->AccelInfoRec->NeedToSync && - ((long)data != pPriv->lastPort)) - { - MGAStormSync(pScrn); - pMga->AccelInfoRec->NeedToSync = FALSE; - } -#endif switch(id) { case FOURCC_YV12: @@ -895,17 +790,7 @@ S3VPutImage( break; } -#if 0 - if(pMga->TexturedVideo) { - pPriv->lastPort = (long)data; - MGADisplayVideoTexture(pScrn, id, offset, - REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes), - width, height, dstPitch, src_x, src_y, src_w, src_h, - drw_x, drw_y, drw_w, drw_h); - pPriv->videoStatus = FREE_TIMER; - pPriv->freeTime = currentTime.milliseconds + FREE_DELAY; - } else { -#endif + /* update cliplist */ if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); @@ -918,10 +803,7 @@ S3VPutImage( x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h); pPriv->videoStatus = CLIENT_VIDEO_ON; -#if 0 - } - pMga->VideoTimerCallback = MGAVideoTimerCallback; -#endif + return Success; } @@ -934,22 +816,11 @@ S3VQueryImageAttributes( unsigned short *w, unsigned short *h, int *pitches, int *offsets ){ -#if 0 - MGAPtr pMga = MGAPTR(pScrn); -#endif + int size, tmp; -#if 0 - if(pMga->TexturedVideo) { - if(*w > 2046) *w = 2046; - if(*h > 2046) *h = 2046; - } else { -#endif if(*w > 1024) *w = 1024; if(*h > 1024) *h = 1024; -#if 0 - } -#endif *w = (*w + 1) & ~1; if(offsets) offsets[0] = 0; commit ee9f04bd24892db06ad84c6372e3a03092fdb702 Author: Brice Goglin <[EMAIL PROTECTED]> Date: Tue Aug 7 12:52:51 2007 +0200 Define S3VIRGE_VERSION_* using PACKAGE_VERSION* diff --git a/src/s3v_driver.c b/src/s3v_driver.c index 49f87af..ea4f341 100644 --- a/src/s3v_driver.c +++ b/src/s3v_driver.c @@ -121,10 +121,10 @@ static int pix24bpp = 0; #define S3VIRGE_NAME "S3VIRGE" #define S3VIRGE_DRIVER_NAME "s3virge" -#define S3VIRGE_VERSION_NAME "1.9.1" -#define S3VIRGE_VERSION_MAJOR 1 -#define S3VIRGE_VERSION_MINOR 9 -#define S3VIRGE_PATCHLEVEL 1 +#define S3VIRGE_VERSION_NAME PACKAGE_VERSION +#define S3VIRGE_VERSION_MAJOR PACKAGE_VERSION_MAJOR +#define S3VIRGE_VERSION_MINOR PACKAGE_VERSION_MINOR +#define S3VIRGE_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL #define S3VIRGE_DRIVER_VERSION ((S3VIRGE_VERSION_MAJOR << 24) | \ (S3VIRGE_VERSION_MINOR << 16) | \ S3VIRGE_PATCHLEVEL) commit ca0f65b30bc050fbfe5ef77a02fcd4c75def3f01 Author: Alan Coopersmith <[EMAIL PROTECTED]> Date: Thu Mar 1 10:53:36 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 +*~ commit 7d8655ae45b81a26a0901187f03b0dc19dd51b13 Author: Alan Coopersmith <[EMAIL PROTECTED]> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]