summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/drivers/ati
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/ati')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c1040
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h20
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c130
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h5
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c56
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c34
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c176
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c583
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h9
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c17
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c84
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c278
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c18
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c28
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h837
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c29
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h38
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h15
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h10
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c33
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h4
60 files changed, 3171 insertions, 481 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
index e2e6a719c..862915c88 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile
@@ -1,6 +1,6 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.11 1999/09/25 14:37:18 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.12 2000/02/18 12:19:10 tsi Exp $
XCOMM
-XCOMM Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+XCOMM Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
XCOMM
XCOMM Permission to use, copy, modify, distribute, and sell this software and
XCOMM its documentation for any purpose is hereby granted without fee, provided
@@ -34,22 +34,22 @@ ATIMODOBJ = atimodule.o
#endif
SRCS = ati.c atiadapter.c atiadjust.c atibank.c atibios.c atibus.c atichip.c \
- aticlock.c aticonsole.c aticrtc.c atidac.c atidsp.c atiident.c atiio.c \
- atilock.c atimach64.c $(ATIMODSRC) atioption.c atipreinit.c atiprint.c \
+ aticlock.c aticonsole.c atidac.c atidsp.c atiident.c atiio.c atilock.c \
+ atimach64.c $(ATIMODSRC) atioption.c atipreinit.c atiprint.c \
atiprobe.c atiscreen.c atiutil.c ativalid.c ativga.c atividmem.c \
atiwonder.c
OBJS = ati.o atiadapter.o atiadjust.o atibank.o atibios.o atibus.o atichip.o \
- aticlock.o aticonsole.o aticrtc.o atidac.o atidsp.o atiident.o atiio.o \
- atilock.o atimach64.o $(ATIMODOBJ) atioption.o atipreinit.o atiprint.o \
+ aticlock.o aticonsole.o atidac.o atidsp.o atiident.o atiio.o atilock.o \
+ atimach64.o $(ATIMODOBJ) atioption.o atipreinit.o atiprint.o \
atiprobe.o atiscreen.o atiutil.o ativalid.o ativga.o atividmem.o \
atiwonder.o
#if defined(XF86DriverSDK)
INCLUDES = -I. -I../../include
#else
-INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
- -I$(XF86SRC)/rac -I$(XF86SRC)/shadowfb -I$(XF86SRC) \
+INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86SRC) \
+ -I$(XF86SRC)/rac -I$(XF86SRC)/shadowfb -I$(XF86SRC)/xaa \
-I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \
-I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb \
-I$(SERVERSRC)/mi -I$(SERVERSRC)/include \
@@ -89,7 +89,6 @@ InstallDriverSDKNonExecFile(aticlock.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(aticlock.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(aticonsole.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(aticonsole.h,$(DRIVERSDKDIR)/drivers/ati)
-InstallDriverSDKNonExecFile(aticrtc.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(aticrtc.h,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(atidac.c,$(DRIVERSDKDIR)/drivers/ati)
InstallDriverSDKNonExecFile(atidac.h,$(DRIVERSDKDIR)/drivers/ati)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c
index 56420190e..722cf881f 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.7 1999/10/13 16:49:15 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.9 2000/02/18 12:19:10 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -46,7 +46,7 @@
* David Dawes, dawes@xfree86.org
* Mark Weaver, Mark_Weaver@brown.edu
* Hans Nasten, nasten@everyware.se
- * Kevin Martin, martin@cs.unc.edu
+ * Kevin Martin, martin@precisioninsight.com
* Frederic Rienthaler, root@mojo.synapse.com
* Marc Bolduc, bolduc@cim.mcgill.ca
* Reuben Sumner, rasumner@undergrad.math.uwaterloo.ca
@@ -56,6 +56,8 @@
* W. Marcus Miller, marcus@llnl.gov
* Henrik Harmsen, ervhch@erv.ericsson.se (ShadowFB support)
* Christian Lupien <lupien@physics.utoronto.ca>
+ * Precision Insight Incorporated
+ * Mark Vojkovich, mvojkovich@valinux.com
*
* ... and, many, many others from around the world.
*
@@ -69,6 +71,7 @@
*/
#include "atiident.h"
+#include "atioption.h"
#include "atiprobe.h"
#include "ativersion.h"
@@ -79,6 +82,7 @@ DriverRec ATI =
"ati",
ATIIdentify,
ATIProbe,
+ ATIAvailableOptions,
NULL,
0
};
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h
index 975ec43cc..ce4264699 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h,v 1.4 1999/08/01 07:57:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h,v 1.5 2000/02/18 12:19:11 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c
index e423f03a0..2d4de4ea2 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c,v 1.4 1999/10/13 20:33:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c,v 1.5 2000/02/18 12:19:11 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,7 +21,16 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include "ati.h"
#include "atiadapter.h"
+#include "atichip.h"
+#include "atidac.h"
+#include "atidsp.h"
+#include "atiio.h"
+#include "atimach64.h"
+#include "atiprint.h"
+#include "ativga.h"
+#include "atiwonder.h"
/*
* Adapter-related definitions.
@@ -45,3 +54,1030 @@ const char *ATIAdapterNames[] =
"ATI Mach64",
"ATI Rage128"
};
+
+/*
+ * ATICopyVGAMemory --
+ *
+ * This function is called to copy one or all banks of a VGA plane.
+ */
+static void
+ATICopyVGAMemory
+(
+ ATIPtr pATI,
+ ATIHWPtr pATIHW,
+ pointer *saveptr,
+ pointer *from,
+ pointer *to
+)
+{
+ unsigned int iBank;
+
+ for (iBank = 0; iBank < pATIHW->nBank; iBank++)
+ {
+ (*pATIHW->SetBank)(pATI, iBank);
+ (void) memcpy(*to, *from, 0x00010000U);
+ *saveptr = (char *)(*saveptr) + 0x00010000U;
+ }
+}
+
+/*
+ * ATISwap --
+ *
+ * This function saves/restores video memory contents during video mode
+ * switches.
+ */
+static void
+ATISwap
+(
+ ScrnInfoPtr pScreenInfo,
+ ATIPtr pATI,
+ ATIHWPtr pATIHW,
+ Bool ToFB
+)
+{
+ pointer save, *from, *to;
+ unsigned int iPlane = 0, PlaneMask = 1;
+ CARD8 seq2, seq4, gra1, gra3, gra4, gra5, gra6, gra8;
+
+ /*
+ * This is only done for non-accelerator modes. If the video state on
+ * server entry was an accelerator mode, the application that relinquished
+ * the console had better do the Right Thing (tm) anyway by saving and
+ * restoring its own video memory contents.
+ */
+ if (pATIHW->crtc != ATI_CRTC_VGA)
+ return;
+
+ if (ToFB)
+ {
+ if (!pATIHW->frame_buffer)
+ return;
+
+ from = &save;
+ to = &pATI->pBank;
+ }
+ else
+ {
+ /* Allocate the memory */
+ if (!pATIHW->frame_buffer)
+ {
+ pATIHW->frame_buffer =
+ (pointer)xalloc(pATIHW->nBank * pATIHW->nPlane * 0x00010000U);
+ if (!pATIHW->frame_buffer)
+ {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ "Temporary frame buffer could not be allocated.\n");
+ return;
+ }
+ }
+
+ from = &pATI->pBank;
+ to = &save;
+ }
+
+ /* Turn off screen */
+ ATIVGASaveScreen(pATI, SCREEN_SAVER_ON);
+
+ /* Save register values to be modified */
+ seq2 = GetReg(SEQX, 0x02U);
+ seq4 = GetReg(SEQX, 0x04U);
+ gra1 = GetReg(GRAX, 0x01U);
+ gra3 = GetReg(GRAX, 0x03U);
+ gra4 = GetReg(GRAX, 0x04U);
+ gra5 = GetReg(GRAX, 0x05U);
+ gra6 = GetReg(GRAX, 0x06U);
+ gra8 = GetReg(GRAX, 0x08U);
+
+ save = pATIHW->frame_buffer;
+
+ /* Temporarily normalise the mode */
+ if (gra1 != 0x00U)
+ PutReg(GRAX, 0x01U, 0x00U);
+ if (gra3 != 0x00U)
+ PutReg(GRAX, 0x03U, 0x00U);
+ if (gra6 != 0x05U)
+ PutReg(GRAX, 0x06U, 0x05U);
+ if (gra8 != 0xFFU)
+ PutReg(GRAX, 0x08U, 0xFFU);
+
+ if (seq4 & 0x08U)
+ {
+ /* Setup packed mode memory */
+ if (seq2 != 0x0FU)
+ PutReg(SEQX, 0x02U, 0x0FU);
+ if (seq4 != 0x0AU)
+ PutReg(SEQX, 0x04U, 0x0AU);
+ if (pATI->Chip < ATI_CHIP_264CT)
+ {
+ if (gra5 != 0x00U)
+ PutReg(GRAX, 0x05U, 0x00U);
+ }
+ else
+ {
+ if (gra5 != 0x40U)
+ PutReg(GRAX, 0x05U, 0x40U);
+ }
+
+ ATICopyVGAMemory(pATI, pATIHW, &save, from, to);
+
+ if (seq2 != 0x0FU)
+ PutReg(SEQX, 0x02U, seq2);
+ if (seq4 != 0x0AU)
+ PutReg(SEQX, 0x04U, seq4);
+ if (pATI->Chip < ATI_CHIP_264CT)
+ {
+ if (gra5 != 0x00U)
+ PutReg(GRAX, 0x05U, gra5);
+ }
+ else
+ {
+ if (gra5 != 0x40U)
+ PutReg(GRAX, 0x05U, gra5);
+ }
+ }
+ else
+ {
+ gra4 = GetReg(GRAX, 0x04U);
+
+ /* Setup planar mode memory */
+ if (seq4 != 0x06U)
+ PutReg(SEQX, 0x04U, 0x06U);
+ if (gra5 != 0x00U)
+ PutReg(GRAX, 0x05U, 0x00U);
+
+ for (; iPlane < pATIHW->nPlane; iPlane++)
+ {
+ PutReg(SEQX, 0x02U, PlaneMask);
+ PutReg(GRAX, 0x04U, iPlane);
+ ATICopyVGAMemory(pATI, pATIHW, &save, from, to);
+ PlaneMask <<= 1;
+ }
+
+ PutReg(SEQX, 0x02U, seq2);
+ if (seq4 != 0x06U)
+ PutReg(SEQX, 0x04U, seq4);
+ PutReg(GRAX, 0x04U, gra4);
+ if (gra5 != 0x00U)
+ PutReg(GRAX, 0x05U, gra5);
+ }
+
+ /* Restore registers */
+ if (gra1 != 0x00U)
+ PutReg(GRAX, 0x01U, gra1);
+ if (gra3 != 0x00U)
+ PutReg(GRAX, 0x03U, gra3);
+ if (gra6 != 0x05U)
+ PutReg(GRAX, 0x06U, gra6);
+ if (gra8 != 0xFFU)
+ PutReg(GRAX, 0x08U, gra8);
+
+ /* Back to bank 0 */
+ (*pATIHW->SetBank)(pATI, 0);
+
+ /*
+ * If restoring video memory for a server video mode, free the frame buffer
+ * save area.
+ */
+ if (ToFB && (pATIHW == &pATI->NewHW))
+ {
+ xfree(pATIHW->frame_buffer);
+ pATIHW->frame_buffer = NULL;
+ }
+}
+
+/*
+ * ATIAdapterPreInit --
+ *
+ * This function initialises an ATIHWRec with information common to all video
+ * states generated by the driver.
+ */
+void
+ATIAdapterPreInit
+(
+ ScrnInfoPtr pScreenInfo,
+ ATIPtr pATI,
+ ATIHWPtr pATIHW
+)
+{
+ CARD32 lcd_index;
+
+ if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
+ {
+ /* Fill in VGA data */
+ ATIVGAPreInit(pScreenInfo, pATI, pATIHW);
+
+ /* Fill in VGA Wonder data */
+ if (pATI->CPIO_VGAWonder)
+ ATIVGAWonderPreInit(pScreenInfo, pATI, pATIHW);
+ }
+
+ /* Fill in Mach64 data */
+ if (pATI->Chip >= ATI_CHIP_88800GXC)
+ ATIMach64PreInit(pScreenInfo, pATI, pATIHW);
+
+ /* Ensure proper VCLK source */
+ if (pATI->Chip >= ATI_CHIP_264CT)
+ {
+ pATIHW->pll_vclk_cntl = ATIGetMach64PLLReg(PLL_VCLK_CNTL) |
+ (PLL_VCLK_SRC_SEL | PLL_VCLK_RESET);
+
+ /* For now disable extended reference and feedback dividers */
+ if (pATI->Chip >= ATI_CHIP_264LT)
+ pATIHW->pll_ext_vpll_cntl = ATIGetMach64PLLReg(PLL_EXT_VPLL_CNTL) &
+ ~(PLL_EXT_VPLL_EN | PLL_EXT_VPLL_VGA_EN | PLL_EXT_VPLL_INSYNC);
+ }
+
+ /* Initialise CRTC data for LCD panels */
+ if (pATI->LCDPanelID >= 0)
+ {
+ if (pATI->Chip == ATI_CHIP_264LT)
+ {
+ pATIHW->horz_stretching = inl(pATI->CPIO_HORZ_STRETCHING);
+ pATIHW->vert_stretching = inl(pATI->CPIO_VERT_STRETCHING);
+ pATIHW->lcd_gen_ctrl = inl(pATI->CPIO_LCD_GEN_CTRL);
+ }
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ lcd_index = inl(pATI->CPIO_LCD_INDEX);
+ pATIHW->lcd_index = (lcd_index &
+ ~(LCD_REG_INDEX | LCD_DISPLAY_DIS | LCD_SRC_SEL)) |
+ (LCD_SRC_SEL_CRTC1 | LCD_CRTC2_DISPLAY_DIS);
+ pATIHW->config_panel =
+ ATIGetLTProLCDReg(LCD_CONFIG_PANEL) | DONT_SHADOW_HEND;
+ pATIHW->lcd_gen_ctrl = ATIGetLTProLCDReg(LCD_GEN_CNTL);
+ pATIHW->horz_stretching = ATIGetLTProLCDReg(LCD_HORZ_STRETCHING);
+ pATIHW->vert_stretching = ATIGetLTProLCDReg(LCD_VERT_STRETCHING);
+ outl(pATI->CPIO_LCD_INDEX, lcd_index);
+ }
+
+ pATIHW->lcd_gen_ctrl &=
+ ~(CRT_ON | LCD_ON | HORZ_DIVBY2_EN | DISABLE_PCLK_RESET |
+ DIS_HOR_CRT_DIVBY2 | VCLK_DAC_PM_EN | XTALIN_PM_EN |
+ CRTC_RW_SELECT | USE_SHADOWED_VEND | USE_SHADOWED_ROWCUR |
+ SHADOW_EN | SHADOW_RW_EN);
+ pATIHW->lcd_gen_ctrl |= DONT_SHADOW_VPAR | LOCK_8DOT;
+
+ if (pATI->OptionCRT)
+ {
+ /*
+ * Use primary CRTC to drive the CRT. Turn off panel interface.
+ */
+ pATIHW->lcd_gen_ctrl |= CRT_ON;
+ }
+ else
+ {
+ /*
+ * Use primary CRTC to drive the panel. Turn off CRT interface.
+ */
+ pATIHW->lcd_gen_ctrl |= LCD_ON;
+
+ if (!pATI->OptionSync)
+ {
+ int HDisplay, VDisplay;
+
+ /*
+ * XXX
+ *
+ * Determine porch data. This is ugly and will be removed when
+ * a more panel-friendly mode validation scheme is finalised.
+ * The intent here is to produce stretched modes that
+ * approximate the horizontal sync and vertical refresh rates
+ * of the mode on server entry (which, BTW, hasn't been saved
+ * yet). The following is inaccurate (but still good enough)
+ * when BIOS initialisation has set things up so that the
+ * registers read here are not the ones actually in use by the
+ * panel.
+ */
+ if (inl(pATI->CPIO_CRTC_GEN_CNTL) & CRTC_EXT_DISP_EN)
+ {
+ pATIHW->crtc_h_total_disp =
+ inl(pATI->CPIO_CRTC_H_TOTAL_DISP);
+ pATIHW->crtc_h_sync_strt_wid =
+ inl(pATI->CPIO_CRTC_H_SYNC_STRT_WID);
+ pATIHW->crtc_v_total_disp =
+ inl(pATI->CPIO_CRTC_V_TOTAL_DISP);
+ pATIHW->crtc_v_sync_strt_wid =
+ inl(pATI->CPIO_CRTC_V_SYNC_STRT_WID);
+
+ HDisplay = GetBits(pATIHW->crtc_h_total_disp, CRTC_H_DISP);
+ VDisplay = GetBits(pATIHW->crtc_v_total_disp, CRTC_V_DISP);
+
+ pATI->LCDHSyncStart =
+ (GetBits(pATIHW->crtc_h_sync_strt_wid,
+ CRTC_H_SYNC_STRT_HI) *
+ (MaxBits(CRTC_H_SYNC_STRT) + 1)) +
+ GetBits(pATIHW->crtc_h_sync_strt_wid,
+ CRTC_H_SYNC_STRT) -
+ HDisplay;
+ pATI->LCDHSyncWidth =
+ GetBits(pATIHW->crtc_h_sync_strt_wid, CRTC_H_SYNC_WID);
+ pATI->LCDHBlankWidth =
+ GetBits(pATIHW->crtc_h_total_disp, CRTC_H_TOTAL) -
+ HDisplay;
+ pATI->LCDVSyncStart =
+ GetBits(pATIHW->crtc_v_sync_strt_wid,
+ CRTC_V_SYNC_STRT) -
+ VDisplay;
+ pATI->LCDVSyncWidth =
+ GetBits(pATIHW->crtc_v_sync_strt_wid, CRTC_V_SYNC_WID);
+ pATI->LCDVBlankWidth =
+ GetBits(pATIHW->crtc_v_total_disp, CRTC_V_TOTAL) -
+ VDisplay;
+ }
+ else
+ {
+ pATIHW->crt[0] = GetReg(CRTX(pATI->CPIO_VGABase), 0x00U);
+ pATIHW->crt[1] = GetReg(CRTX(pATI->CPIO_VGABase), 0x01U);
+ pATIHW->crt[4] = GetReg(CRTX(pATI->CPIO_VGABase), 0x04U);
+ pATIHW->crt[5] = GetReg(CRTX(pATI->CPIO_VGABase), 0x05U);
+ pATIHW->crt[6] = GetReg(CRTX(pATI->CPIO_VGABase), 0x06U);
+ pATIHW->crt[7] = GetReg(CRTX(pATI->CPIO_VGABase), 0x07U);
+ pATIHW->crt[16] = GetReg(CRTX(pATI->CPIO_VGABase), 0x10U);
+ pATIHW->crt[17] = GetReg(CRTX(pATI->CPIO_VGABase), 0x11U);
+ pATIHW->crt[18] = GetReg(CRTX(pATI->CPIO_VGABase), 0x12U);
+
+ HDisplay = pATIHW->crt[1] + 1;
+ VDisplay = (((pATIHW->crt[7] << 3) & 0x0200U) |
+ ((pATIHW->crt[7] << 7) & 0x0100U) |
+ pATIHW->crt[18]) + 1;
+
+ pATI->LCDHSyncStart = pATIHW->crt[4] - HDisplay;
+ pATI->LCDHSyncWidth =
+ (pATIHW->crt[5] - pATIHW->crt[4]) & 0x1FU;
+ pATI->LCDHBlankWidth = pATIHW->crt[0] + 5 - HDisplay;
+ pATI->LCDVSyncStart = (((pATIHW->crt[7] << 2) & 0x0200U) |
+ ((pATIHW->crt[7] << 6) & 0x0100U) |
+ pATIHW->crt[16]) - VDisplay;
+ pATI->LCDVSyncWidth =
+ (pATIHW->crt[17] - pATIHW->crt[16]) & 0x0FU;
+ pATI->LCDVBlankWidth = (((pATIHW->crt[7] << 4) & 0x0200U) |
+ ((pATIHW->crt[7] << 8) & 0x0100U) |
+ pATIHW->crt[6]) + 2 - VDisplay;
+ }
+
+ HDisplay <<= 3;
+ pATI->LCDHSyncStart <<= 3;
+ pATI->LCDHSyncWidth <<= 3;
+ pATI->LCDHBlankWidth <<= 3;
+
+ /* If the mode on entry wasn't stretched, adjust timings */
+ if (!(pATIHW->horz_stretching & HORZ_STRETCH_EN) &&
+ ((HDisplay = pATI->LCDHorizontal - HDisplay) > 0))
+ {
+ if ((pATI->LCDHSyncStart -= HDisplay) < 0)
+ pATI->LCDHSyncStart = 0;
+ pATI->LCDHBlankWidth -= HDisplay;
+ HDisplay = pATI->LCDHSyncStart + pATI->LCDHSyncWidth;
+ if (pATI->LCDHBlankWidth < HDisplay)
+ pATI->LCDHBlankWidth = HDisplay;
+ }
+
+ if (!(pATIHW->vert_stretching & VERT_STRETCH_EN) &&
+ ((VDisplay = pATI->LCDVertical - VDisplay) > 0))
+ {
+ if ((pATI->LCDVSyncStart -= VDisplay) < 0)
+ pATI->LCDVSyncStart = 0;
+ pATI->LCDVBlankWidth -= VDisplay;
+ VDisplay = pATI->LCDVSyncStart + pATI->LCDVSyncWidth;
+ if (pATI->LCDVBlankWidth < VDisplay)
+ pATI->LCDVBlankWidth = VDisplay;
+ }
+ }
+ }
+ }
+
+ /* Set RAMDAC data */
+ ATIDACPreInit(pScreenInfo, pATIHW);
+}
+
+/*
+ * ATIAdapterSave --
+ *
+ * This function saves the current video state.
+ */
+void
+ATIAdapterSave
+(
+ ScrnInfoPtr pScreenInfo,
+ ATIPtr pATI,
+ ATIHWPtr pATIHW
+)
+{
+ int Index;
+
+ /* Get bank to bank 0 */
+ (*pATIHW->SetBank)(pATI, 0);
+
+ /* Save clock data */
+ ATIClockSave(pScreenInfo, pATI, pATIHW);
+
+ if (pATI->Chip >= ATI_CHIP_264CT)
+ {
+ pATIHW->pll_vclk_cntl = ATIGetMach64PLLReg(PLL_VCLK_CNTL) |
+ PLL_VCLK_RESET;
+ if (pATI->Chip >= ATI_CHIP_264LT)
+ pATIHW->pll_ext_vpll_cntl = ATIGetMach64PLLReg(PLL_EXT_VPLL_CNTL);
+ }
+
+ /* Save LCD registers */
+ if (pATI->LCDPanelID >= 0)
+ {
+ if (pATI->Chip == ATI_CHIP_264LT)
+ {
+ pATIHW->horz_stretching = inl(pATI->CPIO_HORZ_STRETCHING);
+ pATIHW->vert_stretching = inl(pATI->CPIO_VERT_STRETCHING);
+ pATIHW->lcd_gen_ctrl = inl(pATI->CPIO_LCD_GEN_CTRL);
+
+ /* Set up to save non-shadow registers */
+ outl(pATI->CPIO_LCD_GEN_CTRL, pATIHW->lcd_gen_ctrl &
+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN));
+ }
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ pATIHW->lcd_index = inl(pATI->CPIO_LCD_INDEX);
+ pATIHW->config_panel = ATIGetLTProLCDReg(LCD_CONFIG_PANEL);
+ pATIHW->lcd_gen_ctrl = ATIGetLTProLCDReg(LCD_GEN_CNTL);
+ pATIHW->horz_stretching = ATIGetLTProLCDReg(LCD_HORZ_STRETCHING);
+ pATIHW->vert_stretching = ATIGetLTProLCDReg(LCD_VERT_STRETCHING);
+ pATIHW->ext_vert_stretch = ATIGetLTProLCDReg(LCD_EXT_VERT_STRETCH);
+
+ /* Set up to save non-shadow registers */
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, pATIHW->lcd_gen_ctrl &
+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN));
+ }
+ }
+
+ if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
+ {
+ /* Save VGA data */
+ ATIVGASave(pATI, pATIHW);
+
+ /* Save VGA Wonder data */
+ if (pATI->CPIO_VGAWonder)
+ ATIVGAWonderSave(pATI, pATIHW);
+ }
+
+ /* Save Mach64 data */
+ if (pATI->Chip >= ATI_CHIP_88800GXC)
+ ATIMach64Save(pATI, pATIHW);
+
+ /* Save DSP data */
+ if ((pATI->Chip >= ATI_CHIP_264VTB) && (pATI->CPIODecoding == BLOCK_IO))
+ ATIDSPSave(pATI, pATIHW);
+
+ if (pATI->LCDPanelID >= 0)
+ {
+ if (!pATI->OptionCRT)
+ {
+ /* Switch to shadow registers */
+ if (pATI->Chip == ATI_CHIP_264LT)
+ outl(pATI->CPIO_LCD_GEN_CTRL,
+ (pATIHW->lcd_gen_ctrl & ~CRTC_RW_SELECT) |
+ (SHADOW_EN | SHADOW_RW_EN));
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ ATIPutLTProLCDReg(LCD_GEN_CNTL,
+ (pATIHW->lcd_gen_ctrl & ~CRTC_RW_SELECT) |
+ (SHADOW_EN | SHADOW_RW_EN));
+
+ /* Save shadow VGA CRTC registers */
+ for (Index = 0; Index < NumberOf(pATIHW->shadow_vga); Index++)
+ pATIHW->shadow_vga[Index] =
+ GetReg(CRTX(pATI->CPIO_VGABase), Index);
+
+ /* Save shadow Mach64 CRTC registers */
+ pATIHW->shadow_h_total_disp = inl(pATI->CPIO_CRTC_H_TOTAL_DISP);
+ pATIHW->shadow_h_sync_strt_wid =
+ inl(pATI->CPIO_CRTC_H_SYNC_STRT_WID);
+ pATIHW->shadow_v_total_disp = inl(pATI->CPIO_CRTC_V_TOTAL_DISP);
+ pATIHW->shadow_v_sync_strt_wid =
+ inl(pATI->CPIO_CRTC_V_SYNC_STRT_WID);
+ }
+
+ /* Restore CRTC selection and shadow state */
+ if (pATI->Chip == ATI_CHIP_264LT)
+ outl(pATI->CPIO_LCD_GEN_CTRL, pATIHW->lcd_gen_ctrl);
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, pATIHW->lcd_gen_ctrl);
+ outl(pATI->CPIO_LCD_INDEX, pATIHW->lcd_index);
+ }
+ }
+
+ /*
+ * For some unknown reason, CLKDIV2 needs to be turned off to save the
+ * DAC's LUT reliably on VGA Wonder VLB adapters.
+ */
+ if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U))
+ PutReg(SEQX, 0x01U, pATIHW->seq[1] & ~0x08U);
+
+ /* Save RAMDAC state */
+ ATIDACSave(pATI, pATIHW);
+
+ if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U))
+ PutReg(SEQX, 0x01U, pATIHW->seq[1]);
+
+ /*
+ * The server has already saved video memory contents when switching out of
+ * its virtual console, so don't do it again.
+ */
+ if (pATIHW != &pATI->NewHW)
+ {
+ pATIHW->FeedbackDivider = 0; /* Don't programme clock */
+
+ ATISwap(pScreenInfo, pATI, pATIHW, FALSE); /* Save video memory */
+ }
+
+ if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
+ ATIVGASaveScreen(pATI, SCREEN_SAVER_OFF); /* Turn on screen */
+}
+
+/*
+ * ATIAdapterCalculate --
+ *
+ * This function fills in an ATIHWRec with all register values needed to enable
+ * a video state. It's important that this be done without modifying the
+ * current video state.
+ */
+Bool
+ATIAdapterCalculate
+(
+ ScrnInfoPtr pScreenInfo,
+ ATIPtr pATI,
+ ATIHWPtr pATIHW,
+ DisplayModePtr pMode
+)
+{
+ CARD32 lcd_index;
+ int Index;
+
+ /* Clobber mode timings */
+ if ((pATI->LCDPanelID >= 0) && !pATI->OptionCRT && !pATI->OptionSync &&
+ !pMode->CrtcHAdjusted && !pMode->CrtcVAdjusted)
+ {
+ int VScan;
+
+ pMode->Flags &= ~(V_DBLSCAN | V_INTERLACE | V_CLKDIV2);
+
+ /*
+ * Use doublescanning or multiscanning to get around vertical blending
+ * limitations.
+ */
+ VScan = pATI->LCDVertical / pMode->VDisplay;
+ switch (pATIHW->crtc)
+ {
+ case ATI_CRTC_VGA:
+ if (VScan > 64)
+ VScan = 64;
+ pMode->VScan = VScan;
+ break;
+
+ case ATI_CRTC_MACH64:
+ pMode->VScan = 0;
+ if (VScan <= 1)
+ break;
+ VScan = 2;
+ pMode->Flags |= V_DBLSCAN;
+ break;
+
+ default:
+ break;
+ }
+
+ pMode->HSyncStart = pMode->HDisplay + pATI->LCDHSyncStart;
+ pMode->HSyncEnd = pMode->HSyncStart + pATI->LCDHSyncWidth;
+ pMode->HTotal = pMode->HDisplay + pATI->LCDHBlankWidth;
+
+ pMode->VSyncStart = pMode->VDisplay +
+ ATIDivide(pATI->LCDVSyncStart, VScan, 0, 0);
+ pMode->VSyncEnd = pMode->VSyncStart +
+ ATIDivide(pATI->LCDVSyncWidth, VScan, 0, 1);
+ pMode->VTotal = pMode->VDisplay +
+ ATIDivide(pATI->LCDVBlankWidth, VScan, 0, 0);
+ }
+
+ switch (pATIHW->crtc)
+ {
+ case ATI_CRTC_VGA:
+ /* Fill in VGA data */
+ ATIVGACalculate(pATI, pATIHW, pMode);
+
+ /* Fill in VGA Wonder data */
+ if (pATI->CPIO_VGAWonder)
+ ATIVGAWonderCalculate(pScreenInfo, pATI, pATIHW, pMode);
+
+ if (pATI->Chip >= ATI_CHIP_88800GXC)
+ {
+ if (pATI->Chip >= ATI_CHIP_264CT)
+ {
+ /*
+ * Selected bits of accelerator & VGA CRTC registers are
+ * actually copies of each other.
+ */
+ pATIHW->crtc_h_total_disp =
+ SetBits(pMode->CrtcHTotal, CRTC_H_TOTAL) |
+ SetBits(pMode->CrtcHDisplay, CRTC_H_DISP);
+ pATIHW->crtc_h_sync_strt_wid =
+ SetBits(pMode->CrtcHSyncStart, CRTC_H_SYNC_STRT) |
+ SetBits(pMode->CrtcHSkew, CRTC_H_SYNC_DLY) | /* ? */
+ SetBits(GetBits(pMode->CrtcHSyncStart, 0x0100U),
+ CRTC_H_SYNC_STRT_HI) |
+ SetBits(pMode->CrtcHSyncEnd, CRTC_H_SYNC_WID);
+ if (pMode->Flags & V_NHSYNC)
+ pATIHW->crtc_h_sync_strt_wid |= CRTC_H_SYNC_POL;
+
+ pATIHW->crtc_v_total_disp =
+ SetBits(pMode->CrtcVTotal, CRTC_V_TOTAL) |
+ SetBits(pMode->CrtcVDisplay, CRTC_V_DISP);
+ pATIHW->crtc_v_sync_strt_wid =
+ SetBits(pMode->CrtcVSyncStart, CRTC_V_SYNC_STRT) |
+ SetBits(pMode->CrtcVSyncEnd, CRTC_V_SYNC_WID);
+ if (pMode->Flags & V_NVSYNC)
+ pATIHW->crtc_v_sync_strt_wid |= CRTC_V_SYNC_POL;
+ }
+
+ pATIHW->crtc_gen_cntl = inl(pATI->CPIO_CRTC_GEN_CNTL) &
+ ~(CRTC_DBL_SCAN_EN | CRTC_INTERLACE_EN |
+ CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | CRTC_CSYNC_EN |
+ CRTC_PIX_BY_2_EN | CRTC_DISPLAY_DIS |
+ CRTC_VGA_XOVERSCAN | CRTC_VGA_128KAP_PAGING |
+ CRTC_VFC_SYNC_TRISTATE |
+ CRTC_LOCK_REGS | /* Already off, but ... */
+ CRTC_SYNC_TRISTATE | CRTC_EXT_DISP_EN |
+ CRTC_DISP_REQ_EN | CRTC_VGA_LINEAR | CRTC_VGA_TEXT_132 |
+ CRTC_CUR_B_TEST);
+#if 0 /* This isn't needed, but is kept for reference */
+ if (pMode->Flags & V_DBLSCAN)
+ pATIHW->crtc_gen_cntl |= CRTC_DBL_SCAN_EN;
+#endif
+ if (pMode->Flags & V_INTERLACE)
+ pATIHW->crtc_gen_cntl |= CRTC_INTERLACE_EN;
+ if ((pMode->Flags & (V_CSYNC | V_PCSYNC)) || pATI->OptionCSync)
+ pATIHW->crtc_gen_cntl |= CRTC_CSYNC_EN;
+ if (pScreenInfo->depth <= 4)
+ pATIHW->crtc_gen_cntl |= CRTC_EN | CRTC_CNT_EN;
+ else
+ pATIHW->crtc_gen_cntl |=
+ CRTC_EN | CRTC_VGA_LINEAR | CRTC_CNT_EN;
+ }
+ break;
+
+ case ATI_CRTC_MACH64:
+ /* Fill in Mach64 data */
+ ATIMach64Calculate(pScreenInfo, pATI, pATIHW, pMode);
+ break;
+
+ default:
+ break;
+ }
+
+ /* Set up LCD register values */
+ if (pATI->LCDPanelID >= 0)
+ {
+ int VDisplay = pMode->VDisplay;
+
+ if (pMode->Flags & V_DBLSCAN)
+ VDisplay <<= 1;
+ if (pMode->VScan > 1)
+ VDisplay *= pMode->VScan;
+ if (pMode->Flags & V_INTERLACE)
+ VDisplay >>= 1;
+
+ if (pATI->Chip == ATI_CHIP_264LT)
+ pATIHW->horz_stretching = inl(pATI->CPIO_HORZ_STRETCHING);
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ lcd_index = inl(pATI->CPIO_LCD_INDEX);
+ pATIHW->horz_stretching = ATIGetLTProLCDReg(LCD_HORZ_STRETCHING);
+ pATIHW->ext_vert_stretch =
+ ATIGetLTProLCDReg(LCD_EXT_VERT_STRETCH) &
+ ~(AUTO_VERT_RATIO | VERT_STRETCH_MODE);
+
+ /*
+ * Don't use vertical blending if the mode is too wide or not
+ * vertically stretched.
+ */
+ if (!pATI->OptionCRT &&
+ (pMode->HDisplay <= pATI->LCDVBlendFIFOSize) &&
+ (VDisplay < pATI->LCDVertical))
+ pATIHW->ext_vert_stretch |= VERT_STRETCH_MODE;
+
+ outl(pATI->CPIO_LCD_INDEX, lcd_index);
+ }
+
+ pATIHW->horz_stretching &=
+ ~(HORZ_STRETCH_RATIO | HORZ_STRETCH_LOOP | AUTO_HORZ_RATIO |
+ HORZ_STRETCH_MODE | HORZ_STRETCH_EN);
+ if (!pATI->OptionCRT && (pMode->HDisplay < pATI->LCDHorizontal))
+ pATIHW->horz_stretching |= (HORZ_STRETCH_MODE | HORZ_STRETCH_EN) |
+ SetBits(((pMode->HDisplay & ~7) *
+ (MaxBits(HORZ_STRETCH_BLEND) + 1)) /
+ pATI->LCDHorizontal, HORZ_STRETCH_BLEND);
+
+ if (pATI->OptionCRT || (VDisplay >= pATI->LCDVertical))
+ pATIHW->vert_stretching = 0;
+ else
+ {
+ pATIHW->vert_stretching = (VERT_STRETCH_USE0 | VERT_STRETCH_EN) |
+ SetBits((VDisplay * (MaxBits(VERT_STRETCH_RATIO0) + 1)) /
+ pATI->LCDVertical, VERT_STRETCH_RATIO0);
+ }
+
+ if (!pATI->OptionCRT)
+ {
+ /* Copy non-shadow CRTC register values to the shadow set */
+ for (Index = 0; Index < NumberOf(pATIHW->shadow_vga); Index++)
+ pATIHW->shadow_vga[Index] = pATIHW->crt[Index];
+
+ pATIHW->shadow_h_total_disp = pATIHW->crtc_h_total_disp;
+ pATIHW->shadow_h_sync_strt_wid = pATIHW->crtc_h_sync_strt_wid;
+ pATIHW->shadow_v_total_disp = pATIHW->crtc_v_total_disp;
+ pATIHW->shadow_v_sync_strt_wid = pATIHW->crtc_v_sync_strt_wid;
+ }
+ }
+
+ /* Fill in clock data */
+ return ATIClockCalculate(pScreenInfo, pATI, pATIHW, pMode);
+}
+
+/*
+ * ATIAdapterSet --
+ *
+ * This function sets a video mode. It writes out all video state data that
+ * has been previously calculated or saved.
+ */
+void
+ATIAdapterSet
+(
+ ScrnInfoPtr pScreenInfo,
+ ATIPtr pATI,
+ ATIHWPtr pATIHW
+)
+{
+ int Index;
+
+ /* Get back to bank 0 */
+ (*pATIHW->SetBank)(pATI, 0);
+
+ if (pATI->Chip >= ATI_CHIP_264CT)
+ {
+ ATIPutMach64PLLReg(PLL_VCLK_CNTL, pATIHW->pll_vclk_cntl);
+ ATIPutMach64PLLReg(PLL_VCLK_CNTL,
+ pATIHW->pll_vclk_cntl & ~PLL_VCLK_RESET);
+ if (pATI->Chip >= ATI_CHIP_264LT)
+ ATIPutMach64PLLReg(PLL_EXT_VPLL_CNTL, pATIHW->pll_ext_vpll_cntl);
+ }
+
+ /* Load LCD registers */
+ if (pATI->LCDPanelID >= 0)
+ {
+ /* Stop CRTC */
+ outl(pATI->CPIO_CRTC_GEN_CNTL, pATIHW->crtc_gen_cntl &
+ ~(CRTC_EXT_DISP_EN | CRTC_EN));
+
+ if (pATI->Chip == ATI_CHIP_264LT)
+ {
+ /* Update non-shadow registers first */
+ outl(pATI->CPIO_LCD_GEN_CTRL, pATIHW->lcd_gen_ctrl &
+ ~(DISABLE_PCLK_RESET | CRTC_RW_SELECT |
+ SHADOW_EN | SHADOW_RW_EN));
+
+ /* Temporarily disable stretching */
+ outl(pATI->CPIO_HORZ_STRETCHING, pATIHW->horz_stretching &
+ ~(HORZ_STRETCH_MODE | HORZ_STRETCH_EN));
+ outl(pATI->CPIO_VERT_STRETCHING, pATIHW->vert_stretching &
+ ~(VERT_STRETCH_RATIO1 | VERT_STRETCH_RATIO2 |
+ VERT_STRETCH_USE0 | VERT_STRETCH_EN));
+ }
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ /* Update non-shadow registers first */
+ ATIPutLTProLCDReg(LCD_CONFIG_PANEL, pATIHW->config_panel);
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, pATIHW->lcd_gen_ctrl &
+ ~(DISABLE_PCLK_RESET | CRTC_RW_SELECT |
+ SHADOW_EN | SHADOW_RW_EN));
+
+ /* Temporarily disable stretching */
+ ATIPutLTProLCDReg(LCD_HORZ_STRETCHING, pATIHW->horz_stretching &
+ ~(HORZ_STRETCH_MODE | HORZ_STRETCH_EN));
+ ATIPutLTProLCDReg(LCD_VERT_STRETCHING, pATIHW->vert_stretching &
+ ~(VERT_STRETCH_RATIO1 | VERT_STRETCH_RATIO2 |
+ VERT_STRETCH_USE0 | VERT_STRETCH_EN));
+ }
+ }
+
+ switch (pATIHW->crtc)
+ {
+ case ATI_CRTC_VGA:
+ /* Stop CRTC */
+ if (pATI->Chip >= ATI_CHIP_88800GXC)
+ outl(pATI->CPIO_CRTC_GEN_CNTL,
+ pATIHW->crtc_gen_cntl & ~CRTC_EN);
+
+ /* Start sequencer reset */
+ PutReg(SEQX, 0x00U, 0x00U);
+
+ /* Set pixel clock */
+ if ((pATIHW->FeedbackDivider > 0) &&
+ (pATI->ProgrammableClock != ATI_CLOCK_FIXED))
+ ATIClockSet(pATI, pATIHW);
+
+ /* Load VGA Wonder */
+ if (pATI->CPIO_VGAWonder)
+ ATIVGAWonderSet(pATI, pATIHW);
+
+ /* Load VGA device */
+ ATIVGASet(pATI, pATIHW);
+
+ /* Load Mach64 registers */
+ if (pATI->Chip >= ATI_CHIP_88800GXC)
+ {
+ outl(pATI->CPIO_CRTC_GEN_CNTL, pATIHW->crtc_gen_cntl);
+ outl(pATI->CPIO_MEM_VGA_WP_SEL, pATIHW->mem_vga_wp_sel);
+ outl(pATI->CPIO_MEM_VGA_RP_SEL, pATIHW->mem_vga_rp_sel);
+ outl(pATI->CPIO_CONFIG_CNTL, pATIHW->config_cntl);
+ if (pATI->Chip >= ATI_CHIP_264CT)
+ {
+ outl(pATI->CPIO_CRTC_H_TOTAL_DISP,
+ pATIHW->crtc_h_total_disp);
+ outl(pATI->CPIO_CRTC_H_SYNC_STRT_WID,
+ pATIHW->crtc_h_sync_strt_wid);
+ outl(pATI->CPIO_CRTC_V_TOTAL_DISP,
+ pATIHW->crtc_v_total_disp);
+ outl(pATI->CPIO_CRTC_V_SYNC_STRT_WID,
+ pATIHW->crtc_v_sync_strt_wid);
+ outl(pATI->CPIO_CRTC_OFF_PITCH, pATIHW->crtc_off_pitch);
+ outl(pATI->CPIO_BUS_CNTL, pATIHW->bus_cntl);
+ outl(pATI->CPIO_DAC_CNTL, pATIHW->dac_cntl);
+ }
+ }
+
+ break;
+
+ case ATI_CRTC_MACH64:
+ /* Load Mach64 CRTC registers */
+ ATIMach64Set(pATI, pATIHW);
+
+ if (pATI->UseSmallApertures)
+ {
+ /* Oddly enough, these need to be set also, maybe others */
+ PutReg(SEQX, 0x02U, pATIHW->seq[2]);
+ PutReg(SEQX, 0x04U, pATIHW->seq[4]);
+ PutReg(GRAX, 0x06U, pATIHW->gra[6]);
+ if (pATI->CPIO_VGAWonder)
+ ATIModifyExtReg(pATI, 0xB6U, -1, 0x00U, pATIHW->b6);
+ }
+
+ break;
+
+ default:
+ break;
+ }
+
+ if (pATI->LCDPanelID >= 0)
+ {
+ if (!pATI->OptionCRT &&
+ (!pATI->OptionDevel || (pATIHW == &pATI->OldHW)))
+ {
+ /* Switch to shadow registers */
+ if (pATI->Chip == ATI_CHIP_264LT)
+ outl(pATI->CPIO_LCD_GEN_CTRL,
+ (pATIHW->lcd_gen_ctrl &
+ ~(DISABLE_PCLK_RESET | CRTC_RW_SELECT)) |
+ (SHADOW_EN | SHADOW_RW_EN));
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ ATIPutLTProLCDReg(LCD_GEN_CNTL,
+ (pATIHW->lcd_gen_ctrl &
+ ~(DISABLE_PCLK_RESET | CRTC_RW_SELECT)) |
+ (SHADOW_EN | SHADOW_RW_EN));
+
+ /* Restore shadow registers */
+ switch (pATIHW->crtc)
+ {
+ case ATI_CRTC_VGA:
+ for (Index = 0;
+ Index < NumberOf(pATIHW->shadow_vga);
+ Index++)
+ PutReg(CRTX(pATI->CPIO_VGABase), Index,
+ pATIHW->shadow_vga[Index]);
+ /* Fall through */
+
+ case ATI_CRTC_MACH64:
+ outl(pATI->CPIO_CRTC_H_TOTAL_DISP,
+ pATIHW->shadow_h_total_disp);
+ outl(pATI->CPIO_CRTC_H_SYNC_STRT_WID,
+ pATIHW->shadow_h_sync_strt_wid);
+ outl(pATI->CPIO_CRTC_V_TOTAL_DISP,
+ pATIHW->shadow_v_total_disp);
+ outl(pATI->CPIO_CRTC_V_SYNC_STRT_WID,
+ pATIHW->shadow_v_sync_strt_wid);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ /* Restore CRTC selection & shadow state and enable stretching */
+ if (pATI->Chip == ATI_CHIP_264LT)
+ {
+ outl(pATI->CPIO_LCD_GEN_CTRL, pATIHW->lcd_gen_ctrl);
+ outl(pATI->CPIO_HORZ_STRETCHING, pATIHW->horz_stretching);
+ outl(pATI->CPIO_VERT_STRETCHING, pATIHW->vert_stretching);
+ }
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, pATIHW->lcd_gen_ctrl);
+ ATIPutLTProLCDReg(LCD_HORZ_STRETCHING, pATIHW->horz_stretching);
+ ATIPutLTProLCDReg(LCD_VERT_STRETCHING, pATIHW->vert_stretching);
+ ATIPutLTProLCDReg(LCD_EXT_VERT_STRETCH, pATIHW->ext_vert_stretch);
+ outl(pATI->CPIO_LCD_INDEX, pATIHW->lcd_index);
+ }
+ }
+
+ /*
+ * Set DSP registers. Note that, for some reason, sequencer resets clear
+ * the DSP_CONFIG register on early integrated controllers.
+ */
+ if ((pATI->Chip >= ATI_CHIP_264VTB) && (pATI->CPIODecoding == BLOCK_IO))
+ ATIDSPSet(pATI, pATIHW);
+
+ /* Load RAMDAC */
+ ATIDACSet(pATI, pATIHW);
+
+ /* Restore video memory */
+ ATISwap(pScreenInfo, pATI, pATIHW, TRUE);
+
+ if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
+ ATIVGASaveScreen(pATI, SCREEN_SAVER_OFF); /* Turn on screen */
+
+ if ((xf86GetVerbosity() > 3) && (pATIHW == &pATI->NewHW))
+ {
+ xf86ErrorFVerb(4, "\n After setting mode \"%s\":\n\n",
+ pScreenInfo->currentMode->name);
+ ATIPrintMode(pScreenInfo->currentMode);
+ ATIPrintRegisters(pATI);
+ }
+}
+
+/*
+ * ATIAdapterAccelInit --
+ *
+ * This function is called to initialise XAA on a screen.
+ */
+Bool
+ATIAdapterAccelInit
+(
+ ScrnInfoPtr pScreenInfo,
+ ScreenPtr pScreen,
+ ATIPtr pATI
+)
+{
+ BoxRec ScreenArea;
+
+ if (!pATI->OptionAccel)
+ return TRUE;
+
+ if (!(pATI->pXAAInfo = XAACreateInfoRec()))
+ return FALSE;
+
+ switch (pATI->Adapter)
+ {
+ case ATI_ADAPTER_MACH64:
+ if (ATIMach64AccelInit(pScreenInfo, pScreen, pATI, pATI->pXAAInfo))
+ break;
+
+ default:
+ XAADestroyInfoRec(pATI->pXAAInfo);
+ pATI->pXAAInfo = NULL;
+ return FALSE;
+ }
+
+ ScreenArea.x1 = ScreenArea.y1 = 0;
+ ScreenArea.x2 = pScreenInfo->displayWidth;
+ ScreenArea.y2 = pScreenInfo->videoRam * 1024 * 8 /
+ pScreenInfo->displayWidth / pScreenInfo->bitsPerPixel;
+ xf86InitFBManager(pScreen, &ScreenArea);
+
+ if (XAAInit(pScreen, pATI->pXAAInfo))
+ return TRUE;
+
+ XAADestroyInfoRec(pATI->pXAAInfo);
+ pATI->pXAAInfo = NULL;
+ return FALSE;
+}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h
index 03d81d6ac..f616c35e4 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h,v 1.4 1999/10/13 20:33:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h,v 1.5 2000/02/18 12:19:12 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -24,6 +24,10 @@
#ifndef ___ATIADAPTER_H___
#define ___ATIADAPTER_H___ 1
+#include "atipriv.h"
+#include "atiproto.h"
+#include "xf86str.h"
+
/*
* Adapter-related definitions.
*/
@@ -50,4 +54,16 @@ typedef enum
extern const char *ATIAdapterNames[];
+extern void ATIAdapterPreInit FunctionPrototype((ScrnInfoPtr, ATIPtr,
+ ATIHWPtr));
+extern void ATIAdapterSave FunctionPrototype((ScrnInfoPtr, ATIPtr,
+ ATIHWPtr));
+extern Bool ATIAdapterCalculate FunctionPrototype((ScrnInfoPtr, ATIPtr,
+ ATIHWPtr, DisplayModePtr));
+extern void ATIAdapterSet FunctionPrototype((ScrnInfoPtr, ATIPtr,
+ ATIHWPtr));
+
+extern Bool ATIAdapterAccelInit FunctionPrototype((ScrnInfoPtr, ScreenPtr,
+ ATIPtr));
+
#endif /* ___ATIADAPTER_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c
index bf419c186..cfa1da278 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.4 1999/08/01 07:57:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.5 2000/02/18 12:19:12 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -127,7 +127,7 @@ ATIAdjustPreInit
/*
* ATIAdjustFrame --
*
- * This function is used to initialize the SVGA Start Address - the first
+ * This function is used to initialise the SVGA Start Address - the first
* displayed location in video memory. This is used to implement the virtual
* window.
*/
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h
index 2685eb887..33cac5c6a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h,v 1.3 1999/07/06 11:38:23 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h,v 1.4 2000/02/18 12:19:12 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c
index b420cf802..fc356b56c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c,v 1.4 1999/08/01 07:57:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c,v 1.5 2000/02/18 12:19:13 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h
index fbf6ce7e4..1473c31bb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h,v 1.3 1999/07/06 11:38:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h,v 1.4 2000/02/18 12:19:13 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.c
index 03a57c256..3ca1adc95 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.c,v 1.4 1999/09/27 06:29:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.c,v 1.5 2000/02/18 12:19:14 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.h
index 3c3878e03..43fd902ac 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.h,v 1.1 1999/08/01 07:57:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibios.h,v 1.2 2000/02/18 12:19:14 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c
index f841511e6..788fa1fb8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c,v 1.5 1999/08/21 13:48:30 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c,v 1.6 2000/02/18 12:19:14 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h
index 98ad93326..a5b1bdd9e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h,v 1.4 1999/08/01 07:57:19 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h,v 1.5 2000/02/18 12:19:15 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c
index 82889e1f0..c8464f413 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c,v 1.8 1999/10/13 20:33:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c,v 1.9 2000/02/18 12:19:15 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h
index ddd6e624a..e9b46c370 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h,v 1.8 1999/10/13 20:33:01 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h,v 1.9 2000/02/18 12:19:16 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -87,7 +87,7 @@ typedef enum
ATI_FOUNDRY_NEC, /* NEC */
ATI_FOUNDRY_KSC, /* KSC (?) */
ATI_FOUNDRY_UMC, /* United Microelectronics Corporation */
- ATI_FOUNDRY_TSMC, /* TSMC (?) */
+ ATI_FOUNDRY_TSMC, /* Taiwan Semiconductor Manufacturing Company */
ATI_FOUNDRY_5,
ATI_FOUNDRY_6,
ATI_FOUNDRY_UMCA /* UMC alternate */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c
index 0735ecdff..e1a5c3a10 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c,v 1.8 1999/11/18 16:52:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c,v 1.9 2000/02/18 12:19:16 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -55,59 +55,65 @@
* R E G I S T E R S
* 1CE 1CE 3C2 3C2 Frequency
* B9h BEh (MHz) 18811-0 18811-1
- * Bit 1 Bit 4 Bit 3 Bit 2 18810 18812-0 18811-2
- * ------- ------- ------- ------- ------- ------- -------
- * 0 0 0 0 30.240 30.240 135.000
- * 0 0 0 1 32.000 32.000 32.000
- * 0 0 1 0 37.500 110.000 110.000
- * 0 0 1 1 39.000 80.000 80.000
- * 0 1 0 0 42.954 42.954 100.000
- * 0 1 0 1 48.771 48.771 126.000
- * 0 1 1 0 (*1) 92.400 92.400
- * 0 1 1 1 36.000 36.000 36.000
- * 1 0 0 0 40.000 39.910 39.910
- * 1 0 0 1 (*4) 44.900 44.900
- * 1 0 1 0 75.000 75.000 75.000
- * 1 0 1 1 65.000 65.000 65.000
- * 1 1 0 0 50.350 50.350 50.350
- * 1 1 0 1 56.640 56.640 56.640
- * 1 1 1 0 (*2) (*3) (*3)
- * 1 1 1 1 44.900 44.900 44.900
+ * Bit 1 Bit 4 Bit 3 Bit 2 18810 18812-0 18811-2 (*5)
+ * ------- ------- ------- ------- ------- ------- ------- -------
+ * 0 0 0 0 30.240 30.240 135.000 75.000
+ * 0 0 0 1 32.000 32.000 32.000 77.500
+ * 0 0 1 0 37.500 110.000 110.000 80.000
+ * 0 0 1 1 39.000 80.000 80.000 90.000
+ * 0 1 0 0 42.954 42.954 100.000 25.175
+ * 0 1 0 1 48.771 48.771 126.000 28.322
+ * 0 1 1 0 (*1) 92.400 92.400 31.500
+ * 0 1 1 1 36.000 36.000 36.000 36.000
+ * 1 0 0 0 40.000 39.910 39.910 100.000
+ * 1 0 0 1 (*4) 44.900 44.900 110.000
+ * 1 0 1 0 75.000 75.000 75.000 126.000
+ * 1 0 1 1 65.000 65.000 65.000 135.000
+ * 1 1 0 0 50.350 50.350 50.350 40.000
+ * 1 1 0 1 56.640 56.640 56.640 44.900
+ * 1 1 1 0 (*2) (*3) (*3) 50.000
+ * 1 1 1 1 44.900 44.900 44.900 65.000
*
* (*1) External 0 (supposedly 16.657 Mhz)
* (*2) External 1 (supposedly 28.322 MHz)
* (*3) This setting doesn't seem to generate anything
* (*4) This setting is documented to be 56.644 MHz, but something close to 82
* MHz has also been encountered.
+ * (*5) This setting is for Dell OmniPlex 590 systems, with a 68800AX on the
+ * motherboard, along with an AT&T21C498 DAC (which is reported as an
+ * STG1700) and ICS2494AM clock generator (a.k.a. ATI 18811-?).
*
* Mach32 Clock Frequencies
* R E G I S T E R S
* 1CE 1CE 3C2 3C2 Frequency
* B9h BEh (MHz) 18811-0 18811-1
- * Bit 1 Bit 4 Bit 3 Bit 2 18810 18812-0 18811-2
- * ------- ------- ------- ------- ------- ------- -------
- * 0 0 0 0 42.954 42.954 100.000
- * 0 0 0 1 48.771 48.771 126.000
- * 0 0 1 0 (*1) 92.400 92.400
- * 0 0 1 1 36.000 36.000 36.000
- * 0 1 0 0 30.240 30.240 135.000
- * 0 1 0 1 32.000 32.000 32.000
- * 0 1 1 0 37.500 110.000 110.000
- * 0 1 1 1 39.000 80.000 80.000
- * 1 0 0 0 50.350 50.350 50.350
- * 1 0 0 1 56.640 56.640 56.640
- * 1 0 1 0 (*2) (*3) (*3)
- * 1 0 1 1 44.900 44.900 44.900
- * 1 1 0 0 40.000 39.910 39.910
- * 1 1 0 1 (*4) 44.900 44.900
- * 1 1 1 0 75.000 75.000 75.000
- * 1 1 1 1 65.000 65.000 65.000
+ * Bit 1 Bit 4 Bit 3 Bit 2 18810 18812-0 18811-2 (*5)
+ * ------- ------- ------- ------- ------- ------- ------- -------
+ * 0 0 0 0 42.954 42.954 100.000 25.175
+ * 0 0 0 1 48.771 48.771 126.000 28.322
+ * 0 0 1 0 (*1) 92.400 92.400 31.500
+ * 0 0 1 1 36.000 36.000 36.000 36.000
+ * 0 1 0 0 30.240 30.240 135.000 75.000
+ * 0 1 0 1 32.000 32.000 32.000 77.500
+ * 0 1 1 0 37.500 110.000 110.000 80.000
+ * 0 1 1 1 39.000 80.000 80.000 90.000
+ * 1 0 0 0 50.350 50.350 50.350 40.000
+ * 1 0 0 1 56.640 56.640 56.640 44.900
+ * 1 0 1 0 (*2) (*3) (*3) 50.000
+ * 1 0 1 1 44.900 44.900 44.900 65.000
+ * 1 1 0 0 40.000 39.910 39.910 100.000
+ * 1 1 0 1 (*4) 44.900 44.900 110.000
+ * 1 1 1 0 75.000 75.000 75.000 126.000
+ * 1 1 1 1 65.000 65.000 65.000 135.000
*
* (*1) External 0 (supposedly 16.657 Mhz)
* (*2) External 1 (supposedly 28.322 MHz)
* (*3) This setting doesn't seem to generate anything
* (*4) This setting is documented to be 56.644 MHz, but something close to 82
* MHz has also been encountered.
+ * (*5) This setting is for Dell OmniPlex 590 systems, with a 68800AX on the
+ * motherboard, along with an AT&T21C498 DAC (which is reported as an
+ * STG1700) and ICS2494AM clock generator (a.k.a. ATI 18811-?).
*
* Note that, to reduce confusion, this driver masks out the different clock
* ordering.
@@ -131,7 +137,7 @@
* same way as it would for a Mach32.
*
* All other Mach64 adapters use a programmable clock generator. BIOS
- * initialization programmes an initial set of frequencies. Two of these are
+ * initialisation programmes an initial set of frequencies. Two of these are
* reserved to allow for the setting of modes that do not use a frequency from
* this initial set. One of these reserved slots is used by the BIOS mode set
* routine, the other by the particular accelerated driver used (MS-Windows,
@@ -169,7 +175,7 @@
*
* For all supported programmable clock generators, the driver will ignore any
* XF86Config clock line and programme, as needed, the clock number reserved by
- * the BIOS for accelerated drivers. The driver's mode initialization routine
+ * the BIOS for accelerated drivers. The driver's mode initialisation routine
* finds integers N, M and D such that
*
* N
@@ -204,6 +210,7 @@ const char *ATIClockNames[] =
"ATI 18810 or similar",
"ATI 18811-0 or similar",
"ATI 18811-1 or similar",
+ "ICS 2494-AM or similar",
"Programmable (BIOS setting 1)",
"Programmable (BIOS setting 2)",
"Programmable (BIOS setting 3)"
@@ -296,6 +303,11 @@ ATI188111Frequencies[] =
135000, 32000, 110000, 80000, 100000, 126000, 92400, 36000,
39910, 44900, 75000, 65000, 50350, 56640, 0, 44900
},
+ATI2494AMFrequencies[] =
+{
+ 75000, 77500, 80000, 90000, 25175, 28322, 31500, 36000,
+ 100000, 110000, 126000, 135000, 40000, 44900, 50000, 65000
+},
ATIMach64AFrequencies[] =
{
0, 110000, 126000, 135000, 50350, 56640, 63000, 72000,
@@ -319,6 +331,7 @@ ATIMach64CFrequencies[] =
ATI18810Frequencies,
ATI188110Frequencies,
ATI188111Frequencies,
+ ATI2494AMFrequencies,
ATIMach64AFrequencies,
ATIMach64BFrequencies,
ATIMach64CFrequencies,
@@ -348,13 +361,19 @@ ATIPre_2_1_1_Clocks_C[] = /* Based on 18811-1 (or -2) */
135000, 32000, 110000, 80000, 39910, 44900, 75000, 65000,
-1
},
-ATIPre_2_1_1_Clocks_D[] = /* Based on programmable setting 1 */
+ATIPre_2_1_1_Clocks_D[] = /* Based on ICS 2494AM */
+{
+ 18000, 32500, 20000, 22450, 36000, 65000, 40000, 44900,
+ 75000, 77500, 80000, 90000, 100000, 110000, 126000, 135000,
+ -1
+},
+ATIPre_2_1_1_Clocks_E[] = /* Based on programmable setting 1 */
{
36000, 25000, 20000, 22450, 72000, 50000, 40000, 44900,
0, 110000, 126000, 135000, 0, 80000, 75000, 65000,
-1
},
-ATIPre_2_1_1_Clocks_E[] = /* Based on programmable setting 2 */
+ATIPre_2_1_1_Clocks_F[] = /* Based on programmable setting 2 */
{
18000, 25000, 20000, 22450, 36000, 50000, 40000, 44900,
0, 110000, 126000, 135000, 0, 80000, 75000, 65000,
@@ -369,6 +388,7 @@ ATIPre_2_1_1_Clocks_E[] = /* Based on programmable setting 2 */
ATIPre_2_1_1_Clocks_C,
ATIPre_2_1_1_Clocks_D,
ATIPre_2_1_1_Clocks_E,
+ ATIPre_2_1_1_Clocks_F,
NULL
};
@@ -542,6 +562,11 @@ ATIMatchClockLine
{
int MaximumGap = 0, ClockCount = 0, ClockIndex = 0;
+ /* Only Mach64's and Rage128's can have programmable clocks */
+ if ((ClockChipIndex >= ATI_CLOCK_MACH64A) &&
+ (pATI->Adapter < ATI_ADAPTER_MACH64))
+ break;
+
for (; ClockIndex < NumberOfClocks; ClockIndex++)
{
int Gap, XF86ConfigClock, SpecificationClock;
@@ -578,7 +603,7 @@ ATIMatchClockLine
break;
SkipThisClockGenerator:
- /* For non-ATI adapters, only normalize standard VGA clocks */
+ /* For non-ATI adapters, only normalise standard VGA clocks */
if (pATI->Adapter == ATI_ADAPTER_VGA)
break;
}
@@ -626,7 +651,7 @@ ATIClockPreInit
else
{
/*
- * Recognize supported clock generators. This involves telling the
+ * Recognise supported clock generators. This involves telling the
* rest of the server about it and (re-)initializing the XF86Config
* clocks line.
*/
@@ -712,8 +737,8 @@ ProbeClocks:
else
{
NumberOfUndividedClocks = 16;
- CalibrationClockNumber = 10 /* or 11 */;
- CalibrationClockValue = 75000 /* or 65000 */;
+ CalibrationClockNumber = 7;
+ CalibrationClockValue = 36000;
if (pATI->Chip >= ATI_CHIP_68800)
{
NumberOfDividers = 2;
@@ -724,6 +749,11 @@ ProbeClocks:
CalibrationClockNumber = 1;
CalibrationClockValue = 28322;
}
+ else if (pATI->Adapter >= ATI_ADAPTER_MACH64)
+ {
+ CalibrationClockNumber = 10 /* or 11 */;
+ CalibrationClockValue = 75000 /* or 65000 */;
+ }
/*
* When selecting clocks, all ATI accelerators use a different
@@ -751,7 +781,7 @@ ProbeClocks:
/*
* Respect any XF86Config clocks line. Well, that's the theory, anyway.
* In practice, however, the regular use of probed values is widespread, at
- * times causing otherwise inexplicable results. So, attempt to normalize
+ * times causing otherwise inexplicable results. So, attempt to normalise
* the clocks to known (i.e. specification) values.
*/
if (!pGDev->numclocks || pATI->OptionProbeClocks ||
@@ -761,7 +791,7 @@ ProbeClocks:
{
/*
* For unsupported programmable clock generators, pick the highest
- * frequency set by BIOS initialization for clock calibration.
+ * frequency set by BIOS initialisation for clock calibration.
*/
CalibrationClockNumber = CalibrationClockValue = 0;
for (ClockIndex = 0;
@@ -787,7 +817,7 @@ ProbeClocks:
* greater than what the adapter can handle.
*/
ATIMapApertures(pScreenInfo, pATI);
- ATICRTCSave(pScreenInfo, pATI, &pATI->OldHW);
+ ATIAdapterSave(pScreenInfo, pATI, &pATI->OldHW);
}
switch (pATI->OldHW.crtc)
@@ -813,7 +843,7 @@ ProbeClocks:
if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
{
/* Restore video state */
- ATICRTCSet(pScreenInfo, pATI, &pATI->OldHW);
+ ATIAdapterSet(pScreenInfo, pATI, &pATI->OldHW);
ATIUnmapApertures(pScreenInfo, pATI);
xfree(pATI->OldHW.frame_buffer);
pATI->OldHW.frame_buffer = NULL;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h
index 4ca2d613b..7378afa83 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h,v 1.3 1999/07/06 11:38:26 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h,v 1.4 2000/02/18 12:19:18 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -39,6 +39,7 @@ typedef enum
ATI_CLOCK_18810,
ATI_CLOCK_18811_0,
ATI_CLOCK_18811_1,
+ ATI_CLOCK_2494AM,
ATI_CLOCK_MACH64A,
ATI_CLOCK_MACH64B,
ATI_CLOCK_MACH64C
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c
index b90041ecc..141d3ac10 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c,v 1.5 1999/09/27 06:29:40 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c,v 1.10 2000/02/18 12:19:19 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,6 +21,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include "atiadapter.h"
#include "aticonsole.h"
#include "aticrtc.h"
#include "atilock.h"
@@ -33,20 +34,19 @@
/*
* ATISaveScreen --
*
- * DIX calls this function to blank (On == FALSE) or unblank (On == TRUE) the
- * screen.
+ * This function is a screen saver hook for DIX.
*/
Bool
ATISaveScreen
(
ScreenPtr pScreen,
- int On
+ int Mode
)
{
ScrnInfoPtr pScreenInfo;
ATIPtr pATI;
- if (On)
+ if ((Mode != SCREEN_SAVER_ON) && (Mode != SCREEN_SAVER_CYCLE))
SetTimeSinceLastInputEvent();
if (!pScreen)
@@ -60,11 +60,11 @@ ATISaveScreen
switch (pATI->NewHW.crtc)
{
case ATI_CRTC_VGA:
- ATIVGASaveScreen(pATI, On);
+ ATIVGASaveScreen(pATI, Mode);
break;
case ATI_CRTC_MACH64:
- ATIMach64SaveScreen(pATI, On);
+ ATIMach64SaveScreen(pATI, Mode);
break;
default:
@@ -96,21 +96,21 @@ ATIEnterGraphics
/* Calculate hardware data */
if (pScreen &&
- !ATICRTCCalculate(pScreenInfo, pATI, &pATI->NewHW,
- pScreenInfo->currentMode))
+ !ATIAdapterCalculate(pScreenInfo, pATI, &pATI->NewHW,
+ pScreenInfo->currentMode))
return FALSE;
pScreenInfo->vtSema = TRUE;
/* Save current state */
- ATICRTCSave(pScreenInfo, pATI, &pATI->OldHW);
+ ATIAdapterSave(pScreenInfo, pATI, &pATI->OldHW);
/* Set graphics state */
- ATICRTCSet(pScreenInfo, pATI, &pATI->NewHW);
+ ATIAdapterSet(pScreenInfo, pATI, &pATI->NewHW);
/* Possibly blank the screen */
if (pScreen)
- (void)ATISaveScreen(pScreen, FALSE);
+ (void)ATISaveScreen(pScreen, SCREEN_SAVER_ON);
/* Position the screen */
(*pScreenInfo->AdjustFrame)(pScreenInfo->scrnIndex,
@@ -137,10 +137,10 @@ ATILeaveGraphics
{
/* If not exiting, save graphics video state */
if (!xf86ServerIsExiting())
- ATICRTCSave(pScreenInfo, pATI, &pATI->NewHW);
+ ATIAdapterSave(pScreenInfo, pATI, &pATI->NewHW);
/* Restore mode in effect on server entry */
- ATICRTCSet(pScreenInfo, pATI, &pATI->OldHW);
+ ATIAdapterSet(pScreenInfo, pATI, &pATI->OldHW);
pScreenInfo->vtSema = FALSE;
}
@@ -171,12 +171,12 @@ ATISwitchMode
ATIPtr pATI = ATIPTR(pScreenInfo);
/* Calculate new hardware data */
- if (!ATICRTCCalculate(pScreenInfo, pATI, &pATI->NewHW, pMode))
+ if (!ATIAdapterCalculate(pScreenInfo, pATI, &pATI->NewHW, pMode))
return FALSE;
/* Set new hardware state */
if (pScreenInfo->vtSema)
- ATICRTCSet(pScreenInfo, pATI, &pATI->NewHW);
+ ATIAdapterSet(pScreenInfo, pATI, &pATI->NewHW);
SetTimeSinceLastInputEvent();
@@ -198,17 +198,37 @@ ATIEnterVT
ScrnInfoPtr pScreenInfo = xf86Screens[iScreen];
ScreenPtr pScreen = pScreenInfo->pScreen;
ATIPtr pATI = ATIPTR(pScreenInfo);
+ PixmapPtr pScreenPixmap;
+ DevUnion PixmapPrivate;
+ Bool Entered;
if (!ATIEnterGraphics(NULL, pScreenInfo, pATI))
return FALSE;
+ /* The rest of this isn't needed for shadowfb */
+ if (pATI->OptionShadowFB)
+ return TRUE;
+
/* If used, modify banking interface */
if (!miModifyBanking(pScreen, &pATI->BankInfo))
return FALSE;
+ pScreenPixmap = (*pScreen->GetScreenPixmap)(pScreen);
+ PixmapPrivate = pScreenPixmap->devPrivate;
+ if (!PixmapPrivate.ptr)
+ pScreenPixmap->devPrivate = pScreenInfo->pixmapPrivate;
+
/* Tell framebuffer about remapped aperture */
- return (*pScreen->ModifyPixmapHeader)(pScreenInfo->ppix,
+ Entered = (*pScreen->ModifyPixmapHeader)(pScreenPixmap,
-1, -1, -1, -1, -1, pATI->pMemory);
+
+ if (!PixmapPrivate.ptr)
+ {
+ pScreenInfo->pixmapPrivate = pScreenPixmap->devPrivate;
+ pScreenPixmap->devPrivate.ptr = NULL;
+ }
+
+ return Entered;
}
/*
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h
index 51cbbdaea..4442ee599 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h,v 1.3 1999/07/06 11:38:27 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h,v 1.4 2000/02/18 12:19:20 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h
index 09e8095cc..218bb80e2 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h,v 1.3 1999/07/06 11:38:27 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h,v 1.4 2000/02/18 12:19:20 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -24,10 +24,6 @@
#ifndef ___ATICRTC_H___
#define ___ATICRTC_H___ 1
-#include "atipriv.h"
-#include "atiproto.h"
-#include "xf86str.h"
-
/*
* CRTC related definitions.
*/
@@ -38,13 +34,4 @@ typedef enum
ATI_CRTC_MACH64 /* Use Mach64 accelerator CRTC */
} ATICRTCType;
-extern void ATICRTCPreInit FunctionPrototype((ScrnInfoPtr, ATIPtr,
- ATIHWPtr));
-extern void ATICRTCSave FunctionPrototype((ScrnInfoPtr, ATIPtr,
- ATIHWPtr));
-extern Bool ATICRTCCalculate FunctionPrototype((ScrnInfoPtr, ATIPtr,
- ATIHWPtr, DisplayModePtr));
-extern void ATICRTCSet FunctionPrototype((ScrnInfoPtr, ATIPtr,
- ATIHWPtr));
-
#endif /* ___ATICRTC_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c
index 1d2ad6270..47e9cafef 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c,v 1.5 1999/09/27 06:29:41 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c,v 1.6 2000/02/18 12:19:20 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -116,7 +116,7 @@ ATIGetDACCmdReg
/*
* ATIDACPreInit --
*
- * This function initializes the fields in an ATIHWRec that relate to DACs.
+ * This function initialises the fields in an ATIHWRec that relate to DACs.
*/
void
ATIDACPreInit
@@ -145,7 +145,7 @@ ATIDACPreInit
else
{
/*
- * Initialize hardware colour map so that use of uninitialized
+ * Initialise hardware colour map so that use of uninitialised
* software colour map entries can easily be seen. For 256-colour
* modes, this doesn't remain effective for very long...
*/
@@ -179,7 +179,7 @@ ATIDACPreInit
if (pATIHW->crtc == ATI_CRTC_VGA)
{
- /* Initialize overscan to black */
+ /* Initialise overscan to black */
Index = pATIHW->attr[17] * 3;
pATIHW->lut[Index + 0] =
pATIHW->lut[Index + 1] =
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h
index 983aa0c55..c2ea2602d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h,v 1.4 1999/07/18 03:26:53 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h,v 1.5 2000/02/18 12:19:21 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -73,7 +73,7 @@ extern const DACRec ATIDACDescriptors[];
{ \
(void)inb(GENS1(pATI->CPIO_VGABase)); \
(void)inb(GENS1(pATI->CPIO_VGABase)); \
- } while(0)
+ } while (0)
extern void ATISetDACIOPorts FunctionPrototype((ATIPtr, ATICRTCType));
extern CARD8 ATIGetDACCmdReg FunctionPrototype((ATIPtr));
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c
index 211d3738a..4ff9e5a7a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c,v 1.7 1999/09/27 06:29:41 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c,v 1.8 2000/02/18 12:19:21 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -31,7 +31,7 @@
/*
* ATIDSPPreInit --
*
- * This function initializes global variables used to set DSP registers on a
+ * This function initialises global variables used to set DSP registers on a
* VT-B or later.
*/
Bool
@@ -41,12 +41,15 @@ ATIDSPPreInit
ATIPtr pATI
)
{
- CARD32 IOValue;
+ CARD32 IOValue, dsp_config, dsp_on_off, vga_dsp_config, vga_dsp_on_off;
+ CARD16 CPIO_VGA_DSP_CONFIG, CPIO_VGA_DSP_ON_OFF;
int trp;
/* Set DSP register port numbers */
pATI->CPIO_DSP_CONFIG = ATIIOPort(DSP_CONFIG);
pATI->CPIO_DSP_ON_OFF = ATIIOPort(DSP_ON_OFF);
+ CPIO_VGA_DSP_CONFIG = ATIIOPort(VGA_DSP_CONFIG);
+ CPIO_VGA_DSP_ON_OFF = ATIIOPort(VGA_DSP_ON_OFF);
/*
* VT-B's and later have additional post-dividers that are not powers of
@@ -139,6 +142,25 @@ ATIDSPPreInit
if (pATI->XCLKMaxRASDelay <= pATI->XCLKPageFaultDelay)
pATI->XCLKMaxRASDelay = pATI->XCLKPageFaultDelay + 1;
+ /* Allow BIOS to override */
+ dsp_config = inl(pATI->CPIO_DSP_CONFIG);
+ dsp_on_off = inl(pATI->CPIO_DSP_ON_OFF);
+ vga_dsp_config = inl(CPIO_VGA_DSP_CONFIG);
+ vga_dsp_on_off = inl(CPIO_VGA_DSP_ON_OFF);
+
+ if (dsp_config)
+ pATI->DisplayLoopLatency = GetBits(dsp_config, DSP_LOOP_LATENCY);
+
+ if ((dsp_on_off == vga_dsp_on_off) &&
+ (!dsp_config || !((dsp_config ^ vga_dsp_config) & DSP_XCLKS_PER_QW)))
+ {
+ if (ATIDivide(GetBits(vga_dsp_on_off, VGA_DSP_OFF),
+ GetBits(vga_dsp_config, VGA_DSP_XCLKS_PER_QW), 5, 1) > 23)
+ pATI->DisplayFIFODepth = 32;
+ else
+ pATI->DisplayFIFODepth = 24;
+ }
+
return TRUE;
}
@@ -201,10 +223,10 @@ ATIDSPCalculate
{
/* Compensate for horizontal stretching */
Multiplier *= pATI->LCDHorizontal;
- Divider *= pMode->HDisplay;
+ Divider *= pMode->HDisplay & ~7;
RASMultiplier *= pATI->LCDHorizontal;
- RASDivider *= pMode->HTotal;
+ RASDivider *= pMode->HDisplay & ~7;
}
/* Determine dsp_precision first */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h
index 6c167ea96..29657be49 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h,v 1.4 1999/08/01 07:57:20 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h,v 1.5 2000/02/18 12:19:22 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c
index fdbfde181..03fc99102 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c,v 1.4 1999/10/13 20:33:01 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c,v 1.5 2000/02/18 12:19:22 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h
index 6c873291b..a8f1075dc 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h,v 1.4 1999/10/13 20:33:01 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h,v 1.6 2000/02/18 12:19:23 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.c
index f055f2029..a4dd66ba5 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.c,v 1.3 1999/07/06 11:38:31 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.c,v 1.4 2000/02/18 12:19:23 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h
index 9ac13e1c5..22ba9e291 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h,v 1.4 1999/08/01 07:57:20 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h,v 1.5 2000/02/18 12:19:23 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c
index 8ee558155..a75e5dc77 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c,v 1.3 1999/09/27 06:29:42 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c,v 1.4 2000/02/18 12:19:24 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -39,7 +39,7 @@ ATIUnlock
ATIPtr pATI
)
{
- CARD32 tmp;
+ CARD32 tmp, saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0;
if (pATI->Unlocked)
return;
@@ -96,8 +96,11 @@ ATIUnlock
pATI->LockData.bus_cntl =
(pATI->LockData.bus_cntl & ~BUS_FIFO_ERR_INT_EN) |
BUS_FIFO_ERR_INT;
- outl(pATI->CPIO_BUS_CNTL, (pATI->LockData.bus_cntl & ~BUS_ROM_DIS) |
- SetBits(15, BUS_FIFO_WS));
+ tmp = (pATI->LockData.bus_cntl & ~BUS_ROM_DIS) |
+ SetBits(15, BUS_FIFO_WS);
+ if (pATI->Chip >= ATI_CHIP_264VT)
+ tmp |= BUS_EXT_REG_EN; /* Enable Block 1 */
+ outl(pATI->CPIO_BUS_CNTL, tmp);
pATI->LockData.crtc_int_cntl = inl(pATI->CPIO_CRTC_INT_CNTL);
outl(pATI->CPIO_CRTC_INT_CNTL,
(pATI->LockData.crtc_int_cntl & ~CRTC_INT_ENS) | CRTC_INT_ACKS);
@@ -116,11 +119,12 @@ ATIUnlock
outl(pATI->CPIO_CRTC_GEN_CNTL, tmp | CRTC_EN);
outl(pATI->CPIO_CRTC_GEN_CNTL, tmp);
outl(pATI->CPIO_CRTC_GEN_CNTL, tmp | CRTC_EN);
- if (pATI->Chip >= ATI_CHIP_264XL)
+ if (pATI->LCDPanelID >= 0)
{
pATI->LockData.lcd_index = inl(pATI->CPIO_LCD_INDEX);
- outl(pATI->CPIO_LCD_INDEX, pATI->LockData.lcd_index &
- ~(LCD_MONDET_INT_EN | LCD_MONDET_INT));
+ if (pATI->Chip >= ATI_CHIP_264XL)
+ outl(pATI->CPIO_LCD_INDEX, pATI->LockData.lcd_index &
+ ~(LCD_MONDET_INT_EN | LCD_MONDET_INT));
}
/* Ensure VGA aperture is enabled */
@@ -171,6 +175,30 @@ ATIUnlock
}
}
+ if (pATI->LCDPanelID >= 0)
+ {
+ if (pATI->Chip == ATI_CHIP_264LT)
+ {
+ saved_lcd_gen_ctrl = inl(pATI->CPIO_LCD_GEN_CTRL);
+
+ /* Setup to unlock non-shadow registers */
+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
+ outl(pATI->CPIO_LCD_GEN_CTRL, lcd_gen_ctrl);
+ }
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ saved_lcd_gen_ctrl = ATIGetLTProLCDReg(LCD_GEN_CNTL);
+
+ /* Setup to unlock non-shadow registers */
+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
+ }
+ }
+
ATISetVGAIOBase(pATI, inb(R_GENMO));
/*
@@ -222,6 +250,81 @@ ATIUnlock
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U, pATI->LockData.crt11);
pATI->LockData.crt11 |= 0x80U;
}
+
+ if (pATI->LCDPanelID >= 0)
+ {
+ /* Setup to unlock shadow registers */
+ lcd_gen_ctrl |= SHADOW_EN | SHADOW_RW_EN;
+
+ if (pATI->Chip == ATI_CHIP_264LT)
+ outl(pATI->CPIO_LCD_GEN_CTRL, lcd_gen_ctrl);
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
+
+ /* Unlock shadow registers */
+ ATISetVGAIOBase(pATI, inb(R_GENMO));
+
+ pATI->LockData.shadow_crt03 = tmp =
+ GetReg(CRTX(pATI->CPIO_VGABase), 0x03U);
+ if ((tmp & 0x80U) ||
+ ((outb(CRTD(pATI->CPIO_VGABase), tmp | 0x80U),
+ tmp = inb(CRTD(pATI->CPIO_VGABase))) & 0x80U))
+ {
+ /* CRTC[16-17] should be readable */
+ pATI->LockData.shadow_crt11 = tmp =
+ GetReg(CRTX(pATI->CPIO_VGABase), 0x11U);
+ if (tmp & 0x80U) /* Unprotect CRTC[0-7] */
+ outb(CRTD(pATI->CPIO_VGABase), tmp & 0x7FU);
+ }
+ else
+ {
+ /*
+ * Could not make CRTC[17] readable, so unprotect CRTC[0-7]
+ * replacing VSyncEnd with zero. This zero will be replaced
+ * after acquiring the needed access.
+ */
+ unsigned int VSyncEnd, VBlankStart, VBlankEnd;
+ CARD8 crt07, crt09;
+
+ PutReg(CRTX(pATI->CPIO_VGABase), 0x11U, 0x20U);
+ /* Make CRTC[16-17] readable */
+ PutReg(CRTX(pATI->CPIO_VGABase), 0x03U, tmp | 0x80U);
+ /* Make vertical synch pulse as wide as possible */
+ crt07 = GetReg(CRTX(pATI->CPIO_VGABase), 0x07U);
+ crt09 = GetReg(CRTX(pATI->CPIO_VGABase), 0x09U);
+ VBlankStart = (((crt09 & 0x20U) << 4) |
+ ((crt07 & 0x08U) << 5) |
+ GetReg(CRTX(pATI->CPIO_VGABase), 0x15U)) + 1;
+ VBlankEnd = (VBlankStart & 0x0300U) |
+ GetReg(CRTX(pATI->CPIO_VGABase), 0x16U);
+ if (VBlankEnd <= VBlankStart)
+ VBlankEnd += 0x0100U;
+ VSyncEnd = (((crt07 & 0x80U) << 2) | ((crt07 & 0x04U) << 6) |
+ GetReg(CRTX(pATI->CPIO_VGABase), 0x10U)) + 0x0FU;
+ if (VSyncEnd >= VBlankEnd)
+ VSyncEnd = VBlankEnd - 1;
+ pATI->LockData.shadow_crt11 = (VSyncEnd & 0x0FU) | 0x20U;
+ PutReg(CRTX(pATI->CPIO_VGABase), 0x11U,
+ pATI->LockData.shadow_crt11);
+ pATI->LockData.shadow_crt11 |= 0x80U;
+ }
+
+ /* Restore selection */
+ if (pATI->Chip == ATI_CHIP_264LT)
+ outl(pATI->CPIO_LCD_GEN_CTRL, saved_lcd_gen_ctrl);
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, saved_lcd_gen_ctrl);
+
+ /* Restore LCD index */
+ outb(pATI->CPIO_LCD_INDEX,
+ GetByte(pATI->LockData.lcd_index, 0));
+ }
+ }
}
}
@@ -236,7 +339,7 @@ ATILock
ATIPtr pATI
)
{
- CARD32 tmp;
+ CARD32 tmp, saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0;
if (!pATI->Unlocked)
return;
@@ -244,12 +347,65 @@ ATILock
if (pATI->VGAAdapter != ATI_ADAPTER_NONE)
{
+ if (pATI->LCDPanelID >= 0)
+ {
+ if (pATI->Chip == ATI_CHIP_264LT)
+ {
+ saved_lcd_gen_ctrl = inl(pATI->CPIO_LCD_GEN_CTRL);
+
+ /* Setup to lock non-shadow registers */
+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
+ outl(pATI->CPIO_LCD_GEN_CTRL, lcd_gen_ctrl);
+ }
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ {
+ saved_lcd_gen_ctrl = ATIGetLTProLCDReg(LCD_GEN_CNTL);
+
+ /* Setup to lock non-shadow registers */
+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
+ }
+ }
+
ATISetVGAIOBase(pATI, inb(R_GENMO));
/* Restore VGA locks */
PutReg(CRTX(pATI->CPIO_VGABase), 0x03U, pATI->LockData.crt03);
PutReg(CRTX(pATI->CPIO_VGABase), 0x11U, pATI->LockData.crt11);
+ if (pATI->LCDPanelID >= 0)
+ {
+ /* Setup to lock shadow registers */
+ lcd_gen_ctrl |= SHADOW_EN | SHADOW_RW_EN;
+
+ if (pATI->Chip == ATI_CHIP_264LT)
+ outl(pATI->CPIO_LCD_GEN_CTRL, lcd_gen_ctrl);
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
+
+ /* Lock shadow registers */
+ ATISetVGAIOBase(pATI, inb(R_GENMO));
+
+ PutReg(CRTX(pATI->CPIO_VGABase), 0x03U,
+ pATI->LockData.shadow_crt03);
+ PutReg(CRTX(pATI->CPIO_VGABase), 0x11U,
+ pATI->LockData.shadow_crt11);
+
+ /* Restore selection */
+ if (pATI->Chip == ATI_CHIP_264LT)
+ outl(pATI->CPIO_LCD_GEN_CTRL, saved_lcd_gen_ctrl);
+ else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) ||
+ (pATI->Chip == ATI_CHIP_264XL) ||
+ (pATI->Chip == ATI_CHIP_MOBILITY)) */
+ ATIPutLTProLCDReg(LCD_GEN_CNTL, saved_lcd_gen_ctrl);
+ }
+
if (pATI->CPIO_VGAWonder)
{
/*
@@ -320,7 +476,7 @@ ATILock
outl(pATI->CPIO_DAC_CNTL, pATI->LockData.dac_cntl);
if (pATI->Chip < ATI_CHIP_264CT)
outl(pATI->CPIO_MEM_INFO, pATI->LockData.mem_info);
- else if (pATI->Chip >= ATI_CHIP_264XL)
+ else if (pATI->LCDPanelID >= 0)
outl(pATI->CPIO_LCD_INDEX, pATI->LockData.lcd_index);
}
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h
index e5ce88e0f..1e3e4409d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h,v 1.1 1999/07/06 11:38:31 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h,v 1.2 2000/02/18 12:19:24 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c
index cc2db561a..39bc21762 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.9 1999/11/02 16:16:37 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.10 2000/02/18 12:19:25 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -20,6 +20,29 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright 1999-2000 Precision Insight, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * 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, sub license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+ */
#include "atibus.h"
#include "atichip.h"
@@ -27,6 +50,108 @@
#include "atimach64.h"
/*
+ * Only 32-bit MMIO is needed here.
+ */
+
+#define inm(_Register) \
+ MMIO_IN32(pATI->pBlock[GetBits(_Register, BLOCK_SELECT)], \
+ (_Register) & MM_IO_SELECT)
+
+/*
+ * ATIMach64PollEngineStatus --
+ *
+ * This function refreshes the driver's view of the draw engine's status.
+ */
+static void
+ATIMach64PollEngineStatus
+(
+ ATIPtr pATI
+)
+{
+ CARD32 IOValue;
+ int Count;
+
+ if (pATI->Chip < ATI_CHIP_264VTB)
+ {
+ /*
+ * TODO: Deal with locked engines.
+ */
+ IOValue = inm(FIFO_STAT);
+ pATI->EngineIsLocked = GetBits(IOValue, FIFO_ERR);
+
+ /*
+ * The following counts the number of bits in FIFO_STAT_BITS, and is
+ * derived from miSetVisualTypes() (formerly cfbSetVisualTypes()).
+ */
+ IOValue = GetBits(IOValue, FIFO_STAT_BITS);
+ Count = (IOValue >> 1) & 0x36DBU;
+ Count = IOValue - Count - ((Count >> 1) & 0x36DBU);
+ Count = ((Count + (Count >> 3)) & 0x71C7U) % 0x3FU;
+ Count = pATI->nFIFOEntries - Count;
+ if (Count > pATI->nAvailableFIFOEntries)
+ pATI->nAvailableFIFOEntries = Count;
+
+ /*
+ * If the command FIFO is non-empty, then the engine isn't idle.
+ */
+ if (pATI->nAvailableFIFOEntries < pATI->nFIFOEntries)
+ {
+ pATI->EngineIsBusy = TRUE;
+ return;
+ }
+ }
+
+ IOValue = inm(GUI_STAT);
+ pATI->EngineIsBusy = GetBits(IOValue, GUI_ACTIVE);
+ Count = GetBits(IOValue, GUI_FIFO);
+ if (Count > pATI->nAvailableFIFOEntries)
+ pATI->nAvailableFIFOEntries = Count;
+}
+
+
+#define outm(_Register, _Value) \
+ do \
+ { \
+ while (!pATI->nAvailableFIFOEntries--) \
+ ATIMach64PollEngineStatus(pATI); \
+ MMIO_OUT32(pATI->pBlock[GetBits(_Register, BLOCK_SELECT)], \
+ (_Register) & MM_IO_SELECT, _Value); \
+ pATI->EngineIsBusy = TRUE; \
+ } while (0)
+
+#define ATIMach64WaitForFIFO(_n) \
+ while ((pATI->nAvailableFIFOEntries < (_n)) && \
+ (pATI->nAvailableFIFOEntries < pATI->nFIFOEntries)) \
+ ATIMach64PollEngineStatus(pATI)
+
+#define ATIMach64WaitForIdle() \
+ while (pATI->EngineIsBusy) \
+ ATIMach64PollEngineStatus(pATI)
+
+/*
+ * X-to-Mach64 mix translation table.
+ */
+static CARD8 ATIMach64ALU[16] =
+{
+ MIX_0,
+ MIX_AND,
+ MIX_SRC_AND_NOT_DST,
+ MIX_SRC,
+ MIX_NOT_SRC_AND_DST,
+ MIX_DST,
+ MIX_XOR,
+ MIX_OR,
+ MIX_NOR,
+ MIX_XNOR,
+ MIX_NOT_DST,
+ MIX_SRC_OR_NOT_DST,
+ MIX_NOT_SRC,
+ MIX_NOT_SRC_OR_DST,
+ MIX_NAND,
+ MIX_1
+};
+
+/*
* ATIMach64PreInit --
*
* This function fills in the Mach64 portion of an ATIHWRec that is common to
@@ -56,6 +181,8 @@ ATIMach64PreInit
}
else
pATIHW->bus_cntl |= BUS_APER_REG_DIS;
+ if (pATI->Chip >= ATI_CHIP_264VT)
+ pATIHW->bus_cntl |= BUS_EXT_REG_EN; /* Enable Block 1 */
pATIHW->mem_vga_wp_sel =
/* SetBits(0, MEM_VGA_WPS0) | */
@@ -88,6 +215,101 @@ ATIMach64PreInit
else
pATIHW->config_cntl |= SetBits(2, CFG_MEM_AP_SIZE);
}
+
+ /* Draw engine setup */
+ if (pATI->OptionAccel)
+ {
+ /* Don't treat 24bpp as a special case */
+ pATI->PitchModifier =
+ pScreenInfo->bitsPerPixel / UnitOf(pScreenInfo->bitsPerPixel);
+
+ /*
+ * When possible, max out command FIFO size.
+ */
+ if (pATI->Chip >= ATI_CHIP_264VT4)
+ pATIHW->gui_cntl = inm(GUI_CNTL) & ~CMDFIFO_SIZE_MODE;
+
+ /* Initialise destination registers */
+ pATIHW->dst_off_pitch =
+ SetBits((pScreenInfo->displayWidth * pATI->PitchModifier) >> 3,
+ DST_PITCH);
+ pATIHW->dst_cntl = DST_X_DIR | DST_Y_DIR | DST_LAST_PEL;
+
+ /* Initialise source registers */
+ pATIHW->src_off_pitch = pATIHW->dst_off_pitch;
+ pATIHW->src_width1 = pATIHW->src_height1 =
+ pATIHW->src_width2 = pATIHW->src_height2 = 1;
+ pATIHW->src_cntl = SRC_LINE_X_DIR;
+
+ /* Initialise scissor, allowing for offscreen areas */
+ pATIHW->sc_right =
+ (pScreenInfo->displayWidth * pATI->PitchModifier) - 1;
+ pATIHW->sc_bottom =
+ (pScreenInfo->videoRam * 1024 * 8 / pScreenInfo->displayWidth /
+ pScreenInfo->bitsPerPixel) - 1;
+
+ /* Initialise data path */
+ pATIHW->dp_frgd_clr = (CARD32)(-1);
+ pATIHW->dp_write_mask = (CARD32)(-1);
+
+ switch (pScreenInfo->depth)
+ {
+ case 8:
+ pATIHW->dp_chain_mask = DP_CHAIN_8BPP;
+ pATIHW->dp_pix_width = /* DP_BYTE_PIX_ORDER | */
+ SetBits(PIX_WIDTH_8BPP, DP_DST_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_8BPP, DP_SRC_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_8BPP, DP_HOST_PIX_WIDTH);
+ break;
+
+ case 15:
+ pATIHW->dp_chain_mask = DP_CHAIN_15BPP_1555;
+ pATIHW->dp_pix_width = /* DP_BYTE_PIX_ORDER | */
+ SetBits(PIX_WIDTH_15BPP, DP_DST_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_15BPP, DP_SRC_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_15BPP, DP_HOST_PIX_WIDTH);
+ break;
+
+ case 16:
+ pATIHW->dp_chain_mask = DP_CHAIN_16BPP_565;
+ pATIHW->dp_pix_width = /* DP_BYTE_PIX_ORDER | */
+ SetBits(PIX_WIDTH_16BPP, DP_DST_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_16BPP, DP_SRC_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_16BPP, DP_HOST_PIX_WIDTH);
+ break;
+
+ case 24:
+ if (pScreenInfo->bitsPerPixel == 24)
+ {
+ pATIHW->dp_chain_mask = DP_CHAIN_24BPP_888;
+ pATIHW->dp_pix_width = /* DP_BYTE_PIX_ORDER | */
+ SetBits(PIX_WIDTH_8BPP, DP_DST_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_8BPP, DP_SRC_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_8BPP, DP_HOST_PIX_WIDTH);
+ }
+ else
+ {
+ pATIHW->dp_chain_mask = DP_CHAIN_32BPP_8888;
+ pATIHW->dp_pix_width = /* DP_BYTE_PIX_ORDER | */
+ SetBits(PIX_WIDTH_32BPP, DP_DST_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_32BPP, DP_SRC_PIX_WIDTH) |
+ SetBits(PIX_WIDTH_32BPP, DP_HOST_PIX_WIDTH);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ pATIHW->dp_mix = SetBits(MIX_SRC, DP_FRGD_MIX) |
+ SetBits(MIX_DST, DP_BKGD_MIX);
+ pATIHW->dp_src = SetBits(DP_MONO_SRC_ALLONES, DP_MONO_SRC) |
+ SetBits(SRC_FRGD, DP_FRGD_SRC) |
+ SetBits(SRC_BKGD, DP_BKGD_SRC);
+
+ /* Initialise colour compare */
+ pATIHW->clr_cmp_msk = (CARD32)(-1);
+ }
}
/*
@@ -126,6 +348,69 @@ ATIMach64Save
pATIHW->dac_cntl = inl(pATI->CPIO_DAC_CNTL);
pATIHW->config_cntl = inl(pATI->CPIO_CONFIG_CNTL);
+
+ /* Save draw engine state */
+ if ((pATI->OptionAccel) && (pATIHW == &pATI->OldHW))
+ {
+ ATIMach64WaitForIdle();
+
+ /* Save FIFO size */
+ if (pATI->Chip >= ATI_CHIP_264VT4)
+ pATIHW->gui_cntl = inm(GUI_STAT);
+
+ /* Save destination registers */
+ pATIHW->dst_off_pitch = inm(DST_OFF_PITCH);
+ pATIHW->dst_x = inm(DST_X);
+ pATIHW->dst_y = inm(DST_Y);
+ pATIHW->dst_height = inm(DST_HEIGHT);
+ pATIHW->dst_bres_err = inm(DST_BRES_ERR);
+ pATIHW->dst_bres_inc = inm(DST_BRES_INC);
+ pATIHW->dst_bres_dec = inm(DST_BRES_DEC);
+ pATIHW->dst_cntl = inm(DST_CNTL);
+
+ /* Save source registers */
+ pATIHW->src_off_pitch = inm(SRC_OFF_PITCH);
+ pATIHW->src_x = inm(SRC_X);
+ pATIHW->src_y = inm(SRC_Y);
+ pATIHW->src_width1 = inm(SRC_WIDTH1);
+ pATIHW->src_height1 = inm(SRC_HEIGHT1);
+ pATIHW->src_x_start = inm(SRC_X_START);
+ pATIHW->src_y_start = inm(SRC_Y_START);
+ pATIHW->src_width2 = inm(SRC_WIDTH2);
+ pATIHW->src_height2 = inm(SRC_HEIGHT2);
+ pATIHW->src_cntl = inm(SRC_CNTL);
+
+ /* Save host data register */
+ pATIHW->host_cntl = inm(HOST_CNTL);
+
+ /* Save pattern registers */
+ pATIHW->pat_reg0 = inm(PAT_REG0);
+ pATIHW->pat_reg1 = inm(PAT_REG1);
+ pATIHW->pat_cntl = inm(PAT_CNTL);
+
+ /* Save scissor registers */
+ pATIHW->sc_left = inm(SC_LEFT);
+ pATIHW->sc_right = inm(SC_RIGHT);
+ pATIHW->sc_top = inm(SC_TOP);
+ pATIHW->sc_bottom = inm(SC_BOTTOM);
+
+ /* Save data path registers */
+ pATIHW->dp_bkgd_clr = inm(DP_BKGD_CLR);
+ pATIHW->dp_frgd_clr = inm(DP_FRGD_CLR);
+ pATIHW->dp_write_mask = inm(DP_WRITE_MASK);
+ pATIHW->dp_chain_mask = inm(DP_CHAIN_MASK);
+ pATIHW->dp_pix_width = inm(DP_PIX_WIDTH);
+ pATIHW->dp_mix = inm(DP_MIX);
+ pATIHW->dp_src = inm(DP_SRC);
+
+ /* Save colour compare registers */
+ pATIHW->clr_cmp_clr = inm(CLR_CMP_CLR);
+ pATIHW->clr_cmp_msk = inm(CLR_CMP_MSK);
+ pATIHW->clr_cmp_cntl = inm(CLR_CMP_CNTL);
+
+ /* Save context */
+ pATIHW->context_mask = inm(CONTEXT_MASK);
+ }
}
/*
@@ -257,28 +542,32 @@ ATIMach64Calculate
switch (pScreenInfo->depth)
{
case 1:
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_1BPP;
+ pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_1BPP, CRTC_PIX_WIDTH);
break;
case 4:
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_4BPP;
+ pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_4BPP, CRTC_PIX_WIDTH);
break;
case 8:
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_8BPP;
+ pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_8BPP, CRTC_PIX_WIDTH);
break;
case 15:
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_15BPP;
+ pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_15BPP, CRTC_PIX_WIDTH);
break;
case 16:
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_16BPP;
+ pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_16BPP, CRTC_PIX_WIDTH);
break;
case 24:
if (pScreenInfo->bitsPerPixel == 24)
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_24BPP;
- else if (pScreenInfo->bitsPerPixel == 32)
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_32BPP;
- break;
+ {
+ pATIHW->crtc_gen_cntl |=
+ SetBits(PIX_WIDTH_24BPP, CRTC_PIX_WIDTH);
+ break;
+ }
+ if (pScreenInfo->bitsPerPixel != 32)
+ break;
+ /* Fall through */
case 32:
- pATIHW->crtc_gen_cntl |= CRTC_PIX_WIDTH_32BPP;
+ pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_32BPP, CRTC_PIX_WIDTH);
break;
default:
break;
@@ -329,7 +618,7 @@ ATIMach64Set
outl(pATI->CPIO_OVR_WID_LEFT_RIGHT, pATIHW->ovr_wid_left_right);
outl(pATI->CPIO_OVR_WID_TOP_BOTTOM, pATIHW->ovr_wid_top_bottom);
- /* Finalize CRTC setup and turn on the screen */
+ /* Finalise CRTC setup and turn on the screen */
outl(pATI->CPIO_CRTC_GEN_CNTL, pATIHW->crtc_gen_cntl);
/* Aperture setup */
@@ -341,6 +630,81 @@ ATIMach64Set
outl(pATI->CPIO_DAC_CNTL, pATIHW->dac_cntl);
outl(pATI->CPIO_CONFIG_CNTL, pATIHW->config_cntl);
+
+ /* Load draw engine */
+ if (pATI->OptionAccel)
+ {
+ ATIMach64WaitForIdle();
+
+ /* Load FIFO size */
+ if (pATI->Chip >= ATI_CHIP_264VT4)
+ {
+ outm(GUI_CNTL, pATIHW->gui_cntl);
+ pATI->nAvailableFIFOEntries = 0;
+ ATIMach64PollEngineStatus(pATI);
+ }
+
+ /* Load destination registers */
+ ATIMach64WaitForFIFO(7);
+ outm(DST_OFF_PITCH, pATIHW->dst_off_pitch);
+ outm(DST_Y_X, SetWord(pATIHW->dst_x, 1) | SetWord(pATIHW->dst_y, 0));
+ outm(DST_HEIGHT, pATIHW->dst_height);
+ outm(DST_BRES_ERR, pATIHW->dst_bres_err);
+ outm(DST_BRES_INC, pATIHW->dst_bres_inc);
+ outm(DST_BRES_DEC, pATIHW->dst_bres_dec);
+ outm(DST_CNTL, pATIHW->dst_cntl);
+
+ /* Load source registers */
+ ATIMach64WaitForFIFO(6);
+ outm(SRC_OFF_PITCH, pATIHW->src_off_pitch);
+ outm(SRC_Y_X, SetWord(pATIHW->src_x, 1) | SetWord(pATIHW->src_y, 0));
+ outm(SRC_HEIGHT1_WIDTH1,
+ SetWord(pATIHW->src_width1, 1) | SetWord(pATIHW->src_height1, 0));
+ outm(SRC_Y_X_START,
+ SetWord(pATIHW->src_x_start, 1) | SetWord(pATIHW->src_y_start, 0));
+ outm(SRC_HEIGHT2_WIDTH2,
+ SetWord(pATIHW->src_width2, 1) | SetWord(pATIHW->src_height2, 0));
+ outm(SRC_CNTL, pATIHW->src_cntl);
+
+ /* Load host data register */
+ ATIMach64WaitForFIFO(1);
+ outm(HOST_CNTL, pATIHW->host_cntl);
+
+ /* Load pattern registers */
+ ATIMach64WaitForFIFO(3);
+ outm(PAT_REG0, pATIHW->pat_reg0);
+ outm(PAT_REG1, pATIHW->pat_reg1);
+ outm(PAT_CNTL, pATIHW->pat_cntl);
+
+ /* Load scissor registers */
+ ATIMach64WaitForFIFO(2);
+ outm(SC_LEFT_RIGHT,
+ SetWord(pATIHW->sc_right, 1) | SetWord(pATIHW->sc_left, 0));
+ outm(SC_TOP_BOTTOM,
+ SetWord(pATIHW->sc_bottom, 1) | SetWord(pATIHW->sc_top, 0));
+
+ /* Load data path registers */
+ ATIMach64WaitForFIFO(7);
+ outm(DP_BKGD_CLR, pATIHW->dp_bkgd_clr);
+ outm(DP_FRGD_CLR, pATIHW->dp_frgd_clr);
+ outm(DP_WRITE_MASK, pATIHW->dp_write_mask);
+ outm(DP_CHAIN_MASK, pATIHW->dp_chain_mask);
+ outm(DP_PIX_WIDTH, pATIHW->dp_pix_width);
+ outm(DP_MIX, pATIHW->dp_mix);
+ outm(DP_SRC, pATIHW->dp_src);
+
+ /* Load colour compare registers */
+ ATIMach64WaitForFIFO(3);
+ outm(CLR_CMP_CLR, pATIHW->clr_cmp_clr);
+ outm(CLR_CMP_MSK, pATIHW->clr_cmp_msk);
+ outm(CLR_CMP_CNTL, pATIHW->clr_cmp_cntl);
+
+ /* Load context mask */
+ ATIMach64WaitForFIFO(1);
+ outm(CONTEXT_MASK, pATIHW->context_mask);
+
+ ATIMach64WaitForIdle();
+ }
}
/*
@@ -352,11 +716,198 @@ void
ATIMach64SaveScreen
(
ATIPtr pATI,
- int On
+ int Mode
)
{
CARD32 crtc_gen_cntl = inl(pATI->CPIO_CRTC_GEN_CNTL);
- outl(pATI->CPIO_CRTC_GEN_CNTL,
- On ? (crtc_gen_cntl | CRTC_EN) : (crtc_gen_cntl & ~CRTC_EN));
+ switch (Mode)
+ {
+ case SCREEN_SAVER_OFF:
+ case SCREEN_SAVER_FORCER:
+ outl(pATI->CPIO_CRTC_GEN_CNTL, crtc_gen_cntl | CRTC_EN);
+ break;
+
+ case SCREEN_SAVER_ON:
+ case SCREEN_SAVER_CYCLE:
+ outl(pATI->CPIO_CRTC_GEN_CNTL, crtc_gen_cntl & ~CRTC_EN);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/*
+ * ATIMach64Sync --
+ *
+ * This is called to wait for the draw engine to become idle.
+ */
+static void
+ATIMach64Sync
+(
+ ScrnInfoPtr pScreenInfo
+)
+{
+ ATIPtr pATI = ATIPTR(pScreenInfo);
+
+ ATIMach64WaitForIdle();
+
+ /*
+ * For VTB's and later, the first CPU read of the framebuffer will return
+ * zeroes, so do it here. This appears to be due to some kind of engine
+ * caching of framebuffer data I haven't found any way of disabling, or
+ * otherwise circumventing. Thanks to Mark Vojkovich for the suggestion.
+ */
+ pATI = *(volatile ATIPtr *)pATI->pMemory;
+}
+
+/*
+ * ATIMach64SetClippingRectangle --
+ *
+ * This function sets the draw engine's clipping rectangle.
+ */
+static void
+ATIMach64SetClippingRectangle
+(
+ ScrnInfoPtr pScreenInfo,
+ int left,
+ int top,
+ int right,
+ int bottom
+)
+{
+ ATIPtr pATI = ATIPTR(pScreenInfo);
+
+ ATIMach64WaitForFIFO(2);
+ outm(SC_LEFT_RIGHT, SetWord(((right + 1) * pATI->PitchModifier) - 1, 1) |
+ SetWord(left * pATI->PitchModifier, 0));
+ outm(SC_TOP_BOTTOM, SetWord(bottom, 1) | SetWord(top, 0));
+}
+
+/*
+ * ATIMach64DisableClipping --
+ *
+ * This function resets the draw engine's clipping rectangle to include the
+ * entire virtual resolution.
+ */
+static void
+ATIMach64DisableClipping
+(
+ ScrnInfoPtr pScreenInfo
+)
+{
+ ATIPtr pATI = ATIPTR(pScreenInfo);
+
+ ATIMach64WaitForFIFO(2);
+ outm(SC_LEFT_RIGHT,
+ SetWord(pATI->NewHW.sc_right, 1) | SetWord(pATI->NewHW.sc_left, 0));
+ outm(SC_TOP_BOTTOM,
+ SetWord(pATI->NewHW.sc_bottom, 1) | SetWord(pATI->NewHW.sc_top, 0));
+}
+
+/*
+ * ATIMach64SetupForSolidFill --
+ *
+ * This function sets up the draw engine for a series of solid fills.
+ */
+static void
+ATIMach64SetupForSolidFill
+(
+ ScrnInfoPtr pScreenInfo,
+ int colour,
+ int rop,
+ unsigned int planemask
+)
+{
+ ATIPtr pATI = ATIPTR(pScreenInfo);
+
+ if (pATI->PitchModifier != 1)
+ ATIMach64WaitForFIFO(4);
+ else
+ {
+ ATIMach64WaitForFIFO(5);
+ outm(DST_CNTL, pATI->NewHW.dst_cntl);
+ }
+
+ outm(DP_MIX, SetBits(ATIMach64ALU[rop], DP_FRGD_MIX) |
+ SetBits(MIX_DST, DP_BKGD_MIX));
+ outm(DP_WRITE_MASK, planemask);
+ outm(DP_SRC, SetBits(DP_MONO_SRC_ALLONES, DP_MONO_SRC) |
+ SetBits(SRC_FRGD, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC));
+ outm(DP_FRGD_CLR, colour);
+}
+
+/*
+ * ATIMach64SubsequentSolidFillRect --
+ *
+ * This function performs a solid rectangle fill.
+ */
+static void
+ATIMach64SubsequentSolidFillRect
+(
+ ScrnInfoPtr pScreenInfo,
+ int x,
+ int y,
+ int w,
+ int h
+)
+{
+ ATIPtr pATI = ATIPTR(pScreenInfo);
+
+ if (pATI->PitchModifier == 1)
+ ATIMach64WaitForFIFO(2);
+ else
+ {
+ x *= pATI->PitchModifier;
+ w *= pATI->PitchModifier;
+
+ ATIMach64WaitForFIFO(3);
+ outm(DST_CNTL, pATI->NewHW.dst_cntl | DST_24_ROT_EN |
+ SetBits((x / 4) % 6, DST_24_ROT));
+ }
+
+ outm(DST_Y_X, SetWord(x, 1) | SetWord(y, 0));
+ outm(DST_HEIGHT_WIDTH, SetWord(w, 1) | SetWord(h, 0));
+}
+
+/*
+ * ATIMach64AccelInit --
+ *
+ * This function fills in structure fields needed for acceleration on Mach64
+ * variants.
+ */
+Bool
+ATIMach64AccelInit
+(
+ ScrnInfoPtr pScreenInfo,
+ ScreenPtr pScreen,
+ ATIPtr pATI,
+ XAAInfoRecPtr pXAAInfo
+)
+{
+ /* This doesn't seem quite right... */
+ if (pATI->PitchModifier == 1)
+ {
+ pXAAInfo->Flags = PIXMAP_CACHE | OFFSCREEN_PIXMAPS;
+ if (!pATI->BankInfo.BankSize)
+ pXAAInfo->Flags |= LINEAR_FRAMEBUFFER;
+ }
+
+ /* Sync */
+ pXAAInfo->Sync = ATIMach64Sync;
+
+ /* Clips */
+ pXAAInfo->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND |
+ HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | HARDWARE_CLIP_MONO_8x8_FILL |
+ HARDWARE_CLIP_COLOR_8x8_FILL | HARDWARE_CLIP_SOLID_FILL |
+ HARDWARE_CLIP_DASHED_LINE | HARDWARE_CLIP_SOLID_LINE;
+ pXAAInfo->SetClippingRectangle = ATIMach64SetClippingRectangle;
+ pXAAInfo->DisableClipping = ATIMach64DisableClipping;
+
+ /* Solid fills */
+ pXAAInfo->SetupForSolidFill = ATIMach64SetupForSolidFill;
+ pXAAInfo->SubsequentSolidFillRect = ATIMach64SubsequentSolidFillRect;
+
+ return TRUE;
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h
index b0a5cecd3..c8fa68653 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h,v 1.3 1999/07/06 11:38:32 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h,v 1.4 2000/02/18 12:19:26 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -26,7 +26,7 @@
#include "atipriv.h"
#include "atiproto.h"
-#include "xf86str.h"
+#include "xaa.h"
extern void ATIMach64PreInit FunctionPrototype((ScrnInfoPtr, ATIPtr,
ATIHWPtr));
@@ -37,4 +37,7 @@ extern void ATIMach64Set FunctionPrototype((ATIPtr, ATIHWPtr));
extern void ATIMach64SaveScreen FunctionPrototype((ATIPtr, int));
+extern Bool ATIMach64AccelInit FunctionPrototype((ScrnInfoPtr, ScreenPtr,
+ ATIPtr, XAAInfoRecPtr));
+
#endif /* ___ATIMACH64_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c
index 11b2e94a5..51b414a77 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c,v 1.4 1999/09/25 14:37:21 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c,v 1.5 2000/02/18 12:19:26 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -77,6 +77,9 @@ ATISetup
"cfb24ScreenInit",
"cfb32ScreenInit",
"ShadowFBInit",
+ "XAACreateInfoRec",
+ "XAADestroyInfoRec",
+ "XAAInit",
NULL);
return (pointer)TRUE;
@@ -133,6 +136,16 @@ ATILoadModules
!ATILoadModule(pScreenInfo, "shadowfb", "ShadowFBInit"))
return FALSE;
+ /* Load XAA if needed */
+ if (pATI->OptionAccel)
+ {
+ if (!ATILoadModule(pScreenInfo, "xaa", "XAAInit"))
+ return FALSE;
+
+ /* Require more XAA symbols */
+ xf86LoaderReqSymbols("XAACreateInfoRec", "XAADestroyInfoRec", NULL);
+ }
+
/* Load depth-specific entry points */
switch (pScreenInfo->bitsPerPixel)
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h
index fb86f5856..05e3f4472 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.2 1999/09/25 14:37:21 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.3 2000/02/18 12:19:26 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h
index 7271386ba..6b9bb2e8a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h,v 1.3 1999/07/06 11:38:33 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h,v 1.4 2000/02/18 12:19:27 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c
index 21ff5258e..47d0f2b2b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.3 1999/11/18 16:52:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.6 2000/02/18 12:19:27 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,25 +22,56 @@
*/
#include "ati.h"
+#include "atiadapter.h"
#include "atibus.h"
#include "atioption.h"
#include "atistruct.h"
+#include "atiutil.h"
/*
- * Recognized XF86Config options.
+ * Recognised XF86Config options.
*/
typedef enum
{
ATI_OPTION_ACCEL,
ATI_OPTION_CRT,
ATI_OPTION_CSYNC,
- ATI_OPTION_DEVEL, /* Intentionally undocumented */
ATI_OPTION_LINEAR,
ATI_OPTION_PROBE_CLOCKS,
- ATI_OPTION_SHADOW_FB,
- ATI_OPTION_SYNC, /* Temporary and undocumented */
- ATI_OPTION_MAX /* Must be last */
-} ATIOptionType;
+ ATI_OPTION_SHADOW_FB
+} ATIPublicOptionType;
+
+typedef enum
+{
+ ATI_OPTION_DEVEL, /* Intentionally undocumented */
+ ATI_OPTION_SYNC /* Temporary and undocumented */
+} ATIPrivateOptionType;
+
+static OptionInfoRec ATIPublicOptions[] =
+{
+ {ATI_OPTION_ACCEL, "accel", OPTV_BOOLEAN, {0, }, FALSE},
+ {ATI_OPTION_CRT, "crt_screen", OPTV_BOOLEAN, {0, }, FALSE},
+ {ATI_OPTION_CSYNC, "composite_sync", OPTV_BOOLEAN, {0, }, FALSE},
+ {ATI_OPTION_LINEAR, "linear", OPTV_BOOLEAN, {0, }, FALSE},
+ {ATI_OPTION_PROBE_CLOCKS, "probe_clocks", OPTV_BOOLEAN, {0, }, FALSE},
+ {ATI_OPTION_SHADOW_FB, "shadow_fb", OPTV_BOOLEAN, {0, }, FALSE},
+ {-1, NULL, OPTV_NONE , {0, }, FALSE}
+};
+
+/*
+ * ATIAvailableOptions --
+ *
+ * Return recognised options that are intended for public consumption.
+ */
+OptionInfoPtr
+ATIAvailableOptions
+(
+ int ChipId, /* Ignored */
+ int BusId /* Ignored */
+)
+{
+ return ATIPublicOptions;
+}
/*
* ATIProcessOptions --
@@ -55,43 +86,44 @@ ATIProcessOptions
ATIPtr pATI
)
{
- OptionInfoRec Option[] =
+ OptionInfoRec PublicOption[NumberOf(ATIPublicOptions)];
+ OptionInfoRec PrivateOption[] =
{
- {ATI_OPTION_ACCEL, "accel", OPTV_BOOLEAN, {0, }, FALSE},
- {ATI_OPTION_CRT, "crt_screen", OPTV_BOOLEAN, {0, }, FALSE},
- {ATI_OPTION_CSYNC, "composite_sync", OPTV_BOOLEAN, {0, }, FALSE},
{ATI_OPTION_DEVEL, "tsi", OPTV_BOOLEAN, {0, }, FALSE},
- {ATI_OPTION_LINEAR, "linear", OPTV_BOOLEAN, {0, }, FALSE},
- {ATI_OPTION_PROBE_CLOCKS, "probe_clocks", OPTV_BOOLEAN, {0, }, FALSE},
- {ATI_OPTION_SHADOW_FB, "shadow_fb", OPTV_BOOLEAN, {0, }, FALSE},
{ATI_OPTION_SYNC, "lcdsync", OPTV_BOOLEAN, {0, }, FALSE},
{-1, NULL, OPTV_NONE , {0, }, FALSE}
};
-# define Accel Option[ATI_OPTION_ACCEL].value.bool
-# define CRTScreen Option[ATI_OPTION_CRT].value.bool
-# define CSync Option[ATI_OPTION_CSYNC].value.bool
-# define Devel Option[ATI_OPTION_DEVEL].value.bool
-# define Linear Option[ATI_OPTION_LINEAR].value.bool
-# define ProbeClocks Option[ATI_OPTION_PROBE_CLOCKS].value.bool
-# define ShadowFB Option[ATI_OPTION_SHADOW_FB].value.bool
-# define Sync Option[ATI_OPTION_SYNC].value.bool
+ memcpy(PublicOption, ATIPublicOptions, SizeOf(ATIPublicOptions));
+
+# define Accel PublicOption[ATI_OPTION_ACCEL].value.bool
+# define CRTScreen PublicOption[ATI_OPTION_CRT].value.bool
+# define CSync PublicOption[ATI_OPTION_CSYNC].value.bool
+# define Devel PrivateOption[ATI_OPTION_DEVEL].value.bool
+# define Linear PublicOption[ATI_OPTION_LINEAR].value.bool
+# define ProbeClocks PublicOption[ATI_OPTION_PROBE_CLOCKS].value.bool
+# define ShadowFB PublicOption[ATI_OPTION_SHADOW_FB].value.bool
+# define Sync PrivateOption[ATI_OPTION_SYNC].value.bool
/* Pick up XF86Config options */
xf86CollectOptions(pScreenInfo, NULL);
/* Set non-zero defaults */
- Linear = TRUE;
+ if (pATI->Adapter >= ATI_ADAPTER_MACH64)
+ Accel = Linear = TRUE;
if (pATI->BusType >= ATI_BUS_PCI)
ShadowFB = TRUE;
Sync = TRUE;
- xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, Option);
+ xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
+ PublicOption);
+ xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options,
+ PrivateOption);
/* Disable linear apertures if the OS doesn't support them */
if (!xf86LinearVidMem() && Linear)
{
- if (Option[ATI_OPTION_LINEAR].found)
+ if (PublicOption[ATI_OPTION_LINEAR].found)
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"OS does not support linear apertures.\n");
Linear = FALSE;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h
index 87fc3e071..a0fd69992 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.1 1999/07/06 11:38:33 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.2 2000/02/18 12:19:27 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -28,6 +28,8 @@
#include "atiproto.h"
#include "xf86str.h"
-extern void ATIProcessOptions FunctionPrototype((ScrnInfoPtr, ATIPtr));
+extern OptionInfoPtr ATIAvailableOptions FunctionPrototype((int, int));
+extern void ATIProcessOptions FunctionPrototype((ScrnInfoPtr,
+ ATIPtr));
#endif /* ___ATIOPTION_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
index 9b9482908..848349f90 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.11 1999/11/18 16:52:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.12 2000/02/18 12:19:28 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -213,7 +213,7 @@ ATIMach32videoRam
* need to mess with the CRT because the results of this test are not
* intended to be seen.
*/
- outw(EXT_GE_CONFIG, PIX_WIDTH_16BPP | ORDER_16BPP_565 | MONITOR_8514 |
+ outw(EXT_GE_CONFIG, PIXEL_WIDTH_16 | ORDER_16BPP_565 | MONITOR_8514 |
ALIAS_ENA);
outw(GE_PITCH, 1024 >> 3);
outw(GE_OFFSET_HI, 0);
@@ -420,7 +420,7 @@ ATIPreInit
}
}
- /* Finish private area initialization */
+ /* Finish private area initialisation */
pATI->DAC = ATI_DAC_GENERIC;
pATI->NewHW.SetBank = ATIx8800SetBank;
pATI->BankInfo.SetSourceBank = ATIx8800SetRead;
@@ -430,6 +430,7 @@ ATIPreInit
pATI->ApertureBase = 0x000A0000U;
pATI->ApertureSize = 0x00010000U;
pATI->LCDPanelID = -1;
+ pATI->nFIFOEntries = 16; /* For now */
/* Finish probing the adapter */
switch (pATI->Adapter)
@@ -517,6 +518,9 @@ ATIPreInit
videoRamSizes[GetBits(IOValue1, CTL_MEM_SIZE) + 2];
else
{
+ pATI->nFIFOEntries = /* Don't care */
+ (unsigned int)(-1) >> 1;
+
IOValue1 = GetBits(IOValue1, CTL_MEM_SIZEB);
if (IOValue1 < 8)
pATI->VideoRAM = (IOValue1 + 1) * 512;
@@ -578,7 +582,7 @@ ATIPreInit
{
/*
* Don't bother with panel support if it's not enabled by
- * BIOS initialization. Also, remember if the BIOS knows
+ * BIOS initialisation. Also, remember if the BIOS knows
* about the CRT.
*/
if (!(IOValue2 & LCD_ON))
@@ -709,13 +713,13 @@ ATIPreInit
case ATI_CLOCK_INTERNAL:
/*
* The reference divider has already been programmed by BIOS
- * initialization. Because, there is only one reference
+ * initialisation. Because, there is only one reference
* divider for all generated frequencies (including MCLK), it
* cannot be changed without reprogramming all clocks every
* time one of them needs a different reference divider.
*
* Besides, it's not a good idea to change the reference
- * divider. BIOS initialization sets it to a value that
+ * divider. BIOS initialisation sets it to a value that
* effectively prevents generating frequencies beyond the
* graphics controller's tolerance.
*/
@@ -991,7 +995,7 @@ ATIPreInit
"BIOS bus address: 0x%08X.\n", pATI->BIOSBase);
else
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
- "BIOS not mapped by BIOS initialization.\n");
+ "BIOS not mapped by BIOS initialisation.\n");
/* Promote chipset specification */
switch (pATI->Chipset)
@@ -1193,7 +1197,7 @@ ATIPreInit
{
/*
* XXX There's an assumption here that the values retrieved are those
- * set by BIOS initialization.
+ * set by BIOS initialisation.
*/
if (pATI->Chip <= ATI_CHIP_18800_1)
{
@@ -1248,127 +1252,133 @@ ATIPreInit
else if ((pATI->NewHW.crtc == ATI_CRTC_MACH64) ||
(pATI->Chip >= ATI_CHIP_264CT))
{
- /* Set MMIO address from PCI configuration space, if available */
- if (pATI->PCIInfo &&
- (pATI->Block0Base = pATI->PCIInfo->memBase[2]))
- pATI->Block0Base += 0x0400U;
-
- /* Possibly set up for linear aperture */
- if ((pScreenInfo->depth >= 8) && pATI->OptionLinear)
+ if (pScreenInfo->depth >= 8)
{
- /* Get adapter's linear aperture configuration */
- IOValue1 = inl(pATI->CPIO_CONFIG_CNTL);
- pATI->LinearBase = GetBits(IOValue1, CFG_MEM_AP_LOC) << 22;
- if ((IOValue1 & CFG_MEM_AP_SIZE) != CFG_MEM_AP_SIZE)
- pATI->LinearSize = GetBits(IOValue1, CFG_MEM_AP_SIZE) << 22;
-
- /* Except for PCI & AGP, allow for user override */
- if ((pATI->BusType != ATI_BUS_PCI) &&
- (pATI->BusType != ATI_BUS_AGP))
- {
- if (pATI->Chip == ATI_CHIP_88800CX)
- IOValue2 = ~((unsigned long)((1 << 23) - 1));
- else if (pATI->Chip >= ATI_CHIP_88800GXE)
- IOValue2 = ~((unsigned long)((1 << 24) - 1));
- else if (pATI->VideoRAM >= 4096)
- IOValue2 = ~((unsigned long)((1 << 23) - 1));
- else
- IOValue2 = ~((unsigned long)((1 << 22) - 1));
+ /* Set MMIO address from PCI configuration space, if available */
+ if (pATI->PCIInfo &&
+ (pATI->Block0Base = pATI->PCIInfo->memBase[2]))
+ pATI->Block0Base += 0x0400U;
- if ((IOValue2 &= pGDev->MemBase) &&
- (IOValue2 <= (MaxBits(CFG_MEM_AP_LOC) << 22)))
- pATI->LinearBase = IOValue2;
- }
-
- if (pATI->LinearBase)
+ /* Possibly set up for linear aperture */
+ if (pATI->OptionLinear)
{
- if (pATI->VideoRAM < 4096)
- pATI->LinearSize = 4 * 1024 * 1024;
- else
- pATI->LinearSize = 8 * 1024 * 1024;
-
+ /* Get adapter's linear aperture configuration */
+ IOValue1 = inl(pATI->CPIO_CONFIG_CNTL);
+ pATI->LinearBase = GetBits(IOValue1, CFG_MEM_AP_LOC) << 22;
+ if ((IOValue1 & CFG_MEM_AP_SIZE) != CFG_MEM_AP_SIZE)
+ pATI->LinearSize =
+ GetBits(IOValue1, CFG_MEM_AP_SIZE) << 22;
+
+ /* Except for PCI & AGP, allow for user override */
if ((pATI->BusType != ATI_BUS_PCI) &&
(pATI->BusType != ATI_BUS_AGP))
{
- Resources[0].type = ResExcMemBlock;
- Resources[0].rBegin = pATI->LinearBase;
- Resources[0].rEnd = pATI->LinearBase +
- pATI->LinearSize - 1;
- if (xf86RegisterResources(pATI->iEntity, Resources,
- ResNone))
- {
- xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
- "Unable to register %d MB linear aperture at"
- " 0x%08X.\n", pATI->LinearSize >> 10,
- pATI->LinearBase);
+ if (pATI->Chip == ATI_CHIP_88800CX)
+ IOValue2 = ~((unsigned long)((1 << 23) - 1));
+ else if (pATI->Chip >= ATI_CHIP_88800GXE)
+ IOValue2 = ~((unsigned long)((1 << 24) - 1));
+ else if (pATI->VideoRAM >= 4096)
+ IOValue2 = ~((unsigned long)((1 << 23) - 1));
+ else
+ IOValue2 = ~((unsigned long)((1 << 22) - 1));
- pATI->LinearSize = 0;
- }
+ if ((IOValue2 &= pGDev->MemBase) &&
+ (IOValue2 <= (MaxBits(CFG_MEM_AP_LOC) << 22)))
+ pATI->LinearBase = IOValue2;
}
- }
- if (!pATI->LinearBase || !pATI->LinearSize)
- {
- if (pATI->VGAAdapter == ATI_ADAPTER_NONE)
+ if (pATI->LinearBase)
{
- xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
- "A linear aperture is not available through this"
- " adapter.\n");
- ATILock(pATI);
- return FALSE;
- }
+ if ((pATI->BusType != ATI_BUS_PCI) &&
+ (pATI->BusType != ATI_BUS_AGP))
+ {
+ if (pATI->VideoRAM < 4096)
+ pATI->LinearSize = 4 * 1024 * 1024;
+ else
+ pATI->LinearSize = 8 * 1024 * 1024;
+
+ Resources[0].type = ResExcMemBlock;
+ Resources[0].rBegin = pATI->LinearBase;
+ Resources[0].rEnd = pATI->LinearBase +
+ pATI->LinearSize - 1;
+ if (xf86RegisterResources(pATI->iEntity, Resources,
+ ResNone))
+ {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ "Unable to register %d MB linear aperture at"
+ " 0x%08X.\n", pATI->LinearSize >> 10,
+ pATI->LinearBase);
- /* Insurance */
- pATI->LinearBase = pATI->LinearSize = 0;
- }
- else
- {
- /*
- * Unless specified in PCI configuration space, set MMIO
- * address to tail end of linear aperture.
- */
- if (!pATI->Block0Base)
- pATI->Block0Base =
- pATI->LinearBase + pATI->LinearSize - 0x00000400U;
+ pATI->LinearSize = 0;
+ }
+ }
+ }
- AcceleratorVideoRAM = (pATI->LinearSize >> 10) - 2; /* 4? */
- if (AcceleratorVideoRAM < pATI->VideoRAM)
+ if (!pATI->LinearBase || !pATI->LinearSize)
{
- if (pATI->Chip < ATI_CHIP_264VTB)
+ if (pATI->VGAAdapter == ATI_ADAPTER_NONE)
{
- /*
- * Don't allow virtual resolution to overlay register
- * aperture(s).
- */
- pScreenInfo->videoRam = AcceleratorVideoRAM;
- xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE,
- "Virtual resolutions will be limited to %d kB to"
- " account for\n accelerator register aperture.\n",
- AcceleratorVideoRAM);
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
+ "A linear aperture is not available through this"
+ " adapter.\n");
+ ATILock(pATI);
+ return FALSE;
}
- else
+
+ /* Insurance */
+ pATI->LinearBase = pATI->LinearSize = 0;
+ }
+ else
+ {
+ /*
+ * Unless specified in PCI configuration space, set MMIO
+ * address to tail end of linear aperture.
+ */
+ if (!pATI->Block0Base)
+ pATI->Block0Base =
+ pATI->LinearBase + pATI->LinearSize - 0x00000400U;
+
+ AcceleratorVideoRAM = (pATI->LinearSize >> 10) - 2; /* 4? */
+ if (AcceleratorVideoRAM < pATI->VideoRAM)
{
- /*
- * On VTB's and later, ATIInit disables the primary
- * register aperture. This is done so the driver can
- * get at the frame buffer memory behind it. For MMIO
- * purposes, the auxillary register aperture will be
- * used instead. Also, ignore the CONFIG_CNTL
- * register's indication of linear aperture size, as it
- * is insufficient for adapters with more than 8MB of
- * video memory.
- */
- if (pATI->VideoRAM > (8 * 1024))
- pATI->LinearSize = 16 * 1024 * 1024;
+ if (pATI->Chip < ATI_CHIP_264VTB)
+ {
+ /*
+ * Don't allow virtual resolution to overlay
+ * register aperture(s).
+ */
+ pScreenInfo->videoRam = AcceleratorVideoRAM;
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE,
+ "Virtual resolutions will be limited to %d kB"
+ " to account for\n accelerator register"
+ " aperture.\n",
+ AcceleratorVideoRAM);
+ }
+ else
+ {
+ /*
+ * On VTB's and later, ATIInit disables the primary
+ * register aperture. This is done so the driver
+ * can get at the frame buffer memory behind it.
+ * For MMIO purposes, the auxillary register
+ * aperture will be used instead. Also, ignore the
+ * CONFIG_CNTL register's indication of linear
+ * aperture size, as it is insufficient for
+ * adapters with more than 8MB of video memory.
+ */
+ if (pATI->VideoRAM > (8 * 1024))
+ pATI->LinearSize = 16 * 1024 * 1024;
+ }
}
- }
- xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
- "Using %d MB linear aperture at 0x%08X.\n",
- pATI->LinearSize >> 20, pATI->LinearBase);
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
+ "Using %d MB linear aperture at 0x%08X.\n",
+ pATI->LinearSize >> 20, pATI->LinearBase);
- /* Only mmap what is needed */
- pATI->ApertureSize = pATI->LinearSize = pATI->VideoRAM * 1024;
+ /* Only mmap what is needed */
+ pATI->ApertureSize = pATI->LinearSize =
+ pATI->VideoRAM * 1024;
+ }
}
}
@@ -1431,7 +1441,7 @@ ATIPreInit
}
else
/*
- * After BIOS initialization, the accelerator (if any) and the VGA won't
+ * After BIOS initialisation, the accelerator (if any) and the VGA won't
* necessarily agree on the amount of video memory, depending on whether or
* where the memory boundary is configured. Any discrepancy will be
* resolved by ATIInit.
@@ -1462,6 +1472,20 @@ ATIPreInit
}
}
+ if (pATI->OptionLinear && !pATI->LinearBase)
+ {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ "Linear aperture not supported in this configuration.\n");
+ pATI->OptionLinear = FALSE;
+ }
+
+ if (pATI->OptionAccel && !pATI->Block0Base)
+ {
+ xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
+ "Acceleration not supported in this configuration.\n");
+ pATI->OptionAccel = FALSE;
+ }
+
if (pATI->Adapter >= ATI_ADAPTER_MACH32)
{
if (pATI->Chip >= ATI_CHIP_264CT)
@@ -1564,14 +1588,12 @@ ATIPreInit
"Cannot shadow a planar frame buffer.\n");
pATI->OptionShadowFB = FALSE;
}
-#if 0
else if (pATI->OptionAccel)
{
xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING,
"Cannot shadow an accelerated frame buffer.\n");
pATI->OptionShadowFB = FALSE;
}
-#endif
else
xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO,
"Using shadow frame buffer.\n");
@@ -1609,7 +1631,7 @@ ATIPreInit
/*
* Assume an internal DAC can handle whatever frequency the internal PLL
- * can produce (with the reference divider set by BIOS initialization), but
+ * can produce (with the reference divider set by BIOS initialisation), but
* default maxClock to a lower chip-specific default.
*/
if ((pATI->DAC & ~0x0FU) == ATI_DAC_INTERNAL)
@@ -1718,6 +1740,20 @@ ATIPreInit
if (pScreenInfo->depth >= 8)
pitchInc *= pScreenInfo->bitsPerPixel;
+ /*
+ * For SGRAM & WRAM adapters, the display engine limits the pitch to
+ * multiples of 64 bytes.
+ */
+ if (pATI->OptionAccel && (pATI->Chip >= ATI_CHIP_264CT) &&
+ ((pATI->Chip >= ATI_CHIP_264VTB) ||
+ (pATI->MemoryType >= MEM_264_SGRAM)))
+ {
+ if (pScreenInfo->bitsPerPixel == 24)
+ pitchInc = 64 * 24;
+ else
+ pitchInc = 64 * 8;
+ }
+
switch (pATI->NewHW.crtc)
{
case ATI_CRTC_VGA:
@@ -1811,6 +1847,10 @@ ATIPreInit
return FALSE;
}
+ /* Map MMIO areas */
+ if (!ATIMapApertures(pScreenInfo, pATI))
+ return FALSE;
+
/* Remove invalid modes */
xf86PruneDriverModes(pScreenInfo);
@@ -1827,18 +1867,20 @@ ATIPreInit
/* Load required modules */
if (!ATILoadModules(pScreenInfo, pATI))
{
+ ATIUnmapApertures(pScreenInfo, pATI);
ATILock(pATI);
return FALSE;
}
#endif
- /* Initialize for panning */
+ /* Initialise for panning */
ATIAdjustPreInit(pScreenInfo, pATI);
- /* Initialize CRTC code */
- ATICRTCPreInit(pScreenInfo, pATI, &pATI->NewHW);
+ /* Initialise CRTC code */
+ ATIAdapterPreInit(pScreenInfo, pATI, &pATI->NewHW);
/* Relock registers */
+ ATIUnmapApertures(pScreenInfo, pATI);
ATILock(pATI);
if (!pScreenInfo->chipset || !*pScreenInfo->chipset)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h
index 507e3d268..d15d45a93 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h,v 1.1 1999/07/06 11:38:34 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h,v 1.2 2000/02/18 12:19:30 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c
index 35c922a2a..c22795f45 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c,v 1.8 1999/11/18 22:27:04 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c,v 1.9 2000/02/18 12:19:30 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -137,7 +137,7 @@ ATIPrintMach64Registers
CARD32 IOValue;
CARD8 dac_read, dac_mask, dac_data, dac_write;
- xf86ErrorFVerb(4, "\n\n Mach64 %s registers:", Description);
+ xf86ErrorFVerb(4, "\n\n Mach64 %s register values:", Description);
Limit = ATIIOPort(IOPortTag(0x1FU, 0x3FU));
Step = ATIIOPort(IOPortTag(0x01U, 0x01U)) - pATI->CPIOBase;
for (Index = pATI->CPIOBase; Index <= Limit; Index += Step)
@@ -190,7 +190,7 @@ ATIPrintMach64PLLRegisters
{
int Index;
- xf86ErrorFVerb(4, "\n\n Mach64 PLL registers:");
+ xf86ErrorFVerb(4, "\n\n Mach64 PLL register values:");
for (Index = 0; Index < 64; Index++)
{
if (!(Index & 3))
@@ -327,7 +327,7 @@ ATIPrintRegisters
if (pATI->ChipHasSUBSYS_CNTL)
{
- xf86ErrorFVerb(4, "\n\n 8514/A registers:");
+ xf86ErrorFVerb(4, "\n\n 8514/A register values:");
for (Index = 0x02E8U; Index <= 0x0FEE8; Index += 0x0400U)
{
if (!((Index - 0x02E8U) & 0x0C00U))
@@ -337,7 +337,7 @@ ATIPrintRegisters
if (pATI->Adapter >= ATI_ADAPTER_MACH8)
{
- xf86ErrorFVerb(4, "\n\n Mach8/Mach32 registers:");
+ xf86ErrorFVerb(4, "\n\n Mach8/Mach32 register values:");
for (Index = 0x02EEU; Index <= 0x0FEEE; Index += 0x0400U)
{
if (!((Index - 0x02EEU) & 0x0C00U))
@@ -384,7 +384,7 @@ ATIPrintRegisters
ATIPrintMach64PLLRegisters(pATI);
- xf86ErrorFVerb(4, "\n\n LCD registers:");
+ xf86ErrorFVerb(4, "\n\n LCD register values:");
for (Index = 0; Index < 64; Index++)
{
if (!(Index & 3))
@@ -396,7 +396,7 @@ ATIPrintRegisters
tv_out_index = inl(pATI->CPIO_TV_OUT_INDEX);
- xf86ErrorFVerb(4, "\n\n TV_OUT registers:");
+ xf86ErrorFVerb(4, "\n\n TV_OUT register values:");
for (Index = 0; Index < 256; Index++)
{
if (!(Index & 3))
@@ -467,7 +467,7 @@ ATIPrintRegisters
if ((pVideo = pATI->PCIInfo))
{
pPCI = (pciConfigPtr)(pVideo->thisCard);
- xf86ErrorFVerb(4, "\n\n PCI configuration registers:");
+ xf86ErrorFVerb(4, "\n\n PCI configuration register values:");
for (Index = 0; Index < 256; Index+= 4)
{
if (!(Index & 15))
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h
index 44958e896..072997baf 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h,v 1.3 1999/07/06 11:38:34 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h,v 1.4 2000/02/18 12:19:31 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h
index 43720c5cb..df860d178 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h,v 1.1 1999/07/06 11:38:34 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h,v 1.2 2000/02/18 12:19:31 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
index 4376ad683..dac0fe833 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.14 1999/10/15 15:45:55 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.17 2000/02/18 12:19:32 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -831,7 +831,15 @@ ATIProbe
ATIPtrs = (ATIPtr *)xnfrealloc(ATIPtrs, SizeOf(ATIPtr) * nATIPtr); \
ATIPtrs[nATIPtr - 1] = (_p); \
(_p)->iEntity = -2; \
- } while(0)
+ } while (0)
+
+ /*
+ * This driver doesn't invoke, nor depend on, any support for fbdev. Also,
+ * temporarily disable -configure support until it gets fixed to not depend
+ * on optional driver behaviour.
+ */
+ if (flags & (PROBE_DETECTFBDEV | PROBE_DETECTPCI | PROBE_DETECTISA))
+ return FALSE;
if (!(flags & PROBE_DETECT))
{
@@ -839,7 +847,7 @@ ATIProbe
* Get a list of XF86Config device sections whose "Driver" is either
* not specified, or specified as this driver. From this list,
* eliminate those device sections that specify a "Chipset" or a
- * "ChipID" not recognized by the driver. Those device sections that
+ * "ChipID" not recognised by the driver. Those device sections that
* specify a "ChipRev" without a "ChipID" are also weeded out.
*/
if ((nGDev = xf86MatchDevice(ATI_NAME, &GDevs)) <= 0)
@@ -1068,15 +1076,7 @@ ATIProbe
/* For now, ignore Rage128's */
Chip = ATIChipID(pVideo->chipType, pVideo->chipRev);
if (Chip > ATI_CHIP_Mach64)
- {
- xf86Msg(X_WARNING,
- ATI_NAME ": PCI/AGP ATI Rage 128 detected in slot"
- " %d:%d:%d is not yet supported\n by this driver. Use"
- " separate (upcoming) driver from Precision Insight"
- " Inc\n instead.\n",
- pVideo->bus, pVideo->device, pVideo->func);
continue;
- }
pATI = ATIMach64Probe(pVideo->ioBase[1], BLOCK_IO,
pVideo->chipType, Chip);
@@ -1096,7 +1096,7 @@ ATIProbe
* unlikely to occur in practice.
*
* First, look for non-ATI shareable VGA's. For now, these must have
- * been previously initialized by their BIOS.
+ * been previously initialised by their BIOS.
*/
if (ATICheckSparseIOBases(ProbeFlags, ATTRX, 16, TRUE) == DoProbe)
{
@@ -1602,7 +1602,7 @@ NoVGAWonder:;
* for Mach32's. ChipID is optional for for Mach32's, and both
* specifications are optional for Mach64's. Lastly, allow both
* specifications to override their detected value in the case of
- * Mach64 adapters whose ChipID is unrecognized.
+ * Mach64 adapters whose ChipID is unrecognised.
*/
if (pGDev->chipID >= 0)
{
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h
index b7c27b7dc..bde7d2fd7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h,v 1.3 1999/07/06 11:38:35 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h,v 1.4 2000/02/18 12:19:34 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h
index cb9a1ea78..d25cd7622 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h,v 1.3 1999/07/06 11:38:36 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h,v 1.4 2000/02/18 12:19:34 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h
index 658fb86f7..c4c0f616b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h,v 1.7 1999/10/13 04:21:10 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h,v 1.8 2000/02/18 12:19:35 tsi Exp $ */
/*
- * Copyright 1994 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1994 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -44,6 +44,9 @@
#define BLOCK_IO_BASE 0xff00u
#define BLOCK_IO_SELECT 0x00fcu
+#define MM_IO_SELECT 0x03fcu
+#define BLOCK_SELECT 0x0400u
+
#define IO_BYTE_SELECT 0x0003u
#define SPARSE_IO_PORT (SPARSE_IO_BASE | IO_BYTE_SELECT)
@@ -54,9 +57,9 @@
#define IOPortTag(_SparseIOSelect, _BlockIOSelect) \
(SetBits(_SparseIOSelect, SPARSE_IO_SELECT) | \
- SetBits(_BlockIOSelect, BLOCK_IO_SELECT))
-#define SparseIOTag(_IOSelect) IOPortTag(_IOSelect, (unsigned)(-1))
-#define BlockIOTag(_IOSelect) IOPortTag((unsigned)(-1), _IOSelect)
+ SetBits(_BlockIOSelect, BLOCK_SELECT | MM_IO_SELECT))
+#define SparseIOTag(_IOSelect) IOPortTag(_IOSelect, 0)
+#define BlockIOTag(_IOSelect) IOPortTag(0, _IOSelect)
/* MDA/CGA/EGA/VGA I/O ports */
#define GENVS 0x0102u /* Write (and Read on uC only) */
@@ -464,7 +467,6 @@
#define BGR24 0x0400u /* Mach32 */
#define xBGR24 0x0600u /* Mach32 */
#define DAC_8_BIT_EN 0x4000u /* Mach32 */
-#define PIX_WIDTH_16BPP PIXEL_WIDTH_16 /* Mach32 */
#define ORDER_16BPP_565 RGB16_565 /* Mach32 */
#define BOUNDS_BOTTOM 0x7eeeu /* Read */
#define MISC_CNTL 0x7eeeu /* Write */ /* Mach32 */
@@ -488,7 +490,7 @@
#define DEST_X_END 0xaaeeu /* Write */
#define DEST_Y_END 0xaeeeu /* Write */
#define R_H_TOTAL_DISP 0xb2eeu /* Read */ /* Mach32 */
-#define SRC_X_START 0xb2eeu /* Write */
+#define SRC_X_STRT 0xb2eeu /* Write */
#define R_H_SYNC_STRT 0xb6eeu /* Read */ /* Mach32 */
#define ALU_BG_FN 0xb6eeu /* Write */
#define R_H_SYNC_WID 0xbaeeu /* Read */ /* Mach32 */
@@ -572,10 +574,10 @@
#define CRTC_VLINE_INT 0x00000010ul
#define CRTC_VLINE_SYNC 0x00000020ul
#define CRTC_FRAME 0x00000040ul
-#define CRTC_SNAPSHOT_INT_EN 0x00000080ul /* GT3 */
-#define CRTC_SNAPSHOT_INT 0x00000100ul /* GT3 */
-#define CRTC_I2C_INT_EN 0x00000200ul /* GT3 */
-#define CRTC_I2C_INT 0x00000400ul /* GT3 */
+#define CRTC_SNAPSHOT_INT_EN 0x00000080ul /* GTPro */
+#define CRTC_SNAPSHOT_INT 0x00000100ul /* GTPro */
+#define CRTC_I2C_INT_EN 0x00000200ul /* GTPro */
+#define CRTC_I2C_INT 0x00000400ul /* GTPro */
#define CRTC2_VBLANK 0x00000800ul /* LTPro */
#define CRTC2_VBLANK_INT_EN 0x00001000ul /* LTPro */
#define CRTC2_VBLANK_INT 0x00002000ul /* LTPro */
@@ -596,7 +598,7 @@
#define CRTC2_VLINE_SYNC 0x10000000ul /* LTPro */
#define CRTC_SNAPSHOT2_INT_EN 0x20000000ul /* LTPro */
#define CRTC_SNAPSHOT2_INT 0x40000000ul /* LTPro */
-#define CRTC_VBLANK_BIT2_INT 0x80000000ul /* GT3/LTPro */
+#define CRTC_VBLANK_BIT2_INT 0x80000000ul /* GTPro */
#define CRTC_INT_ENS /* *** UPDATE ME *** */ \
( \
CRTC_VBLANK_INT_EN | \
@@ -643,14 +645,6 @@
#define CRTC_DISPLAY_DIS 0x00000040ul
#define CRTC_VGA_XOVERSCAN 0x00000080ul
#define CRTC_PIX_WIDTH 0x00000700ul
-#define CRTC_PIX_WIDTH_1BPP 0x00000000ul
-#define CRTC_PIX_WIDTH_4BPP 0x00000100ul
-#define CRTC_PIX_WIDTH_8BPP 0x00000200ul
-#define CRTC_PIX_WIDTH_15BPP 0x00000300ul
-#define CRTC_PIX_WIDTH_16BPP 0x00000400ul
-#define CRTC_PIX_WIDTH_24BPP 0x00000500ul
-#define CRTC_PIX_WIDTH_32BPP 0x00000600ul
-/* ? 0x00000700ul */
#define CRTC_BYTE_PIX_ORDER 0x00000800ul
#define CRTC_VSYNC_INT_EN 0x00001000ul /* XC/XL */
#define CRTC_VSYNC_INT 0x00002000ul /* XC/XL */
@@ -660,14 +654,6 @@
#define CRTC_FIFO_LWM 0x000f0000ul
#define CRTC_HVSYNC_IO_DRIVE 0x00010000ul /* XC/XL */
#define CRTC2_PIX_WIDTH 0x000e0000ul /* LTPro */
-#define CRTC2_PIX_WIDTH_NONE 0x00000000ul
-#define CRTC2_PIX_WIDTH_8BPP 0x00020000ul
-/* ? 0x00040000ul */
-#define CRTC2_PIX_WIDTH_15BPP 0x00060000ul
-#define CRTC2_PIX_WIDTH_16BPP 0x00080000ul
-#define CRTC2_PIX_WIDTH_24BPP 0x000a0000ul
-#define CRTC2_PIX_WIDTH_32BPP 0x000c0000ul
-#define CRTC2_PIX_WIDTH_YUV422 0x000e0000ul
#define CRTC_VGA_128KAP_PAGING 0x00100000ul /* VT/GT */
#define CRTC_DISPREQ_ONLY 0x00200000ul /* VT/GT */
#define CRTC_VFC_SYNC_TRISTATE 0x00200000ul /* VTB/GTB/LT */
@@ -710,14 +696,14 @@
#define MEM_BUF_CNTL BlockIOTag(0x0bu) /* VTB/GTB/LT */
#define SHARED_CNTL BlockIOTag(0x0cu) /* VTB/GTB/LT */
#define SHARED_MEM_CONFIG BlockIOTag(0x0du) /* VTB/GTB/LT */
-#define MEM_ADDR_CONFIG BlockIOTag(0x0du) /* GT3/LTPro */
+#define MEM_ADDR_CONFIG BlockIOTag(0x0du) /* GTPro */
#define SHARED_CNTL_CTD BlockIOTag(0x0eu) /* CTD */
/* ? 0x00fffffful */
#define CTD_FIFO5 0x01000000ul
/* ? 0xfe000000ul */
#define CRT_TRAP BlockIOTag(0x0eu) /* VTB/GTB/LT */
#define DSTN_CONTROL BlockIOTag(0x0fu) /* LT */
-#define I2C_CNTL_0 BlockIOTag(0x0fu) /* GT3/LTPro */
+#define I2C_CNTL_0 BlockIOTag(0x0fu) /* GTPro */
#define OVR_CLR IOPortTag(0x08u, 0x10u)
#define OVR_CLR_8 0x000000fful
#define OVR_CLR_B 0x0000ff00ul
@@ -747,7 +733,7 @@
/* ? 0xf8000000ul */
#define DSP2_CONFIG BlockIOTag(0x15u) /* LTPro */
#define DSP2_ON_OFF BlockIOTag(0x16u) /* LTPro */
-#define EXT_CRTC_GEN_CNTL BlockIOTag(0x17u) /* VT-A4 */
+#define EXT_CRTC_GEN_CNTL BlockIOTag(0x17u) /* VT-A4 (W) */
#define CRTC2_OFF_PITCH BlockIOTag(0x17u) /* LTPro */
#define CUR_CLR0 IOPortTag(0x0bu, 0x18u)
#define CUR_CLR1 IOPortTag(0x0cu, 0x19u)
@@ -785,6 +771,63 @@
#define GP_IO IOPortTag(0x1eu, 0x1eu) /* VT/GT */
#define GP_IO_CNTL BlockIOTag(0x1fu) /* VT/GT */
#define HW_DEBUG BlockIOTag(0x1fu) /* VTB/GTB/LT */
+#define FAST_SRCCOPY_DIS 0x00000001ul
+#define BYPASS_SUBPIC_DBF 0x00000001ul /* XL/XC */
+#define SRC_AUTONA_FIX_DIS 0x00000002ul
+#define SYNC_PD_EN 0x00000002ul /* Mobility */
+#define DISP_QW_FIX_DIS 0x00000004ul
+#define GUIDST_WB_EXP_DIS 0x00000008ul
+#define CYC_ALL_FIX_DIS 0x00000008ul /* GTPro */
+#define AGPPLL_FIX_EN 0x00000008ul /* Mobility */
+#define SRC_AUTONA_ALWAYS_EN 0x00000010ul
+#define GUI_BEATS_HOST_P 0x00000010ul /* GTPro */
+#define DRV_CNTL_DQMB_WEB 0x00000020ul
+#define FAST_FILL_SCISSOR_DIS 0x00000020ul /* GT2c/VT4 */
+#define INTER_BLIT_FIX_DIS 0x00000020ul /* GTPro */
+#define DRV_CNTL_MA 0x00000040ul
+#define AUTO_BLKWRT_COLOR_DIS 0x00000040ul /* GT2c/VT4 */
+#define INTER_PRIM_DIS 0x00000040ul /* GTPro */
+#define DRV_CNTL_MD 0x00000080ul
+#define CHG_DEV_ID 0x00000100ul
+#define SRC_TRACK_DST_FIX_DIS 0x00000200ul
+#define HCLK_FB_SKEW 0x00000380ul /* GT2c/VT4 */
+#define SRC_TRACK_DST_FIX_DIS_P 0x00000080ul /* GTPro */
+#define AUTO_BLKWRT_COLOR_DIS_P 0x00000100ul /* GTPro */
+#define INTER_LINE_OVERLAP_DIS 0x00000200ul /* GTPro */
+#define MEM_OE_PULLBACK 0x00000400ul
+#define DBL_BUFFER_EN 0x00000400ul /* GTPro */
+#define MEM_WE_FIX_DIS 0x00000800ul
+#define MEM_OE_PULLBACK_B 0x00000800ul /* GT2c/VT4 */
+#define CMDFIFO_SIZE_DIS_P 0x00000800ul /* GTPro */
+#define RD_EN_FIX_DIS 0x00001000ul
+#define MEM_WE_FIX_DIS_B 0x00001000ul
+#define AUTO_FF_DIS 0x00001000ul /* GTPro */
+#define CMDFIFO_SIZE_DIS 0x00002000ul /* GT2c/VT4 */
+#define AUTO_BLKWRT_DIS 0x00002000ul /* GTPro */
+#define GUI_BEATS_HOST 0x00004000ul /* GT2c/VT4 */
+#define ORED_INVLD_RB_CACHE 0x00004000ul /* GTPro */
+#define BLOCK_DBL_BUF 0x00008000ul /* GTPro */
+#define R2W_TURNAROUND_DELAY 0x00020000ul /* GT2c/VT4 */
+#define ENA_32BIT_DATA_BUS 0x00040000ul /* GT2c/VT4 */
+#define HCLK_FB_SKEW_P 0x00070000ul /* GTPro */
+#define ENA_FLASH_ROM 0x00080000ul /* GT2c/VT4 */
+#define DISABLE_SWITCH_FIX 0x00080000ul /* GTPro */
+#define MCLK_START_EN 0x00080000ul /* LTPro */
+#define SEL_VBLANK_BDL_BUF 0x00100000ul /* GTPro */
+#define CMDFIFO_64EN 0x00200000ul /* GTPro */
+#define BM_FIX_DIS 0x00400000ul /* GTPro */
+#define Z_SWITCH_EN 0x00800000ul /* LTPro */
+#define FLUSH_HOST_WB 0x01000000ul /* GTPro */
+#define HW_DEBUG_WRITE_MSK_FIX_DIS 0x02000000ul /* LTPro */
+#define Z_NO_WRITE_EN 0x04000000ul /* LTPro */
+#define DISABLE_PCLK_RESET_P 0x08000000ul /* LTPro */
+#define PM_D3_SUPPORT_ENABLE_P 0x10000000ul /* LTPro */
+#define STARTCYCLE_FIX_ENABLE 0x20000000ul /* LTPro */
+#define DONT_RST_CHAREN 0x20000000ul /* XL/XC */
+#define C3_FIX_ENABLE 0x40000000ul /* LTPro */
+#define BM_HOSTRA_EN 0x40000000ul /* XL/XC */
+#define PKGBGAb 0x80000000ul /* XL/XC */
+#define AUTOEXP_HORZ_FIX 0x80000000ul /* Mobility */
#define SCRATCH_REG0 IOPortTag(0x10u, 0x20u)
#define SCRATCH_REG1 IOPortTag(0x11u, 0x21u)
/* BIOS_BASE_SEGMENT 0x0000007ful */ /* As above */
@@ -792,7 +835,7 @@
#define BIOS_INIT_DAC_SUBTYPE 0x0000f000ul
/* ? 0xffff0000ul */
#define SCRATCH_REG2 BlockIOTag(0x22u) /* LT */
-#define SCRATCH_REG3 BlockIOTag(0x23u) /* GT3/LTPro */
+#define SCRATCH_REG3 BlockIOTag(0x23u) /* GTPro */
#define CLOCK_CNTL IOPortTag(0x12u, 0x24u)
#define CLOCK_BIT 0x00000004ul /* For ICS2595 */
#define CLOCK_PULSE 0x00000008ul /* For ICS2595 */
@@ -805,14 +848,14 @@
#define PLL_ADDR 0x0000fc00ul /* For internal PLL */
#define PLL_DATA 0x00ff0000ul /* For internal PLL */
/* ? 0xff000000ul */
-#define CONFIG_STAT64_1 BlockIOTag(0x25u) /* GT3/LTPro */
+#define CONFIG_STAT64_1 BlockIOTag(0x25u) /* GTPro */
#define CFG_SUBSYS_DEV_ID 0x000000fful
#define CFG_SUBSYS_VEN_ID 0x00ffff00ul
/* ? 0x1f000000ul */
#define CFG_DIMM_TYPE 0xe0000000ul
#define CFG_PCI_SUBSYS_DEV_ID 0x0000fffful /* XC/XL */
#define CFG_PCI_SUBSYS_VEN_ID 0xffff0000ul /* XC/XL */
-#define CONFIG_STAT64_2 BlockIOTag(0x26u) /* GT3/LTPro */
+#define CONFIG_STAT64_2 BlockIOTag(0x26u) /* GTPro */
#define CFG_DIMM_TYPE_3 0x00000001ul
/* ? 0x0000001eul */
#define CFG_ROMWRTEN 0x00000020ul
@@ -844,7 +887,7 @@
#define BUS_APER_REG_DIS 0x00000010ul /* VTB/GTB/LT */
#define BUS_EXTRA_PIPE_DIS 0x00000020ul /* VTB/GTB/LT */
#define BUS_MASTER_DIS 0x00000040ul /* VTB/GTB/LT */
-#define BUS_ROM_WRT_EN 0x00000080ul /* GT3/LTPro */
+#define BUS_ROM_WRT_EN 0x00000080ul /* GTPro */
#define BUS_ROM_PAGE 0x00000f00ul
#define BUS_MINOR_REV_ID 0x00000700ul /* LTPro */
/* First silicom - Prototype (A11) 0x00000000ul */
@@ -868,9 +911,9 @@
#define BUS_FIFO_ERR_INT 0x00200000ul
#define BUS_MSTR_RD_LINE 0x00200000ul /* VTB/GTB/LT */
#define BUS_HOST_ERR_INT_EN 0x00400000ul
-#define BUS_SUSPEND 0x00400000ul /* GT3/LTPro */
+#define BUS_SUSPEND 0x00400000ul /* GTPro */
#define BUS_HOST_ERR_INT 0x00800000ul
-#define BUS_LAT16X 0x00800000ul /* GT3/LTPro */
+#define BUS_LAT16X 0x00800000ul /* GTPro */
#define BUS_PCI_DAC_WS 0x07000000ul
#define BUS_RD_DISCARD_EN 0x01000000ul /* VTB/GTB/LT */
#define BUS_RD_ABORT_EN 0x02000000ul /* VTB/GTB/LT */
@@ -927,10 +970,10 @@
#define CTL_MEM_EXT_RMW_CYC_EN 0x00001000ul /* GX/CX */
#define CTL_MEM_TCRD 0x00001000ul /* VTB/GTB/LT */
#define CTL_MEM_DLL_RESET 0x00002000ul /* VT/GT */
-#define CTL_MEM_TR2W 0x00002000ul /* GT3/LTPro */
+#define CTL_MEM_TR2W 0x00002000ul /* GTPro */
#define CTL_MEM_ACTV_PRE 0x0000c000ul /* VT/GT */
-#define CTL_MEM_CAS_PHASE 0x00004000ul /* GT3/LTPro */
-#define CTL_MEM_OE_PULLBACK 0x00008000ul /* GT3/LTPro */
+#define CTL_MEM_CAS_PHASE 0x00004000ul /* GTPro */
+#define CTL_MEM_OE_PULLBACK 0x00008000ul /* GTPro */
#define CTL_MEM_TWR 0x0000c000ul /* XC/XL */
#define CTL_MEM_BNDRY 0x00030000ul
#define CTL_MEM_BNDRY_0K 0x00000000ul
@@ -959,7 +1002,7 @@
#define MEM_VGA_RPS0 0x0000fffful
#define MEM_VGA_RPS1 0xffff0000ul
#define LT_GIO BlockIOTag(0x2fu) /* LT */
-#define I2C_CNTL_1 BlockIOTag(0x2fu) /* GT3/LTPro */
+#define I2C_CNTL_1 BlockIOTag(0x2fu) /* GTPro */
#define DAC_REGS IOPortTag(0x17u, 0x30u) /* 4 separate bytes */
#define DAC_CNTL IOPortTag(0x18u, 0x31u)
#define DAC_EXT_SEL 0x00000003ul
@@ -1016,7 +1059,7 @@
#define AUTO_HORZ_RATIO 0x20000000ul /* XC/XL */
#define HORZ_STRETCH_MODE 0x40000000ul
#define HORZ_STRETCH_EN 0x80000000ul
-#define EXT_DAC_REGS BlockIOTag(0x32u) /* GT3 */
+#define EXT_DAC_REGS BlockIOTag(0x32u) /* GTPro */
#define VERT_STRETCHING BlockIOTag(0x33u) /* LT */
#define VERT_STRETCH_RATIO0 0x000003fful
#define VERT_STRETCH_RATIO1 0x000ffc00ul
@@ -1046,7 +1089,7 @@
#define GEN_BLOCK_WR_EN 0x00000200ul /* GX */
/* ? 0x00000200ul */ /* CX/264xT */
#define GEN_SOFT_RESET 0x00000200ul /* VTB/GTB/LT */
-#define GEN_MEM_TRISTATE 0x00000400ul /* GT3/LTPro */
+#define GEN_MEM_TRISTATE 0x00000400ul /* GTPro */
/* ? 0x00000800ul */
#define GEN_TEST_VECT_MODE 0x00003000ul /* VT/GT */
/* ? 0x0000c000ul */
@@ -1101,7 +1144,7 @@
#define USE_SHADOWED_ROWCUR 0x20000000ul
#define SHADOW_EN 0x40000000ul
#define SHADOW_RW_EN 0x80000000ul
-#define CUSTOM_MACRO_CNTL BlockIOTag(0x35u) /* GT3/LTPro */
+#define CUSTOM_MACRO_CNTL BlockIOTag(0x35u) /* GTPro */
#define POWER_MANAGEMENT BlockIOTag(0x36u) /* LT */
#define PWR_MGT_ON 0x00000001ul
#define PWR_MGT_MODE 0x00000006ul
@@ -1151,7 +1194,7 @@
#define CFG_MEM_TYPE 0x00000038ul /* GX/CX */
#define CFG_DUAL_CAS_EN_T 0x00000008ul /* 264xT */
#define CFG_ROM_128K_EN 0x00000008ul /* VTB/GTB/LT */
-#define CFG_ROM_REMAP 0x00000008ul /* GT3/LTPro */
+#define CFG_ROM_REMAP 0x00000008ul /* GTPro */
#define CFG_VGA_EN_T 0x00000010ul /* VT/GT */
#define CFG_CLOCK_EN 0x00000020ul /* 264xT */
#define CFG_DUAL_CAS_EN 0x00000040ul /* GX/CX */
@@ -1169,11 +1212,11 @@
#define CFG_BOARD_ID 0x0000ff00ul /* VT/GT */
#define CFG_EXT_RAM_ADDR 0x003f0000ul /* GX/CX */
#define CFG_PANEL_ID 0x001f0000ul /* LT */
-#define CFG_MACROVISION_EN 0x00200000ul /* GT3/LTPro */
+#define CFG_MACROVISION_EN 0x00200000ul /* GTPro */
#define CFG_ROM_DIS 0x00400000ul /* GX/CX */
-#define CFG_PCI33EN 0x00400000ul /* GT3/LTPro */
+#define CFG_PCI33EN 0x00400000ul /* GTPro */
#define CFG_VGA_EN 0x00800000ul /* GX/CX */
-#define CFG_FULLAGP 0x00800000ul /* GT3/LTPro */
+#define CFG_FULLAGP 0x00800000ul /* GTPro */
#define CFG_ARITHMOS_ENABLE 0x00800000ul /* XC/XL */
#define CFG_LOCAL_BUS_CFG 0x01000000ul /* GX/CX */
#define CFG_CHIP_EN 0x02000000ul /* GX/CX */
@@ -1196,6 +1239,656 @@
#define TVO_CNTL BlockIOTag(0x3fu) /* VTB/GTB/LT */
/* GP_IO IOPortTag(0x1eu, 0x1eu) */ /* See above */
/* CRTC_H_TOTAL_DISP IOPortTag(0x1fu, 0x00u) */ /* Duplicate */
+#define DST_OFF_PITCH BlockIOTag(0x40u)
+#define DST_OFFSET 0x000ffffful
+/* ? 0x00300000ul */
+#define DST_PITCH 0xffc00000ul
+#define DST_X BlockIOTag(0x41u)
+#define DST_Y BlockIOTag(0x42u)
+#define DST_Y_X BlockIOTag(0x43u)
+#define DST_y 0x00007ffful
+#define DST_Y_LSB 0x00008000ul /* GTPro */
+#define DST_x 0x7fff0000ul
+#define DST_Y_SECONDARY_LSB 0x80000000ul /* GTPro */
+#define DST_WIDTH BlockIOTag(0x44u)
+#define DST_HEIGHT BlockIOTag(0x45u)
+#define DST_HEIGHT_WIDTH BlockIOTag(0x46u)
+#define DST_height 0x0000fffful
+#define DST_width 0xffff0000ul
+#define DST_X_WIDTH BlockIOTag(0x47u)
+#define DST_BRES_LNTH BlockIOTag(0x48u)
+#define DST_BRES_ERR BlockIOTag(0x49u)
+#define DST_BRES_INC BlockIOTag(0x4au)
+#define DST_BRES_DEC BlockIOTag(0x4bu)
+#define DST_CNTL BlockIOTag(0x4cu)
+#define DST_X_DIR 0x00000001ul
+#define DST_Y_DIR 0x00000002ul
+#define DST_Y_MAJOR 0x00000004ul
+#define DST_X_TILE 0x00000008ul
+#define DST_Y_TILE 0x00000010ul
+#define DST_LAST_PEL 0x00000020ul
+#define DST_POLYGON_EN 0x00000040ul
+#define DST_24_ROT_EN 0x00000080ul
+#define DST_24_ROT 0x00000700ul
+#define DST_BRES_SIGN 0x00000800ul /* GX/CX */
+#define DST_BRES_ZERO 0x00000800ul /* CT */
+#define DST_POLYGON_RTEDGE_DIS 0x00001000ul /* CT */
+#define TRAIL_X_DIR 0x00002000ul /* GT */
+#define TRAP_FILL_DIR 0x00004000ul /* GT */
+#define TRAIL_BRES_SIGN 0x00008000ul /* GT */
+/* ? 0x00010000ul */
+#define BRES_SIGN_AUTO 0x00020000ul /* GT */
+/* ? 0x00040000ul */
+#define ALPHA_OVERLAP_ENB 0x00080000ul /* GTPro */
+#define SUB_PIX_ON 0x00100000ul /* GTPro */
+/* ? 0xffe00000ul */
+/* DST_Y_X BlockIOTag(0x4du) */ /* Duplicate */
+#define TRAIL_BRES_ERR BlockIOTag(0x4eu) /* GT */
+#define TRAIL_BRES_INC BlockIOTag(0x4fu) /* GT */
+#define TRAIL_BRES_DEC BlockIOTag(0x50u) /* GT */
+#define LEAD_BRES_LNTH BlockIOTag(0x51u) /* GT */
+#define Z_OFF_PITCH BlockIOTag(0x52u) /* GT */
+#define Z_CNTL BlockIOTag(0x53u) /* GT */
+#define ALPHA_TST_CNTL BlockIOTag(0x54u) /* GTPro */
+/* ? BlockIOTag(0x55u) */
+#define SECONDARY_STW_EXP BlockIOTag(0x56u) /* GTPro */
+#define SECONDARY_S_X_INC BlockIOTag(0x57u) /* GTPro */
+#define SECONDARY_S_Y_INC BlockIOTag(0x58u) /* GTPro */
+#define SECONDARY_S_START BlockIOTag(0x59u) /* GTPro */
+#define SECONDARY_W_X_INC BlockIOTag(0x5au) /* GTPro */
+#define SECONDARY_W_Y_INC BlockIOTag(0x5bu) /* GTPro */
+#define SECONDARY_W_START BlockIOTag(0x5cu) /* GTPro */
+#define SECONDARY_T_X_INC BlockIOTag(0x5du) /* GTPro */
+#define SECONDARY_T_Y_INC BlockIOTag(0x5eu) /* GTPro */
+#define SECONDARY_T_START BlockIOTag(0x5fu) /* GTPro */
+#define SRC_OFF_PITCH BlockIOTag(0x60u)
+#define SRC_OFFSET 0x000ffffful
+/* ? 0x00300000ul */
+#define SRC_PITCH 0xffc00000ul
+#define SRC_X BlockIOTag(0x61u)
+#define SRC_Y BlockIOTag(0x62u)
+#define SRC_Y_X BlockIOTag(0x63u)
+#define SRC_y 0x00007ffful
+/* ? 0x00008000ul */
+#define SRC_x 0x3fff0000ul
+/* ? 0xc0000000ul */
+#define SRC_WIDTH1 BlockIOTag(0x64u)
+#define SRC_HEIGHT1 BlockIOTag(0x65u)
+#define SRC_HEIGHT1_WIDTH1 BlockIOTag(0x66u)
+#define SRC_height1 0x00007ffful
+/* ? 0x00008000ul */
+#define SRC_width1 0x3fff0000ul
+/* ? 0xc0000000ul */
+#define SRC_X_START BlockIOTag(0x67u)
+#define SRC_Y_START BlockIOTag(0x68u)
+#define SRC_Y_X_START BlockIOTag(0x69u)
+#define SRC_y_start 0x00007ffful
+/* ? 0x00008000ul */
+#define SRC_x_start 0x3fff0000ul
+/* ? 0xc0000000ul */
+#define SRC_WIDTH2 BlockIOTag(0x6au)
+#define SRC_HEIGHT2 BlockIOTag(0x6bu)
+#define SRC_HEIGHT2_WIDTH2 BlockIOTag(0x6cu)
+#define SRC_height2 0x00007ffful
+/* ? 0x00008000ul */
+#define SRC_width2 0x3fff0000ul
+/* ? 0xc0000000ul */
+#define SRC_CNTL BlockIOTag(0x6du)
+#define SRC_PATT_EN 0x00000001ul
+#define SRC_PATT_ROT_EN 0x00000002ul
+#define SRC_LINEAR_EN 0x00000004ul
+#define SRC_BYTE_ALIGN 0x00000008ul
+#define SRC_LINE_X_DIR 0x00000010ul
+#define SRC_8X8X8_BRUSH 0x00000020ul /* VTB/GTB */
+#define FAST_FILL_EN 0x00000040ul /* VTB/GTB */
+#define SRC_TRACK_DST 0x00000080ul /* VTB/GTB */
+#define BUS_MASTER_EN 0x00000100ul /* VTB/GTB */
+#define BUS_MASTER_SYNC 0x00000200ul /* VTB/GTB */
+#define BUS_MASTER_OP 0x00000c00ul /* VTB/GTB */
+#define SRC_8X8X8_BRUSH_LOADED 0x00001000ul /* VTB/GTB */
+#define COLOR_REG_WRITE_EN 0x00002000ul /* VTB/GTB */
+#define BLOCK_WRITE_EN 0x00004000ul /* VTB/GTB */
+/* ? 0xffff8000ul */
+/* ? BlockIOTag(0x6eu) */
+/* ? BlockIOTag(0x6fu) */
+#define SCALE_Y_OFF BlockIOTag(0x70u) /* GT */
+#define SCALE_OFF BlockIOTag(0x70u) /* GTPro */
+#define SECONDARY_SCALE_OFF BlockIOTag(0x70u) /* GTPro */
+#define TEX_0_OFF BlockIOTag(0x70u) /* GT */
+#define TEX_1_OFF BlockIOTag(0x71u) /* GT */
+#define TEX_2_OFF BlockIOTag(0x72u) /* GT */
+#define TEX_3_OFF BlockIOTag(0x73u) /* GT */
+#define TEX_4_OFF BlockIOTag(0x74u) /* GT */
+#define TEX_5_OFF BlockIOTag(0x75u) /* GT */
+#define TEX_6_OFF BlockIOTag(0x76u) /* GT */
+#define SCALE_WIDTH BlockIOTag(0x77u) /* GT */
+#define TEX_7_OFF BlockIOTag(0x77u) /* GT */
+#define SCALE_HEIGHT BlockIOTag(0x78u) /* GT */
+#define TEX_8_OFF BlockIOTag(0x78u) /* GT */
+#define TEX_9_OFF BlockIOTag(0x79u) /* GT */
+#define TEX_10_OFF BlockIOTag(0x7au) /* GT */
+#define S_Y_INC BlockIOTag(0x7bu) /* GT */
+#define SCALE_Y_PITCH BlockIOTag(0x7bu) /* GT */
+#define SCALE_X_INC BlockIOTag(0x7cu) /* GT */
+#define RED_X_INC BlockIOTag(0x7cu) /* GT */
+#define GREEN_X_INC BlockIOTag(0x7du) /* GT */
+#define SCALE_Y_INC BlockIOTag(0x7du) /* GT */
+#define SCALE_VACC BlockIOTag(0x7eu) /* GT */
+#define SCALE_3D_CNTL BlockIOTag(0x7fu) /* GT */
+#define HOST_DATA_0 BlockIOTag(0x80u)
+#define HOST_DATA_1 BlockIOTag(0x81u)
+#define HOST_DATA_2 BlockIOTag(0x82u)
+#define HOST_DATA_3 BlockIOTag(0x83u)
+#define HOST_DATA_4 BlockIOTag(0x84u)
+#define HOST_DATA_5 BlockIOTag(0x85u)
+#define HOST_DATA_6 BlockIOTag(0x86u)
+#define HOST_DATA_7 BlockIOTag(0x87u)
+#define HOST_DATA_8 BlockIOTag(0x88u)
+#define HOST_DATA_9 BlockIOTag(0x89u)
+#define HOST_DATA_A BlockIOTag(0x8au)
+#define HOST_DATA_B BlockIOTag(0x8bu)
+#define HOST_DATA_C BlockIOTag(0x8cu)
+#define HOST_DATA_D BlockIOTag(0x8du)
+#define HOST_DATA_E BlockIOTag(0x8eu)
+#define HOST_DATA_F BlockIOTag(0x8fu)
+#define HOST_CNTL BlockIOTag(0x90u)
+#define HOST_BYTE_ALIGN 0x00000001ul
+#define HOST_BIG_ENDIAN_EN 0x00000002ul /* GX-E/CT */
+/* ? 0xfffffffcul */
+#define BM_HOSTDATA BlockIOTag(0x91u) /* VTB/GTB */
+#define BM_ADDR BlockIOTag(0x92u) /* VTB/GTB */
+#define BM_DATA BlockIOTag(0x92u) /* VTB/GTB */
+#define BM_GUI_TABLE_CMD BlockIOTag(0x93u) /* GTPro */
+/* ? BlockIOTag(0x94u) */
+/* ? BlockIOTag(0x95u) */
+/* ? BlockIOTag(0x96u) */
+/* ? BlockIOTag(0x97u) */
+/* ? BlockIOTag(0x98u) */
+/* ? BlockIOTag(0x99u) */
+/* ? BlockIOTag(0x9au) */
+/* ? BlockIOTag(0x9bu) */
+/* ? BlockIOTag(0x9cu) */
+/* ? BlockIOTag(0x9du) */
+/* ? BlockIOTag(0x9eu) */
+/* ? BlockIOTag(0x9fu) */
+#define PAT_REG0 BlockIOTag(0xa0u)
+#define PAT_REG1 BlockIOTag(0xa1u)
+#define PAT_CNTL BlockIOTag(0xa2u)
+#define PAT_MONO_EN 0x00000001ul
+#define PAT_CLR_4x2_EN 0x00000002ul
+#define PAT_CLR_8x1_EN 0x00000004ul
+/* ? 0xfffffff8ul */
+/* ? BlockIOTag(0xa3u) */
+/* ? BlockIOTag(0xa4u) */
+/* ? BlockIOTag(0xa5u) */
+/* ? BlockIOTag(0xa6u) */
+/* ? BlockIOTag(0xa7u) */
+#define SC_LEFT BlockIOTag(0xa8u)
+#define SC_RIGHT BlockIOTag(0xa9u)
+#define SC_LEFT_RIGHT BlockIOTag(0xaau)
+#define SC_left 0x00003ffful
+/* ? 0x0000c000ul */
+#define SC_right 0x3fff0000ul
+/* ? 0xc0000000ul */
+#define SC_TOP BlockIOTag(0xabu)
+#define SC_BOTTOM BlockIOTag(0xacu)
+#define SC_TOP_BOTTOM BlockIOTag(0xadu)
+#define SC_top 0x00007ffful
+/* ? 0x00008000ul */
+#define SC_bottom 0x7fff0000ul
+/* ? 0x80000000ul */
+#define USR1_DST_OFF_PITCH BlockIOTag(0xaeu) /* LTPro */
+#define USR2_DST_OFF_PITCH BlockIOTag(0xafu) /* LTPro */
+#define DP_BKGD_CLR BlockIOTag(0xb0u)
+#define DP_FRGD_CLR BlockIOTag(0xb1u)
+#define DP_WRITE_MASK BlockIOTag(0xb2u)
+#define DP_CHAIN_MASK BlockIOTag(0xb3u)
+#define DP_CHAIN_1BPP 0x00000000ul /* Irrelevant */
+#define DP_CHAIN_4BPP 0x00008888ul
+#define DP_CHAIN_8BPP 0x00008080ul
+#define DP_CHAIN_8BPP_332 0x00009292ul
+#define DP_CHAIN_15BPP_1555 0x00004210ul
+#define DP_CHAIN_16BPP_565 0x00008410ul
+#define DP_CHAIN_24BPP_888 0x00008080ul
+#define DP_CHAIN_32BPP_8888 0x00008080ul
+/* ? 0xffff0000ul */
+#define DP_PIX_WIDTH BlockIOTag(0xb4u)
+#define DP_DST_PIX_WIDTH 0x0000000ful
+#define COMPOSITE_PIX_WIDTH 0x000000f0ul /* GTPro */
+#define DP_SRC_PIX_WIDTH 0x00000f00ul
+/* ? 0x00001000ul */
+#define DP_HOST_TRIPLE_EN 0x00002000ul /* GT2c/VT4 */
+#define DP_SRC_AUTONA_FIX_DIS 0x00004000ul /* GTB */
+#define DP_FAST_SRCCOPY_DIS 0x00008000ul /* GTB */
+#define DP_HOST_PIX_WIDTH 0x000f0000ul
+#define DP_CI4_RGB_INDEX 0x00f00000ul /* GTB */
+#define DP_BYTE_PIX_ORDER 0x01000000ul
+#define DP_CONVERSION_TEMP 0x02000000ul /* GTB */
+#define DP_CI4_RGB_LOW_NIBBLE 0x04000000ul /* GTB */
+#define DP_C14_RGB_HIGH_NIBBLE 0x08000000ul /* GTB */
+#define DP_SCALE_PIX_WIDTH 0xf0000000ul /* GTB */
+#define DP_MIX BlockIOTag(0xb5u)
+#define DP_BKGD_MIX 0x0000001ful
+/* ? 0x0000ffe0ul */
+#define DP_FRGD_MIX 0x001f0000ul
+/* ? 0xffe00000ul */
+#define DP_SRC BlockIOTag(0xb6u)
+#define DP_BKGD_SRC 0x00000007ul
+/* ? 0x000000feul */
+#define DP_FRGD_SRC 0x00000700ul
+/* ? 0x0000fe00ul */
+#define DP_MONO_SRC 0x00030000ul
+#define DP_MONO_SRC_ALLONES 0x00000000ul
+#define DP_MONO_SRC_PATTERN 0x00010000ul
+#define DP_MONO_SRC_HOST 0x00020000ul
+#define DP_MONO_SRC_BLIT 0x00030000ul
+/* ? 0xfffc0000ul */
+#define DP_FRGD_CLR_MIX BlockIOTag(0xb7u) /* VTB/GTB */
+#define DP_FRGD_BKGD_CLR BlockIOTag(0xb8u) /* VTB/GTB */
+/* ? BlockIOTag(0xb9u) */
+#define DST_X_Y BlockIOTag(0xbau) /* VTB/GTB */
+#define DST_WIDTH_HEIGHT BlockIOTag(0xbbu) /* VTB/GTB */
+#define USR_DST_PITCH BlockIOTag(0xbcu) /* GTPro */
+/* ? BlockIOTag(0xbdu) */
+#define DP_SET_GUI_ENGINE2 BlockIOTag(0xbeu) /* GTPro */
+#define DP_SET_GUI_ENGINE BlockIOTag(0xbfu) /* VTB/GTB */
+#define CLR_CMP_CLR BlockIOTag(0xc0u)
+#define CLR_CMP_MSK BlockIOTag(0xc1u)
+#define CLR_CMP_CNTL BlockIOTag(0xc2u)
+#define CLR_CMP_FN 0x00000007ul
+#define CLR_CMP_FN_FALSE 0x00000000ul
+#define CLR_CMP_FN_TRUE 0x00000001ul
+/* ? 0x00000002ul */
+/* ? 0x00000003ul */
+#define CLR_CMP_FN_EQUAL 0x00000004ul
+#define CLR_CMP_FN_NOT_EQUAL 0x00000005ul
+/* ? 0x00000006ul */
+/* ? 0x00000007ul */
+/* ? 0x00fffff8ul */
+#define CLR_CMP_SRC 0x03000000ul
+#define CLR_CMP_SRC_DST 0x00000000ul
+#define CLR_CMP_SRC_2D 0x01000000ul
+#define CLR_CMP_SRC_TEXEL 0x02000000ul
+/* ? 0x03000000ul */
+/* ? 0xfc000000ul */
+/* ? BlockIOTag(0xc3u) */
+#define FIFO_STAT BlockIOTag(0xc4u)
+#define FIFO_STAT_BITS 0x0000fffful
+/* ? 0x7fff0000ul */
+#define FIFO_ERR 0x80000000ul
+/* ? BlockIOTag(0xc5u) */
+/* ? BlockIOTag(0xc6u) */
+/* ? BlockIOTag(0xc7u) */
+#define CONTEXT_MASK BlockIOTag(0xc8u)
+/* ? BlockIOTag(0xc9u) */
+/* ? BlockIOTag(0xcau) */
+#define CONTEXT_LOAD_CNTL BlockIOTag(0xcbu)
+#define CONTEXT_LOAD_PTR 0x00007ffful
+/* ? 0x00008000ul */
+#define CONTEXT_LOAD_CMD 0x00030000ul
+#define CONTEXT_LOAD_NONE 0x00000000ul
+#define CONTEXT_LOAD_ONLY 0x00010000ul
+#define CONTEXT_LOAD_FILL 0x00020000ul
+#define CONTEXT_LOAD_LINE 0x00030000ul
+/* ? 0x7ffc0000ul */
+#define CONTEXT_LOAD_DIS 0x80000000ul
+#define GUI_TRAJ_CNTL BlockIOTag(0xccu)
+/* ? BlockIOTag(0xcdu) */
+#define GUI_STAT BlockIOTag(0xceu)
+#define GUI_ACTIVE 0x00000001ul
+/* ? 0x000000feul */
+#define DSTX_LT_SCISSOR_LEFT 0x00000100ul
+#define DSTX_GT_SCISSOR_RIGHT 0x00000200ul
+#define DSTY_LT_SCISSOR_TOP 0x00000400ul
+#define DSTY_GT_SCISSOR_BOTTOM 0x00000800ul
+/* ? 0x0000f000ul */
+#define GUI_FIFO 0x03ff0000ul /* VTB/GTB */
+/* ? 0xfc000000ul */
+/* ? BlockIOTag(0xcfu) */
+#define S_X_INC2 BlockIOTag(0xd0u) /* GTB */
+#define TEX_PALETTE_INDEX BlockIOTag(0xd0u) /* GTPro */
+#define S_Y_INC2 BlockIOTag(0xd1u) /* GTB */
+#define STW_EXP BlockIOTag(0xd1u) /* GTPro */
+#define S_XY_INC2 BlockIOTag(0xd2u) /* GTB */
+#define LOG_MAX_INC BlockIOTag(0xd2u) /* GTPro */
+#define S_XINC_START BlockIOTag(0xd3u) /* GTB */
+/* S_Y_INC BlockIOTag(0xd4u) */ /* Duplicate */
+/* SCALE_Y_PITCH BlockIOTag(0xd4u) */ /* Duplicate */
+#define S_START BlockIOTag(0xd5u) /* GTB */
+#define T_X_INC2 BlockIOTag(0xd6u) /* GTB */
+#define W_X_INC BlockIOTag(0xd6u) /* GTPro */
+#define T_Y_INC2 BlockIOTag(0xd7u) /* GTB */
+#define W_Y_INC BlockIOTag(0xd7u) /* GTPro */
+#define T_XY_INC2 BlockIOTag(0xd8u) /* GTB */
+#define W_START BlockIOTag(0xd8u) /* GTPro */
+#define T_XINC_START BlockIOTag(0xd9u) /* GTB */
+#define T_Y_INC BlockIOTag(0xdau) /* GTB */
+#define SECONDARY_SCALE_PITCH BlockIOTag(0xdau) /* GTPro */
+#define T_START BlockIOTag(0xdbu) /* GTB */
+#define TEX_SIZE_PITCH BlockIOTag(0xdcu) /* GTB */
+#define TEX_CNTL BlockIOTag(0xddu) /* GTPro */
+#define SECONDARY_TEX_OFFSET BlockIOTag(0xdeu) /* GTPro */
+#define TEX_PAL_WR BlockIOTag(0xdfu) /* GTB */
+#define TEX_PALETTE BlockIOTag(0xdfu) /* GTPro */
+#define SCALE_PITCH_BOTH BlockIOTag(0xe0u) /* GTPro */
+#define SECONDARY_SCALE_OFF_ACC BlockIOTag(0xe1u) /* GTPro */
+#define SCALE_OFF_ACC BlockIOTag(0xe2u) /* GTPro */
+#define SCALE_DST_Y_X BlockIOTag(0xe3u) /* GTPro */
+/* ? BlockIOTag(0xe4u) */
+/* ? BlockIOTag(0xe5u) */
+#define COMPOSITE_SHADOW_ID BlockIOTag(0xe6u) /* GTPro */
+#define SECONDARY_SCALE_X_INC BlockIOTag(0xe7u) /* GTPro */
+#define SPECULAR_RED_X_INC BlockIOTag(0xe7u) /* GTPro */
+#define SPECULAR_RED_Y_INC BlockIOTag(0xe8u) /* GTPro */
+#define SPECULAR_RED_START BlockIOTag(0xe9u) /* GTPro */
+#define SECONDARY_SCALE_HACC BlockIOTag(0xe9u) /* GTPro */
+#define SPECULAR_GREEN_X_INC BlockIOTag(0xeau) /* GTPro */
+#define SPECULAR_GREEN_Y_INC BlockIOTag(0xebu) /* GTPro */
+#define SPECULAR_GREEN_START BlockIOTag(0xecu) /* GTPro */
+#define SPECULAR_BLUE_X_INC BlockIOTag(0xedu) /* GTPro */
+#define SPECULAR_BLUE_Y_INC BlockIOTag(0xeeu) /* GTPro */
+#define SPECULAR_BLUE_START BlockIOTag(0xefu) /* GTPro */
+/* SCALE_X_INC BlockIOTag(0xf0u) */ /* Duplicate */
+/* RED_X_INC BlockIOTag(0xf0u) */ /* Duplicate */
+#define RED_Y_INC BlockIOTag(0xf1u) /* GTB */
+#define SCALE_HACC BlockIOTag(0xf2u) /* GTB */
+#define RED_START BlockIOTag(0xf2u) /* GTB */
+/* GREEN_X_INC BlockIOTag(0xf3u) */ /* Duplicate */
+/* SCALE_Y_INC BlockIOTag(0xf3u) */ /* Duplicate */
+#define GREEN_Y_INC BlockIOTag(0xf4u) /* GTB */
+#define SECONDARY_SCALE_Y_INC BlockIOTag(0xf4u) /* GTPro */
+#define SECONDARY_SCALE_VACC BlockIOTag(0xf5u) /* GTPro */
+#define GREEN_START BlockIOTag(0xf5u) /* GTB */
+#define BLUE_X_INC BlockIOTag(0xf6u) /* GTB */
+#define SCALE_XUV_INC BlockIOTag(0xf6u) /* GTB */
+#define BLUE_Y_INC BlockIOTag(0xf7u) /* GTB */
+#define BLUE_START BlockIOTag(0xf8u) /* GTB */
+#define SCALE_UV_HACC BlockIOTag(0xf8u) /* GTB */
+#define Z_X_INC BlockIOTag(0xf9u) /* GTB */
+#define Z_Y_INC BlockIOTag(0xfau) /* GTB */
+#define Z_START BlockIOTag(0xfbu) /* GTB */
+#define ALPHA_FOG_X_INC BlockIOTag(0xfcu) /* GTB */
+#define ALPHA_FOG_Y_INC BlockIOTag(0xfdu) /* GTB */
+#define ALPHA_FOG_START BlockIOTag(0xfeu) /* GTB */
+/* ? BlockIOTag(0xffu) */
+#define OVERLAY_Y_X_START BlockIOTag(0x100u)
+#define OVERLAY_Y_X_END BlockIOTag(0x101u)
+#define OVERLAY_VIDEO_KEY_CLR BlockIOTag(0x102u)
+#define OVERLAY_VIDEO_KEY_MSK BlockIOTag(0x103u)
+#define OVERLAY_GRAPHICS_KEY_CLR BlockIOTag(0x104u)
+#define OVERLAY_GRAPHICS_KEY_MSK BlockIOTag(0x105u)
+#define OVERLAY_KEY_CNTL BlockIOTag(0x106u)
+/* ? BlockIOTag(0x107u) */
+#define OVERLAY_SCALE_INC BlockIOTag(0x108u)
+#define OVERLAY_SCALE_CNTL BlockIOTag(0x109u)
+#define SCALER_HEIGHT_WIDTH BlockIOTag(0x10au)
+#define OVERLAY_TEST BlockIOTag(0x10bu)
+#define SCALER_THRESHOLD BlockIOTag(0x10cu)
+#define SCALER_BUF0_OFFSET BlockIOTag(0x10du) /* VTB/GTB */
+#define SCALER_BUF1_OFFSET BlockIOTag(0x10eu) /* VTB/GTB */
+#define SCALER_BUF_PITCH BlockIOTag(0x10fu) /* VTB/GTB */
+#define CAPTURE_Y_X BlockIOTag(0x110u)
+#define CAPTURE_START_END BlockIOTag(0x110u) /* VTB/GTB */
+#define CAPTURE_HEIGHT_WIDTH BlockIOTag(0x111u)
+#define CAPTURE_X_WIDTH BlockIOTag(0x111u) /* VTB/GTB */
+#define VIDEO_FORMAT BlockIOTag(0x112u)
+#define VIDEO_CONFIG BlockIOTag(0x113u)
+#define VBI_START_END BlockIOTag(0x113u) /* VTB/GTB */
+#define CAPTURE_CONFIG BlockIOTag(0x114u)
+#define TRIG_CNTL BlockIOTag(0x115u)
+#define VIDEO_SYNC_TEST BlockIOTag(0x116u)
+#define OVERLAY_EXCLUSIVE_HORZ BlockIOTag(0x116u) /* VTB/GTB */
+#define EXT_CRTC_GEN_CNTL_R BlockIOTag(0x117u) /* VT-A4 (R) */
+#define OVERLAY_EXCLUSIVE_VERT BlockIOTag(0x117u) /* VTB/GTB */
+#define VMC_CONFIG BlockIOTag(0x118u)
+#define VBI_WIDTH BlockIOTag(0x118u) /* VTB/GTB */
+#define VMC_STATUS BlockIOTag(0x119u)
+#define CAPTURE_DEBUG BlockIOTag(0x119u) /* VTB/GTB */
+#define VMC_CMD BlockIOTag(0x11au)
+#define VIDEO_SYNC_TEST_B BlockIOTag(0x11au) /* VTB/GTB */
+#define VMC_ARG0 BlockIOTag(0x11bu)
+#define VMC_ARG1 BlockIOTag(0x11cu)
+#define SNAPSHOT_VH_COUNTS BlockIOTag(0x11cu) /* GTPro */
+#define VMC_SNOOP_ARG0 BlockIOTag(0x11du)
+#define SNAPSHOT_F_COUNT BlockIOTag(0x11du) /* GTPro */
+#define VMC_SNOOP_ARG1 BlockIOTag(0x11eu)
+#define N_VIF_COUNT BlockIOTag(0x11eu) /* GTPro */
+#define SNAPSHOT_VIF_COUNT BlockIOTag(0x11fu) /* GTPro */
+#define BUF0_OFFSET BlockIOTag(0x120u)
+#define CAPTURE_BUF0_OFFSET BlockIOTag(0x120u) /* VTB/GTB */
+#define CAPTURE_BUF1_OFFSET BlockIOTag(0x121u) /* VTB/GTB */
+#define ONESHOT_BUF_OFFSET BlockIOTag(0x122u) /* VTB/GTB */
+#define BUF0_PITCH BlockIOTag(0x123u)
+/* ? BlockIOTag(0x124u) */
+/* ? BlockIOTag(0x125u) */
+#define BUF1_OFFSET BlockIOTag(0x126u)
+/* ? BlockIOTag(0x127u) */
+/* ? BlockIOTag(0x128u) */
+#define BUF1_PITCH BlockIOTag(0x129u)
+/* ? BlockIOTag(0x12au) */
+#define BUF0_CAP_ODD_OFFSET BlockIOTag(0x12bu)
+#define BUF1_CAP_ODD_OFFSET BlockIOTag(0x12cu)
+#define SNAPSHOT2_VH_COUNTS BlockIOTag(0x12cu) /* LTPro */
+#define SNAPSHOT2_F_COUNT BlockIOTag(0x12du) /* LTPro */
+#define N_VIF2_COUNT BlockIOTag(0x12eu) /* LTPro */
+#define SNAPSHOT2_VIF_COUNT BlockIOTag(0x12fu) /* LTPro */
+#define VMC_STRM_DATA_0 BlockIOTag(0x130u)
+/* MPP_CONFIG BlockIOTag(0x130u) */ /* See 0x3bu */
+#define VMC_STRM_DATA_1 BlockIOTag(0x131u)
+/* MPP_STROBE_SEQ BlockIOTag(0x131u) */ /* See 0x3cu */
+#define VMC_STRM_DATA_2 BlockIOTag(0x132u)
+/* MPP_ADDR BlockIOTag(0x132u) */ /* See 0x3du */
+#define VMC_STRM_DATA_3 BlockIOTag(0x133u)
+/* MPP_DATA BlockIOTag(0x133u) */ /* See 0x3eu */
+#define VMC_STRM_DATA_4 BlockIOTag(0x134u)
+#define VMC_STRM_DATA_5 BlockIOTag(0x135u)
+#define VMC_STRM_DATA_6 BlockIOTag(0x136u)
+#define VMC_STRM_DATA_7 BlockIOTag(0x137u)
+#define VMC_STRM_DATA_8 BlockIOTag(0x138u)
+#define VMC_STRM_DATA_9 BlockIOTag(0x139u)
+#define VMC_STRM_DATA_A BlockIOTag(0x13au)
+#define VMC_STRM_DATA_B BlockIOTag(0x13bu)
+#define VMC_STRM_DATA_C BlockIOTag(0x13cu)
+#define VMC_STRM_DATA_D BlockIOTag(0x13du)
+#define VMC_STRM_DATA_E BlockIOTag(0x13eu)
+#define VMC_STRM_DATA_F BlockIOTag(0x13fu)
+/* TVO_CNTL BlockIOTag(0x140u) */ /* See 0x3fu */
+/* ? BlockIOTag(0x141u) */
+/* ? BlockIOTag(0x142u) */
+/* ? BlockIOTag(0x143u) */
+/* ? BlockIOTag(0x144u) */
+/* ? BlockIOTag(0x145u) */
+/* ? BlockIOTag(0x146u) */
+/* ? BlockIOTag(0x147u) */
+/* ? BlockIOTag(0x148u) */
+/* ? BlockIOTag(0x149u) */
+/* ? BlockIOTag(0x14au) */
+/* ? BlockIOTag(0x14bu) */
+/* ? BlockIOTag(0x14cu) */
+/* ? BlockIOTag(0x14du) */
+/* ? BlockIOTag(0x14eu) */
+/* ? BlockIOTag(0x14fu) */
+/* ? BlockIOTag(0x150u) */
+#define CRT_HORZ_VERT_LOAD BlockIOTag(0x151u) /* VTB/GTB */
+#define AGP_BASE BlockIOTag(0x152u) /* GTPro */
+#define AGP_CNTL BlockIOTag(0x153u) /* GTPro */
+#define SCALER_COLOUR_CNTL BlockIOTag(0x154u) /* GTPro */
+#define SCALER_H_COEFF0 BlockIOTag(0x155u) /* GTPro */
+#define SCALER_H_COEFF1 BlockIOTag(0x156u) /* GTPro */
+#define SCALER_H_COEFF2 BlockIOTag(0x157u) /* GTPro */
+#define SCALER_H_COEFF3 BlockIOTag(0x158u) /* GTPro */
+#define SCALER_H_COEFF4 BlockIOTag(0x159u) /* GTPro */
+/* ? BlockIOTag(0x15au) */
+/* ? BlockIOTag(0x15bu) */
+#define GUI_CMDFIFO_DEBUG BlockIOTag(0x15cu) /* GT2c/VT4 */
+#define GUI_CMDFIFO_DATA BlockIOTag(0x15du) /* GT2c/VT4 */
+#define GUI_CNTL BlockIOTag(0x15eu) /* GT2c/VT4 */
+#define CMDFIFO_SIZE_MODE 0x00000003ul
+/* ? 0x0000fffcul */
+#define IDCT_PRSR_MODE 0x00010000ul /* XL/XC */
+#define IDCT_BLOCK_GUI_INITIATOR 0x00020000ul /* XL/XC */
+/* ? 0xfffc0000ul */
+/* ? BlockIOTag(0x15fu) */
+#define BM_FRAME_BUF_OFFSET BlockIOTag(0x160u) /* VTB/GTB */
+#define BM_SYSTEM_MEM_ADDR BlockIOTag(0x161u) /* VTB/GTB */
+#define BM_COMMAND BlockIOTag(0x162u) /* VTB/GTB */
+#define BM_STATUS BlockIOTag(0x163u) /* VTB/GTB */
+/* ? BlockIOTag(0x164u) */
+/* ? BlockIOTag(0x165u) */
+/* ? BlockIOTag(0x166u) */
+/* ? BlockIOTag(0x167u) */
+/* ? BlockIOTag(0x168u) */
+/* ? BlockIOTag(0x169u) */
+/* ? BlockIOTag(0x16au) */
+/* ? BlockIOTag(0x16bu) */
+/* ? BlockIOTag(0x16cu) */
+/* ? BlockIOTag(0x16du) */
+#define BM_GUI_TABLE BlockIOTag(0x16eu) /* VTB/GTB */
+#define BM_SYSTEM_TABLE BlockIOTag(0x16fu) /* VTB/GTB */
+/* ? BlockIOTag(0x170u) */
+/* ? BlockIOTag(0x171u) */
+/* ? BlockIOTag(0x172u) */
+/* ? BlockIOTag(0x173u) */
+/* ? BlockIOTag(0x174u) */
+#define SCALER_BUF0_OFFSET_U BlockIOTag(0x175u) /* GTPro */
+#define SCALER_BUF0_OFFSET_V BlockIOTag(0x176u) /* GTPro */
+#define SCALER_BUF1_OFFSET_U BlockIOTag(0x177u) /* GTPro */
+#define SCALER_BUF1_OFFSET_V BlockIOTag(0x178u) /* GTPro */
+/* ? BlockIOTag(0x179u) */
+/* ? BlockIOTag(0x17au) */
+/* ? BlockIOTag(0x17bu) */
+/* ? BlockIOTag(0x17cu) */
+/* ? BlockIOTag(0x17du) */
+/* ? BlockIOTag(0x17eu) */
+/* ? BlockIOTag(0x17fu) */
+/* ? BlockIOTag(0x180u) */
+/* ? BlockIOTag(0x181u) */
+/* ? BlockIOTag(0x182u) */
+/* ? BlockIOTag(0x183u) */
+/* ? BlockIOTag(0x184u) */
+/* ? BlockIOTag(0x185u) */
+/* ? BlockIOTag(0x186u) */
+/* ? BlockIOTag(0x187u) */
+/* ? BlockIOTag(0x188u) */
+/* ? BlockIOTag(0x189u) */
+/* ? BlockIOTag(0x18au) */
+/* ? BlockIOTag(0x18bu) */
+/* ? BlockIOTag(0x18cu) */
+/* ? BlockIOTag(0x18du) */
+/* ? BlockIOTag(0x18eu) */
+/* ? BlockIOTag(0x18fu) */
+#define VERTEX_1_S BlockIOTag(0x190u) /* GTPro */
+#define VERTEX_1_T BlockIOTag(0x191u) /* GTPro */
+#define VERTEX_1_W BlockIOTag(0x192u) /* GTPro */
+#define VERTEX_1_SPEC_ARGB BlockIOTag(0x193u) /* GTPro */
+#define VERTEX_1_Z BlockIOTag(0x194u) /* GTPro */
+#define VERTEX_1_ARGB BlockIOTag(0x195u) /* GTPro */
+#define VERTEX_1_X_Y BlockIOTag(0x196u) /* GTPro */
+#define ONE_OVER_AREA BlockIOTag(0x197u) /* GTPro */
+#define VERTEX_2_S BlockIOTag(0x198u) /* GTPro */
+#define VERTEX_2_T BlockIOTag(0x199u) /* GTPro */
+#define VERTEX_2_W BlockIOTag(0x19au) /* GTPro */
+#define VERTEX_2_SPEC_ARGB BlockIOTag(0x19bu) /* GTPro */
+#define VERTEX_2_Z BlockIOTag(0x19cu) /* GTPro */
+#define VERTEX_2_ARGB BlockIOTag(0x19du) /* GTPro */
+#define VERTEX_2_X_Y BlockIOTag(0x19eu) /* GTPro */
+/* ONE_OVER_AREA BlockIOTag(0x19fu) */ /* Duplicate */
+#define VERTEX_3_S BlockIOTag(0x1a0u) /* GTPro */
+#define VERTEX_3_T BlockIOTag(0x1a1u) /* GTPro */
+#define VERTEX_3_W BlockIOTag(0x1a2u) /* GTPro */
+#define VERTEX_3_SPEC_ARGB BlockIOTag(0x1a3u) /* GTPro */
+#define VERTEX_3_Z BlockIOTag(0x1a4u) /* GTPro */
+#define VERTEX_3_ARGB BlockIOTag(0x1a5u) /* GTPro */
+#define VERTEX_3_X_Y BlockIOTag(0x1a6u) /* GTPro */
+/* ONE_OVER_AREA BlockIOTag(0x1a7u) */ /* Duplicate */
+#define VERTEX_3_SECONDARY_S BlockIOTag(0x1a8u) /* GTPro */
+#define VERTEX_3_SECONDARY_T BlockIOTag(0x1a9u) /* GTPro */
+#define VERTEX_3_SECONDARY_W BlockIOTag(0x1aau) /* GTPro */
+/* VERTEX_1_S BlockIOTag(0x1abu) */ /* Duplicate */
+/* VERTEX_1_T BlockIOTag(0x1acu) */ /* Duplicate */
+/* VERTEX_1_W BlockIOTag(0x1adu) */ /* Duplicate */
+/* VERTEX_2_S BlockIOTag(0x1aeu) */ /* Duplicate */
+/* VERTEX_2_T BlockIOTag(0x1afu) */ /* Duplicate */
+/* VERTEX_2_W BlockIOTag(0x1b0u) */ /* Duplicate */
+/* VERTEX_3_S BlockIOTag(0x1b1u) */ /* Duplicate */
+/* VERTEX_3_T BlockIOTag(0x1b2u) */ /* Duplicate */
+/* VERTEX_3_W BlockIOTag(0x1b3u) */ /* Duplicate */
+/* VERTEX_1_SPEC_ARGB BlockIOTag(0x1b4u) */ /* Duplicate */
+/* VERTEX_2_SPEC_ARGB BlockIOTag(0x1b5u) */ /* Duplicate */
+/* VERTEX_3_SPEC_ARGB BlockIOTag(0x1b6u) */ /* Duplicate */
+/* VERTEX_1_Z BlockIOTag(0x1b7u) */ /* Duplicate */
+/* VERTEX_2_Z BlockIOTag(0x1b8u) */ /* Duplicate */
+/* VERTEX_3_Z BlockIOTag(0x1b9u) */ /* Duplicate */
+/* VERTEX_1_ARGB BlockIOTag(0x1bau) */ /* Duplicate */
+/* VERTEX_2_ARGB BlockIOTag(0x1bbu) */ /* Duplicate */
+/* VERTEX_3_ARGB BlockIOTag(0x1bcu) */ /* Duplicate */
+/* VERTEX_1_X_Y BlockIOTag(0x1bdu) */ /* Duplicate */
+/* VERTEX_2_X_Y BlockIOTag(0x1beu) */ /* Duplicate */
+/* VERTEX_3_X_Y BlockIOTag(0x1bfu) */ /* Duplicate */
+#define ONE_OVER_AREA_UC BlockIOTag(0x1c0u) /* GTPro */
+#define SETUP_CNTL BlockIOTag(0x1c1u) /* GTPro */
+/* ? BlockIOTag(0x1c2u) */
+/* ? BlockIOTag(0x1c3u) */
+/* ? BlockIOTag(0x1c4u) */
+/* ? BlockIOTag(0x1c5u) */
+/* ? BlockIOTag(0x1c6u) */
+/* ? BlockIOTag(0x1c7u) */
+/* ? BlockIOTag(0x1c8u) */
+/* ? BlockIOTag(0x1c9u) */
+#define VERTEX_1_SECONDARY_S BlockIOTag(0x1cau) /* GTPro */
+#define VERTEX_1_SECONDARY_T BlockIOTag(0x1cbu) /* GTPro */
+#define VERTEX_1_SECONDARY_W BlockIOTag(0x1ccu) /* GTPro */
+#define VERTEX_2_SECONDARY_S BlockIOTag(0x1cdu) /* GTPro */
+#define VERTEX_2_SECONDARY_T BlockIOTag(0x1ceu) /* GTPro */
+#define VERTEX_2_SECONDARY_W BlockIOTag(0x1cfu) /* GTPro */
+/* ? BlockIOTag(0x1d0u) */
+/* ? BlockIOTag(0x1d1u) */
+/* ? BlockIOTag(0x1d2u) */
+/* ? BlockIOTag(0x1d3u) */
+/* ? BlockIOTag(0x1d4u) */
+/* ? BlockIOTag(0x1d5u) */
+/* ? BlockIOTag(0x1d6u) */
+/* ? BlockIOTag(0x1d7u) */
+/* ? BlockIOTag(0x1d8u) */
+/* ? BlockIOTag(0x1d9u) */
+/* ? BlockIOTag(0x1dau) */
+/* ? BlockIOTag(0x1dbu) */
+/* ? BlockIOTag(0x1dcu) */
+/* ? BlockIOTag(0x1ddu) */
+/* ? BlockIOTag(0x1deu) */
+/* ? BlockIOTag(0x1dfu) */
+/* ? BlockIOTag(0x1e0u) */
+/* ? BlockIOTag(0x1e1u) */
+/* ? BlockIOTag(0x1e2u) */
+/* ? BlockIOTag(0x1e3u) */
+/* ? BlockIOTag(0x1e4u) */
+/* ? BlockIOTag(0x1e5u) */
+/* ? BlockIOTag(0x1e6u) */
+/* ? BlockIOTag(0x1e7u) */
+/* ? BlockIOTag(0x1e8u) */
+/* ? BlockIOTag(0x1e9u) */
+/* ? BlockIOTag(0x1eau) */
+/* ? BlockIOTag(0x1ebu) */
+/* ? BlockIOTag(0x1ecu) */
+/* ? BlockIOTag(0x1edu) */
+/* ? BlockIOTag(0x1eeu) */
+/* ? BlockIOTag(0x1efu) */
+/* ? BlockIOTag(0x1f0u) */
+/* ? BlockIOTag(0x1f1u) */
+/* ? BlockIOTag(0x1f2u) */
+/* ? BlockIOTag(0x1f3u) */
+/* ? BlockIOTag(0x1f4u) */
+/* ? BlockIOTag(0x1f5u) */
+/* ? BlockIOTag(0x1f6u) */
+/* ? BlockIOTag(0x1f7u) */
+/* ? BlockIOTag(0x1f8u) */
+/* ? BlockIOTag(0x1f9u) */
+/* ? BlockIOTag(0x1fau) */
+/* ? BlockIOTag(0x1fbu) */
+/* ? BlockIOTag(0x1fcu) */
+/* ? BlockIOTag(0x1fdu) */
+/* ? BlockIOTag(0x1feu) */
+/* ? BlockIOTag(0x1ffu) */
/* Definitions for an ICS2595's programme word */
#define ICS2595_CLOCK 0x000001f0ul
@@ -1218,7 +1911,7 @@
#define PLL_REF_DIV 0x02u
#define PLL_GEN_CNTL 0x03u
#define PLL_OVERRIDE 0x01u
-#define PLL_SLEEP 0x01u /* GT3/LTPro */
+#define PLL_SLEEP 0x01u /* GTPro */
#define PLL_MCLK_RESET 0x02u
#define PLL_OSC_EN 0x04u
#define PLL_EXT_CLK_EN 0x08u
@@ -1283,25 +1976,25 @@
#define PLL_LPLL_DUTY 0x06u
#define PLL_LPLL_VC_GAIN 0x18u
#define PLL_LPLL_CP_GAIN 0xe0u
-#define PLL_AGP1_CNTL 0x12u /* GT3/LTPro */
-#define PLL_AGP2_CNTL 0x13u /* GT3/LTPro */
-#define PLL_DLL2_CNTL 0x14u /* GT3/LTPro */
-#define PLL_SCLK_FB_DIV 0x15u /* GT3/LTPro */
-#define PLL_SPLL_CNTL1 0x16u /* GT3/LTPro */
-#define PLL_SPLL_CNTL2 0x17u /* GT3/LTPro */
-#define PLL_APLL_STRAPS 0x18u /* GT3/LTPro */
-#define PLL_EXT_VPLL_CNTL 0x19u /* GT3/LTPro */
+#define PLL_AGP1_CNTL 0x12u /* GTPro */
+#define PLL_AGP2_CNTL 0x13u /* GTPro */
+#define PLL_DLL2_CNTL 0x14u /* GTPro */
+#define PLL_SCLK_FB_DIV 0x15u /* GTPro */
+#define PLL_SPLL_CNTL1 0x16u /* GTPro */
+#define PLL_SPLL_CNTL2 0x17u /* GTPro */
+#define PLL_APLL_STRAPS 0x18u /* GTPro */
+#define PLL_EXT_VPLL_CNTL 0x19u /* GTPro */
#define PLL_EXT_VPLL_REF_SRC 0x03u
#define PLL_EXT_VPLL_EN 0x04u
#define PLL_EXT_VPLL_VGA_EN 0x08u
#define PLL_EXT_VPLL_INSYNC 0x10u
/* ? 0x60u */
#define PLL_EXT_V2PLL_EN 0x80u
-#define PLL_EXT_VPLL_REF_DIV 0x1au /* GT3/LTPro */
-#define PLL_EXT_VPLL_FB_DIV 0x1bu /* GT3/LTPro */
-#define PLL_EXT_VPLL_MSB 0x1cu /* GT3/LTPro */
-#define PLL_HTOTAL_CNTL 0x1du /* GT3/LTPro */
-#define PLL_BYTE_CLK_CNTL 0x1eu /* GT3/LTPro */
+#define PLL_EXT_VPLL_REF_DIV 0x1au /* GTPro */
+#define PLL_EXT_VPLL_FB_DIV 0x1bu /* GTPro */
+#define PLL_EXT_VPLL_MSB 0x1cu /* GTPro */
+#define PLL_HTOTAL_CNTL 0x1du /* GTPro */
+#define PLL_BYTE_CLK_CNTL 0x1eu /* GTPro */
#define PLL_TV_REF_DIV 0x1fu /* LTPro */
#define PLL_TV_FB_DIV 0x20u /* LTPro */
#define PLL_TV_CNTL 0x21u /* LTPro */
@@ -1711,6 +2404,26 @@
/* Current X, Y & Dest X, Y mask */
#define COORD_MASK 0x07ffu
+/* Pixel widths */
+#define PIX_WIDTH_1BPP 0x00u
+#define PIX_WIDTH_4BPP 0x01u /* CRTC2: 8bpp */
+#define PIX_WIDTH_8BPP 0x02u /* CRTC2: Undefined */
+#define PIX_WIDTH_15BPP 0x03u
+#define PIX_WIDTH_16BPP 0x04u
+#define PIX_WIDTH_24BPP 0x05u
+#define PIX_WIDTH_32BPP 0x06u
+#define PIX_WIDTH_YUV422 0x07u /* CRTC2 only */
+
+/* Source definitions */
+#define SRC_BKGD 0x00u
+#define SRC_FRGD 0x01u
+#define SRC_HOST 0x02u
+#define SRC_BLIT 0x03u
+#define SRC_PATTERN 0x04u
+#define SRC_SCALER_3D 0x05u
+/* ? 0x06u */
+/* ? 0x07u */
+
/* The Mixes */
#define MIX_MASK 0x001fu
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c
index 47c77ecaf..d6c45130b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.5 1999/11/02 16:16:39 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.6 2000/02/18 12:19:37 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,6 +22,7 @@
*/
#include "ati.h"
+#include "atiadapter.h"
#include "aticonsole.h"
#include "atidac.h"
#include "atiscreen.h"
@@ -84,7 +85,7 @@ ATIRefreshArea
/*
* ATIScreenInit --
*
- * This function is called by DIX to initialize the screen.
+ * This function is called by DIX to initialise the screen.
*/
Bool
ATIScreenInit
@@ -104,7 +105,7 @@ ATIScreenInit
if (!ATIEnterGraphics(pScreen, pScreenInfo, pATI))
return FALSE;
- /* Re-initialize mi's visual list */
+ /* Re-initialise mi's visual list */
miClearVisualTypes();
if ((pScreenInfo->depth > 8) && (pATI->DAC == ATI_DAC_INTERNAL))
@@ -132,7 +133,7 @@ ATIScreenInit
}
}
- /* Initialize framebuffer layer */
+ /* Initialise framebuffer layer */
switch (pScreenInfo->bitsPerPixel)
{
case 1:
@@ -206,17 +207,21 @@ ATIScreenInit
xf86SetBlackWhitePixels(pScreen);
- /* Initialize banking if needed */
+ /* Initialise banking if needed */
if (!miInitializeBanking(pScreen,
pScreenInfo->virtualX, pScreenInfo->virtualY,
pScreenInfo->displayWidth, &pATI->BankInfo))
return FALSE;
- /* Initialize backing store */
+ /* Setup acceleration */
+ if (!ATIAdapterAccelInit(pScreenInfo, pScreen, pATI))
+ return FALSE;
+
+ /* Initialise backing store */
miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
- /* Initialize software cursor */
+ /* Initialise software cursor */
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
/* Create default colourmap */
@@ -230,7 +235,7 @@ ATIScreenInit
CMAP_LOAD_EVEN_IF_OFFSCREEN))
return FALSE;
- /* Initialize shadow framebuffer */
+ /* Initialise shadow framebuffer */
if (pATI->OptionShadowFB &&
!ShadowFBInit(pScreen, ATIRefreshArea))
return FALSE;
@@ -262,6 +267,12 @@ ATICloseScreen
ATIPtr pATI = ATIPTR(pScreenInfo);
Bool Closed = TRUE;
+ if (pATI->pXAAInfo)
+ {
+ XAADestroyInfoRec(pATI->pXAAInfo);
+ pATI->pXAAInfo = NULL;
+ }
+
if ((pScreen->CloseScreen = pATI->CloseScreen))
{
pATI->CloseScreen = NULL;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h
index 0b8d4364b..f2c1883d8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h,v 1.1 1999/07/06 11:38:37 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h,v 1.2 2000/02/18 12:19:40 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h
index 880e02ec2..5aeb80cb9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h,v 1.10 1999/11/18 16:52:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h,v 1.11 2000/02/18 12:19:40 tsi Exp $ */
/*
- * Copyright 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -26,6 +26,7 @@
#include "atibank.h"
#include "aticlock.h"
+#include "xaa.h"
/*
* This is probably as good a place as any to put this note, as it applies to
@@ -59,7 +60,7 @@ typedef struct _ATIHWRec
/* Mach64 PLL registers */
CARD8 pll_vclk_cntl, pll_ext_vpll_cntl;
- /* Mach64 registers */
+ /* Mach64 CPIO registers */
CARD32 crtc_h_total_disp, crtc_h_sync_strt_wid,
crtc_v_total_disp, crtc_v_sync_strt_wid,
crtc_off_pitch, crtc_gen_cntl, dsp_config, dsp_on_off,
@@ -78,6 +79,25 @@ typedef struct _ATIHWRec
CARD32 shadow_h_total_disp, shadow_h_sync_strt_wid,
shadow_v_total_disp, shadow_v_sync_strt_wid;
+ /* Mach64 MMIO Block 0 registers */
+ CARD32 dst_off_pitch;
+ CARD16 dst_x, dst_y, dst_height;
+ CARD32 dst_bres_err, dst_bres_inc, dst_bres_dec, dst_cntl;
+ CARD32 src_off_pitch;
+ CARD16 src_x, src_y, src_width1, src_height1,
+ src_x_start, src_y_start, src_width2, src_height2;
+ CARD32 src_cntl;
+ CARD32 host_cntl;
+ CARD32 pat_reg0, pat_reg1, pat_cntl;
+ CARD16 sc_left, sc_right, sc_top, sc_bottom;
+ CARD32 dp_bkgd_clr, dp_frgd_clr, dp_write_mask, dp_chain_mask,
+ dp_pix_width, dp_mix, dp_src;
+ CARD32 clr_cmp_clr, clr_cmp_msk, clr_cmp_cntl;
+ CARD32 context_mask, context_load_cntl;
+
+ /* Mach64 MMIO Block 1 registers */
+ CARD32 gui_cntl;
+
/* Clock map pointers */
const CARD8 *ClockMap, *ClockUnmap;
@@ -136,7 +156,7 @@ typedef struct _ATIRec
*/
CARD16 CPIO_CRTC_H_TOTAL_DISP, CPIO_CRTC_H_SYNC_STRT_WID,
CPIO_CRTC_V_TOTAL_DISP, CPIO_CRTC_V_SYNC_STRT_WID,
- CPIO_CRTC_OFF_PITCH,CPIO_CRTC_INT_CNTL, CPIO_CRTC_GEN_CNTL,
+ CPIO_CRTC_OFF_PITCH, CPIO_CRTC_INT_CNTL, CPIO_CRTC_GEN_CNTL,
CPIO_DSP_CONFIG, CPIO_DSP_ON_OFF, CPIO_OVR_CLR,
CPIO_OVR_WID_LEFT_RIGHT, CPIO_OVR_WID_TOP_BOTTOM,
CPIO_TV_OUT_INDEX, CPIO_CLOCK_CNTL, CPIO_TV_OUT_DATA,
@@ -191,6 +211,13 @@ typedef struct _ATIRec
miBankInfoRec BankInfo;
/*
+ * XAA interface.
+ */
+ XAAInfoRecPtr pXAAInfo;
+ int nAvailableFIFOEntries, nFIFOEntries;
+ CARD8 EngineIsBusy, EngineIsLocked, PitchModifier;
+
+ /*
* Clock-related definitions.
*/
int ClockNumberToProgramme, ReferenceNumerator, ReferenceDenominator;
@@ -227,6 +254,9 @@ typedef struct _ATIRec
/* VGA registers */
CARD8 crt03, crt11;
+ /* VGA shadow registers */
+ CARD8 shadow_crt03, shadow_crt11;
+
/* VGA Wonder registers */
CARD8 a6, ab, b1, b4, b5, b6, b8, b9, be;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c
index ed6f284b2..3856bc813 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c,v 1.3 1999/07/06 11:38:38 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c,v 1.4 2000/02/18 12:19:41 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h
index 37b8a76c1..4d75760c7 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h,v 1.3 1999/07/06 11:38:38 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h,v 1.4 2000/02/18 12:19:41 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -44,10 +44,13 @@
}
/*
- * Macros to get/set a contiguous bit field. '_Mask' should not be
+ * Macros to get/set a contiguous bit field. Arguments should not be
* self-modifying.
*/
-#define UnitOf(___Value) ((((___Value) ^ ((___Value) - 1)) + 1) >> 1)
+#define UnitOf(___Value) \
+ (((((___Value) ^ ((___Value) - 1)) + 1) >> 1) | \
+ ((((___Value) ^ ((___Value) - 1)) >> 1) + 1))
+
#define GetBits(__Value, _Mask) (((__Value) & (_Mask)) / UnitOf(_Mask))
#define SetBits(__Value, _Mask) (((__Value) * UnitOf(_Mask)) & (_Mask))
@@ -57,6 +60,10 @@
#define GetByte(_Value, _Byte) GetBits(_Value, _ByteMask(_Byte))
#define SetByte(_Value, _Byte) SetBits(_Value, _ByteMask(_Byte))
+#define _WordMask(__Word) ((CARD16)(-1) << (16 * (__Word)))
+#define GetWord(_Value, _Word) GetBits(_Value, _WordMask(_Word))
+#define SetWord(_Value, _Word) SetBits(_Value, _WordMask(_Word))
+
extern int ATIDivide FunctionPrototype((int, int, int, const int));
#endif /* ___ATIUTIL_H___ */
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c
index 9c192481b..b897e90f8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c,v 1.8 1999/11/18 16:52:12 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c,v 1.9 2000/02/18 12:19:42 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h
index 9e2e035c3..09881d94e 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h,v 1.3 1999/07/06 11:38:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h,v 1.4 2000/02/18 12:19:42 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h
index 68ee39e42..65a55f442 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.10 1999/10/26 15:58:17 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.11 2000/02/18 12:19:43 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -27,11 +27,11 @@
#define ATI_NAME "ATI"
#define ATI_DRIVER_NAME "ati"
-#define ATI_VERSION_NAME "5.2.1"
+#define ATI_VERSION_NAME "5.3.0"
#define ATI_VERSION_MAJOR 5
-#define ATI_VERSION_MINOR 2
-#define ATI_VERSION_PATCH 1
+#define ATI_VERSION_MINOR 3
+#define ATI_VERSION_PATCH 0
#define ATI_VERSION_CURRENT ((ATI_VERSION_MAJOR << 16) | ATI_VERSION_MINOR)
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c
index 51a540d1b..c1cd6ab8a 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c,v 1.8 1999/11/02 16:16:40 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c,v 1.9 2000/02/18 12:19:43 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -44,7 +44,7 @@ ATIVGAPreInit
{
int Index;
- /* Initialize sequencer register values */
+ /* Initialise sequencer register values */
pATIHW->seq[0] = 0x03U;
if (pScreenInfo->depth == 1)
pATIHW->seq[2] = 0x01U << BIT_PLANE;
@@ -57,7 +57,7 @@ ATIVGAPreInit
else
pATIHW->seq[4] = 0x0AU;
- /* Initialize CRTC register values */
+ /* Initialise CRTC register values */
if ((pScreenInfo->depth >= 8) &&
((pATI->Chip >= ATI_CHIP_264CT) ||
(pATI->CPIO_VGAWonder &&
@@ -72,7 +72,7 @@ ATIVGAPreInit
pATIHW->crt[23] = 0xE3U;
pATIHW->crt[24] = 0xFFU;
- /* Initialize attribute controller register values */
+ /* Initialise attribute controller register values */
if (pScreenInfo->depth == 1)
{
Bool FlipPixels = xf86GetFlipPixels();
@@ -99,7 +99,7 @@ ATIVGAPreInit
}
pATIHW->attr[18] = 0x0FU;
- /* Initialize graphics controller register values */
+ /* Initialise graphics controller register values */
if (pScreenInfo->depth == 1)
pATIHW->gra[4] = BIT_PLANE;
else if (pScreenInfo->depth <= 4)
@@ -107,7 +107,7 @@ ATIVGAPreInit
else if (pATI->Chip >= ATI_CHIP_264CT)
pATIHW->gra[5] = 0x40U;
if (pATI->UseSmallApertures && (pATI->Chip >= ATI_CHIP_264CT) &&
- ((pATI->Chip >= ATI_CHIP_264VT) || pATI->Block0Base))
+ ((pATI->Chip >= ATI_CHIP_264VT) || !pATI->LinearBase))
pATIHW->gra[6] = 0x01U; /* 128kB aperture */
else
pATIHW->gra[6] = 0x05U; /* 64kB aperture */
@@ -423,9 +423,24 @@ void
ATIVGASaveScreen
(
ATIPtr pATI,
- int On
+ int Mode
)
{
(void)inb(GENS1(pATI->CPIO_VGABase)); /* Reset flip-flop */
- outb(ATTRX, On ? 0x20U : 0x00U); /* Turn PAS on or off */
+
+ switch (Mode)
+ {
+ case SCREEN_SAVER_OFF:
+ case SCREEN_SAVER_FORCER:
+ outb(ATTRX, 0x20U); /* Turn PAS on */
+ break;
+
+ case SCREEN_SAVER_ON:
+ case SCREEN_SAVER_CYCLE:
+ outb(ATTRX, 0x00U); /* Turn PAS off */
+ break;
+
+ default:
+ break;
+ }
}
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h
index 23eeefe71..24edc4ec3 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h,v 1.3 1999/07/06 11:38:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h,v 1.4 2000/02/18 12:19:44 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c
index c2b64045c..45e6a1bd9 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c,v 1.7 1999/11/18 16:52:13 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c,v 1.8 2000/02/18 12:19:44 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h
index 77bfc4cba..3aa90311b 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h,v 1.4 1999/09/27 06:29:44 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h,v 1.5 2000/02/18 12:19:45 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c
index e4c11c70d..899916988 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c,v 1.6 1999/10/13 04:21:11 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c,v 1.7 2000/02/18 12:19:45 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -24,7 +24,7 @@
/*
* The ATI x8800 chips use special registers for their extended VGA features.
* These registers are accessible through an index I/O port and a data I/O
- * port. BIOS initialization stores the index port number in the Graphics
+ * port. BIOS initialisation stores the index port number in the Graphics
* register bank (0x03CE), indices 0x50 and 0x51. Unfortunately, for all but
* the 18800-x series of adapters, these registers are write-only (a.k.a. black
* holes). On all but 88800's, the index port number can be found in the short
@@ -57,7 +57,7 @@
/*
* ATIVGAWonderPreInit --
*
- * This function is called to initialize the VGA Wonder part of an ATIHWRec
+ * This function is called to initialise the VGA Wonder part of an ATIHWRec
* that is common to all modes generated by the driver.
*/
void
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h
index 382c62dc6..ede3cdc43 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h,v 1.3 1999/07/06 11:38:40 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h,v 1.4 2000/02/18 12:19:46 tsi Exp $ */
/*
- * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
+ * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that