xserver-xorg-video-s3virge: Changes to 'upstream-unstable'
.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 | 164 ++++++++++++++++++++++++++++++----------------------
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, 269 insertions(+), 264 deletions(-)
New commits:
commit fff6ce57c4bd78f39f3a2f45c820918c6e7a950b
Author: Adam Jackson <ajax@redhat.com>
Date: Wed May 21 15:54:36 2008 -0400
s3virge 1.10.1
diff --git a/configure.ac b/configure.ac
index 628be19..244a27d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-s3virge],
- 1.10.0,
+ 1.10.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-s3virge)
commit caa3a43d9798bdc82a3660df88e694e2e65df373
Author: Adam Jackson <ajax@redhat.com>
Date: Wed May 21 15:54:12 2008 -0400
Fix typo in S3VValidMode.
diff --git a/src/s3v_driver.c b/src/s3v_driver.c
index 9164e42..d0fd463 100644
--- a/src/s3v_driver.c
+++ b/src/s3v_driver.c
@@ -2673,7 +2673,7 @@ S3VInternalScreenInit( int scrnIndex, ScreenPtr pScreen)
static ModeStatus
S3VValidMode(int index, DisplayModePtr mode, Bool verbose, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr pScrn = xf86Screens[index];
if ((pScrn->bitsPerPixel + 7)/8 * mode->HDisplay > 4095)
return MODE_VIRTUAL_X;
commit aa4708390fb18a7089de66ef71c93745c856f6f4
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Apr 7 17:09:54 2008 -0400
Bug #13243: Re-enable 24+32 framebuffer.
This was just never enabled for the fb code path, but worked in cfb as
far as anyone can tell.
diff --git a/src/s3v_driver.c b/src/s3v_driver.c
index 30ae4b8..9164e42 100644
--- a/src/s3v_driver.c
+++ b/src/s3v_driver.c
@@ -2650,6 +2650,7 @@ S3VInternalScreenInit( int scrnIndex, ScreenPtr pScreen)
case 8:
case 16:
case 24:
+ case 32:
ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX,
pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
displayWidth, pScrn->bitsPerPixel);
commit 784547b5e4b62279d4dc608e3c0c4705ae18bb5d
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Mar 24 11:59:07 2008 -0400
Nuke the useless UseFB option.
diff --git a/src/s3v_driver.c b/src/s3v_driver.c
index af395b1..30ae4b8 100644
--- a/src/s3v_driver.c
+++ b/src/s3v_driver.c
@@ -247,7 +247,6 @@ static const OptionInfoRec S3VOptions[] =
{ OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE },
- { OPTION_FB_DRAW, "UseFB", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_MX_CR3A_FIX, "mxcr3afix", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_XVIDEO, "XVideo", OPTV_BOOLEAN, {0}, FALSE },
{-1, NULL, OPTV_NONE, {0}, FALSE}
@@ -876,12 +875,6 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
ps3v->hwcursor = FALSE;
}
- ps3v->UseFB = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Using fb.\n");
- if (xf86IsOptionSet(ps3v->Options, OPTION_FB_DRAW))
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "UseFB option is deprecated.\n");
-
if (xf86IsOptionSet(ps3v->Options, OPTION_MX_CR3A_FIX))
{
if (xf86GetOptValBool(ps3v->Options, OPTION_MX_CR3A_FIX ,&ps3v->mx_cr3a_fix))
@@ -1429,15 +1422,12 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
xf86SetDpi(pScrn, 0, 0);
/* Load bpp-specific modules */
- if( ps3v->UseFB )
- {
- if( xf86LoadSubModule(pScrn, "fb") == NULL )
- {
- S3VFreeRec(pScrn);
- return FALSE;
- }
- xf86LoaderReqSymLists(fbSymbols, NULL);
- }
+ if( xf86LoadSubModule(pScrn, "fb") == NULL )
+ {
+ S3VFreeRec(pScrn);
+ return FALSE;
+ }
+ xf86LoaderReqSymLists(fbSymbols, NULL);
/* Load XAA if needed */
if (!ps3v->NoAccel || ps3v->hwcursor ) {
@@ -2522,8 +2512,7 @@ S3VScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
/* must be after RGB ordering fixed */
- if (ps3v->UseFB)
- fbPictureInit (pScreen, 0, 0);
+ fbPictureInit (pScreen, 0, 0);
/* Initialize acceleration layer */
if (!ps3v->NoAccel) {
@@ -2656,27 +2645,23 @@ S3VInternalScreenInit( int scrnIndex, ScreenPtr pScreen)
* pScreen fields.
*/
- if( ps3v->UseFB )
+ switch (pScrn->bitsPerPixel)
{
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using FB\n");
-
- switch (pScrn->bitsPerPixel)
- {
case 8:
case 16:
case 24:
- ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX,
- pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
- displayWidth, pScrn->bitsPerPixel);
- break;
+ ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX,
+ pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
+ displayWidth, pScrn->bitsPerPixel);
+ break;
default:
- xf86DrvMsg(scrnIndex, X_ERROR,
- "Internal error: invalid bpp (%d) in S3VScreenInit\n",
- pScrn->bitsPerPixel);
- ret = FALSE;
- break;
- }
+ xf86DrvMsg(scrnIndex, X_ERROR,
+ "Internal error: invalid bpp (%d) in S3VScreenInit\n",
+ pScrn->bitsPerPixel);
+ ret = FALSE;
+ break;
}
+
return ret;
}
commit 344d00fc3b32cfb9871c4356224b55c296e0b1d6
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Mar 24 11:56:43 2008 -0400
Bug #14298: Fix mode validation to be less ridiculous.
The code sort of assumed you'd asked for a virtual size in the config file,
either explicitly or through asking for a mode. Autoconfiguration will
default the virtual to zero though, so the constraint will fail, and then
a mode we can't do will get through xf86ValidateModes().
Just move the check to S3VValidMode where it belongs.
diff --git a/src/s3v_driver.c b/src/s3v_driver.c
index 13b8425..af395b1 100644
--- a/src/s3v_driver.c
+++ b/src/s3v_driver.c
@@ -1427,19 +1427,6 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
/* Set display resolution */
xf86SetDpi(pScrn, 0, 0);
- /* When running the STREAMS processor */
- /* the max. stride is limited to 4096-1 */
- /* so this is the virtualX limit. */
- /* STREAMS is needed for 24 & 32 bpp, */
- /* (all depth 24 modes) */
- /* This should never happen... we */
- /* checked it before ValidateModes */
- if ( ((pScrn->depth == 24) || (pScrn->depth == 16)) &&
- ((pScrn->bitsPerPixel/8) * pScrn->virtualX > 4095) ) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Virtual width to large for ViRGE\n");
- S3VFreeRec(pScrn);
- return FALSE;
- }
/* Load bpp-specific modules */
if( ps3v->UseFB )
@@ -2700,8 +2687,12 @@ S3VInternalScreenInit( int scrnIndex, ScreenPtr pScreen)
static ModeStatus
S3VValidMode(int index, DisplayModePtr mode, Bool verbose, int flags)
{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+
+ if ((pScrn->bitsPerPixel + 7)/8 * mode->HDisplay > 4095)
+ return MODE_VIRTUAL_X;
- return MODE_OK;
+ return MODE_OK;
}
commit 127d572255eb125e65f2b5b5743bfd17b15b003c
Author: Adam Jackson <ajax@redhat.com>
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 <ajax@redhat.com>
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 <ajax@redhat.com>
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 <airlied@clockmaker.usersys.redhat.com>
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 <airlied@redhat.com>
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 <matthieu.herrb@laas.fr>
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: Андрей Рандрианасулу <randrianasulu@mail.ru>
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;
Reply to: