merge trunk in 64bit branch.

This commit is contained in:
alanh
2000-11-16 19:02:15 +00:00
parent 68adba47ab
commit 65e9e693f1
14 changed files with 567 additions and 388 deletions

View File

@@ -1,36 +1,43 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONL
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGH
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DF
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT T
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS I
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FA
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS O
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE
**
** $Header: dos_mode.c, 6, 5/9/2000 12:51:00 PM, Kenneth Dyke
** $Log:
** 6 3dfx 1.4.1.0 05/09/00 Kenneth Dyke Improved startup code fo
** Glide. Fixes cold startup problem
** 5 3dfx 1.4 04/25/00 Kenneth Dyke Brough SLI/AA code for DO
** a little more up to date
** 4 3dfx 1.3 03/28/00 Kenneth Dyke Fixed missing parameter t
** setVideoMode. C r0x
** 3 3dfx 1.2 03/28/00 Kenneth Dyke Refinements to memor
** layout for DOS glide setup
** 2 3dfx 1.1 03/27/00 Kenneth Dyke DOS Glide support fo
** two-chip (and maybe four-chip) Napalm boards
** 1 3dfx 1.0 09/11/99 StarTeam VTS Administrator
**
** $Header$
** $Log:
** 9 3dfx 1.4.1.2.1.0 10/11/00 Brent Forced check in to enforce
** branching.
** 8 3dfx 1.4.1.2 06/21/00 Joseph Kain Fixed errors introduced by
** my previous merge.
** 7 3dfx 1.4.1.1 06/20/00 Joseph Kain Changes to support the
** Napalm Glide open source release. Changes include cleaned up offensive
** comments and new legal headers.
** 6 3dfx 1.4.1.0 05/09/00 Kenneth Dyke Improved startup code for
** Glide. Fixes cold startup problem.
** 5 3dfx 1.4 04/25/00 Kenneth Dyke Brough SLI/AA code for DOS
** a little more up to date.
** 4 3dfx 1.3 03/28/00 Kenneth Dyke Fixed missing parameter to
** setVideoMode. C r0x.
** 3 3dfx 1.2 03/28/00 Kenneth Dyke Refinements to memory
** layout for DOS glide setup.
** 2 3dfx 1.1 03/27/00 Kenneth Dyke DOS Glide support for
** two-chip (and maybe four-chip) Napalm boards.
** 1 3dfx 1.0 09/11/99 StarTeam VTS Administrator
** $
**
** 4 10/08/98 10:14a Dow
** Fixes 512x384 sometimes
@@ -247,7 +254,7 @@ mapSlavePhysical(hwcBoardInfo *bInfo, FxU32 chipNum)
}
numChips = memBase0Decode / (32*1024*1024);
memBase1Decode = SST_PCI_MEMBASE1_DECODE_64MB
memBase1Decode = SST_PCI_MEMBASE1_DECODE_64MB;
/* Okay, remap master to make room for slaves. */
cfgPciDecode &= ~(SST_PCI_MEMBASE0_DECODE | SST_PCI_MEMBASE1_DECODE | SST_PCI_IOBASE0_DECODE);
@@ -318,7 +325,7 @@ initSlave(hwcBoardInfo *bInfo, FxU32 chipNum)
FxU32 pciInit0, pllCtrl1;
FxU32 dramInit0, dramInit1;
FxU32 miscInit0, miscInit1;
FxU32 tmuGbeInit
FxU32 tmuGbeInit;
FxU32 cmdStatus;
LOG((dbg,"initSlave(%d)\n",chipNum));
@@ -338,12 +345,12 @@ initSlave(hwcBoardInfo *bInfo, FxU32 chipNum)
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, miscInit0, miscInit0);
HWC_IO_LOAD(bInfo->regInfo, miscInit1, miscInit1);
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, miscInit1, miscInit1);
HWC_IO_LOAD(bInfo->regInfo, tmuGbeInit, tmuGbeInit)
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, tmuGbeInit, tmuGbeInit)
HWC_IO_LOAD(bInfo->regInfo, tmuGbeInit, tmuGbeInit);
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, tmuGbeInit, tmuGbeInit);
/* Init DRAM mode stuff *
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, dramData, 0x000000037)
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, dramCommand, 0x10d)
/* Init DRAM mode stuff */
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, dramData, 0x000000037);
HWC_IO_STORE_SLAVE(chipNum, bInfo->regInfo, dramCommand, 0x10d);
/* Disable master IO */
cmdStatus = CFG_READ(0, status_command);
@@ -354,8 +361,8 @@ initSlave(hwcBoardInfo *bInfo, FxU32 chipNum)
cmdStatus |= 1;
CFG_WRITE(chipNum, status_command, cmdStatus);
/* Reset everything *
h3InitResetAll(bInfo->regInfo.slaveIOBase[chipNum-1])
/* Reset everything */
h3InitResetAll(bInfo->regInfo.slaveIOBase[chipNum-1]);
/* Init VGA (no legacy decode) */
h3InitVga(bInfo->regInfo.slaveIOPortBase[chipNum-1], FXFALSE);
@@ -370,11 +377,11 @@ initSlave(hwcBoardInfo *bInfo, FxU32 chipNum)
CFG_WRITE(0, status_command, cmdStatus);
{
FxU32 status, vgaInit0, vgaInit1
FxU32 status, vgaInit0, vgaInit1;
HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, status, status);
HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, vgaInit0, vgaInit0);
HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, vgaInit1, vgaInit1)
LOG((dbg,"initSlave(%d) done. slave status: %08lx vgaInit0: %08lx vgaInit1: %08lx\n",chipNum, status, vgaInit0, vgaInit1))
HWC_IO_LOAD_SLAVE(chipNum, bInfo->regInfo, vgaInit1, vgaInit1);
LOG((dbg,"initSlave(%d) done. slave status: %08lx vgaInit0: %08lx vgaInit1: %08lx\n",chipNum, status, vgaInit0, vgaInit1));
}
}
@@ -412,7 +419,7 @@ static FxU16 modeData[21] =
20 /* 2X Mode */
};
#define GET_CRTC_INDEX(_srcindex, _dstindex) \
ISET8PHYS(0x0d4, _srcindex); \
modeData[_dstindex] = IGET8PHYS(0x0d5);
@@ -458,12 +465,12 @@ buildVideoModeData(hwcBoardInfo *bInfo)
/* 2X Mode */
modeData[20] = (FxU16)IGET32(dacMode);
FxU32 i
for(i = 0; i < 21; i++)
LOG((dbg,"modeData[%d]: %02lx\n",i,modeData[i]))
}
{
FxU32 i;
for(i = 0; i < 21; i++) {
LOG((dbg,"modeData[%d]: %02lx\n",i,modeData[i]));
}
}
}
void
@@ -1256,12 +1263,12 @@ void hwcSetSLIAAMode(hwcBoardInfo *bInfo,
CFG_WRITE(chipNum, cfgSliLfbCtrl, 0);
CFG_WRITE(chipNum, cfgAALfbCtrl, 0);
CFG_WRITE(chipNum, cfgSliAAMisc, 0);
// Make sure slave chips don't drive HSYNC & VSYN
if(chipNum > 0)
CFG_WRITE(chipNum, cfgVideoCtrl0, SST_CFG_DAC_HSYNC_TRISTATE | SST_CFG_DAC_VSYNC_TRISTATE)
} else
CFG_WRITE(chipNum, cfgVideoCtrl0, 0)
// Make sure slave chips don't drive HSYNC & VSYNC
if(chipNum > 0) {
CFG_WRITE(chipNum, cfgVideoCtrl0, SST_CFG_DAC_HSYNC_TRISTATE | SST_CFG_DAC_VSYNC_TRISTATE);
} else {
CFG_WRITE(chipNum, cfgVideoCtrl0, 0);
}
CFG_WRITE(chipNum, cfgVideoCtrl1, 0);
CFG_WRITE(chipNum, cfgVideoCtrl2, 0);
CFG_WRITE(chipNum, cfgAADepthBufferAperture, 0);

View File

@@ -18,6 +18,8 @@
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Log:
** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce
** branching.
** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the
** Napalm Glide open source release. Changes include cleaned up offensive
** comments and new legal headers.

View File

@@ -19,6 +19,8 @@
**
** $Header$
** $Log:
** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce
** branching.
** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the
** Napalm Glide open source release. Changes include cleaned up offensive
** comments and new legal headers.

View File

@@ -2,23 +2,23 @@
#include "vxd.h"
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONL
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGH
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DF
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT T
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS I
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FA
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS O
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE
**
** $Revision$
** $Date$

View File

@@ -1,21 +1,21 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONL
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGH
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DF
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT T
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS I
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FA
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS O
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE
*
/
**

View File

@@ -19,6 +19,8 @@
**
** $Header$
** $Log:
** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce
** branching.
** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the
** Napalm Glide open source release. Changes include cleaned up offensive
** comments and new legal headers.

View File

@@ -19,6 +19,8 @@
**
** $Header$
** $Log:
** 5 3dfx 1.2.1.0.1.0 10/11/00 Brent Forced check in to enforce
** branching.
** 4 3dfx 1.2.1.0 06/20/00 Joseph Kain Changes to support the
** Napalm Glide open source release. Changes include cleaned up offensive
** comments and new legal headers.

View File

@@ -2,10 +2,10 @@
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
@@ -20,6 +20,7 @@
/*
We need to provide the following functions:
char *
@@ -126,8 +127,8 @@ void grDRIOpen(char *pFB, char *pRegs, int deviceID, int width, int height,
driInfo.depthOffset=depthOffset;
driInfo.textureOffset=textureOffset;
driInfo.textureSize=textureSize;
driInfo.fifoPtr=(volatile int **)fifoPtr;
driInfo.fifoRead=(volatile int **)fifoRead;
driInfo.fifoPtr=fifoPtr;
driInfo.fifoRead=fifoRead;
}
void grDRIPosition(int x, int y, int w, int h,
@@ -145,8 +146,7 @@ static void loadEnvFile() {
char data[128];
char *env, *val;
envitem *item;
unsigned int sawError=0;
envitem *first=(envitem *)0;
int first=1;
if (envinit) return;
envinit=1;
@@ -158,9 +158,9 @@ static void loadEnvFile() {
if (*data=='\n') continue;
val=strchr(data, '=');
if (!val) {
if (sawError) {
if (first) {
fprintf(stderr, "In config file /etc/conf.3dfx/voodoo3:\n");
sawError=1;
first=0;
}
fprintf(stderr, "Malformed line: %s\n", data);
continue;
@@ -234,7 +234,6 @@ hwcInit(FxU32 vID, FxU32 dID) {
FxBool
hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask) {
extern int getpid();
if (bInfo->pciInfo.initialized == FXFALSE) {
sprintf(errorString, "hwcMapBoard: Called before hwcInit\n");
return FXFALSE;
@@ -334,11 +333,6 @@ hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress)
FxU32 tileRow;
FxU32 lfbAddress;
FxU32 lfbYOffset;
/*
* This is the tile aperture stride. It should be
* a power of two between 1k and 16k.
*/
FxU32 lfbBufferStride = bInfo->buffInfo.bufLfbStride;
if (bInfo->vidInfo.tiled) {
GDBG_INFO(80, "\tphysAddress: 0x%08lx\n",physAddress);
@@ -371,7 +365,7 @@ hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress)
lfbYOffset = ((tileRow * 32 + tileScanline) << (bInfo->h3nwaySli >> 1));
/* Compute LFB address of tile start */
lfbAddress = bInfo->primaryOffset + lfbYOffset * lfbBufferStride + tileXOffset * 128;
lfbAddress = bInfo->primaryOffset + lfbYOffset * HWC_LFB_STRIDE + tileXOffset * 128;
GDBG_INFO(80, "\tlfbAddress: %08lx\n", lfbAddress);
retVal = lfbAddress;
@@ -381,20 +375,6 @@ hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress)
return retVal;
}
static FxU32
calculateLfbStride(FxU32 screenWidth)
{
#if 1
int TileAperturePitch;
for (TileAperturePitch = 1024;
(TileAperturePitch < (16 << 10)) && (TileAperturePitch < screenWidth);
TileAperturePitch <<= 1);
return(TileAperturePitch);
#else
return(0x1000);
#endif
}
FxBool
hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers)
{
@@ -423,7 +403,6 @@ hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers)
bInfo->buffInfo.bufStride = bufStride;
bInfo->buffInfo.bufSize = bufSize;
bInfo->buffInfo.bufLfbStride = calculateLfbStride(bufStride);
if (bInfo->vidInfo.tiled) {
bInfo->buffInfo.bufStrideInTiles = (bufStride >> 7);
@@ -480,7 +459,6 @@ hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers)
GDBG_INFO(80, "\tbufStride: 0x%x\n", bInfo->buffInfo.bufStride);
GDBG_INFO(80, "\tbufStrideInTiles:0x%x\n", bInfo->buffInfo.bufStrideInTiles);
GDBG_INFO(80, "\tbufHeightInTiles:0x%x\n", bInfo->buffInfo.bufHeightInTiles);
GDBG_INFO(80, "\tbufLfbStride :0x%x\n", bInfo->buffInfo.bufLfbStride);
GDBG_INFO(80, "\tnColBuffers: 0x%x\n", bInfo->buffInfo.nColBuffers);
GDBG_INFO(80, "\tcolBuffStart0[0]: 0x%x\n", bInfo->buffInfo.colBuffStart0[0]);
GDBG_INFO(80, "\tcolBuffEnd0[0]: 0x%x\n", bInfo->buffInfo.colBuffEnd0[0]);
@@ -605,7 +583,7 @@ calcBufferStride(hwcBoardInfo *bInfo, FxU32 xres, FxBool tiled)
if (tiled == FXTRUE) {
/* Calculate tile width stuff */
strideInTiles = (xres << shift) >> 7;
if ((xres << shift) & (HWC_TILE_WIDTH - 1))
if ((xres << 1) & (HWC_TILE_WIDTH - 1))
strideInTiles++;
return (strideInTiles * HWC_TILE_WIDTH);
@@ -891,7 +869,8 @@ hwcGetenv(char *a)
}
FxBool
hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res)
hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res,
GrScreenRefresh_t ref)
{
#define FN_NAME "hwcResolutionSupported"

View File

@@ -1,21 +1,21 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONL
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGH
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DF
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT T
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS I
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FA
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS O
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE
*/
#ifdef DCON

View File

@@ -1,21 +1,21 @@
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONL
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGH
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DF
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT T
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS I
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FA
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS O
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE
#
# $Revision: 1.1
# $Date: 2000/06/16 20:45:59

View File

@@ -1,24 +1,41 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
** Copyright (c) 1996, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $Header$
** $Log:
** 92 3dfx 1.71.1.6.1.4.1.711/08/00 Drew McMinn Added
** FX_GLIDE_BRIGHTNESS and FX_GLIDE_CONTRAST modifiers
** 91 3dfx 1.71.1.6.1.4.1.610/11/00 Brent Forced check in to
** enforce branching.
** 90 3dfx 1.71.1.6.1.4.1.509/15/00 troy thornton added code to allow
** grquerryresolutions to check the refresh rate of the monitor before
** returning a valid screen mode
** 89 3dfx 1.71.1.6.1.4.1.408/29/00 Jonny Cochrane Some 8x FSAA code
** 88 3dfx 1.71.1.6.1.4.1.308/07/00 Andy Hanson Fixed up lfb cfg
** registers. Variable bpp was being used without being properly
** initialized. Cleaned up source, and put some safety strncpy's for
** errorString. Sprintf's are still unsafe.
** 87 3dfx 1.71.1.6.1.4.1.207/21/00 Adam Briggs ack: the display driver
** is always returning 1 for the AGPINFO escape whether or not an AGP fifo
** exists... make sure we use a memory fifo if the agp fifo is zero bytes
** long
** 86 3dfx 1.71.1.6.1.4.1.107/06/00 Adam Briggs fixed Ken's AA
** screenshot function for 32bit & 2-sample AA
** 85 3dfx 1.71.1.6.1.4.1.006/22/00 troy thornton added
** FX_GLIDE_USE_APP_GAMMA env. var.
** 84 3dfx 1.71.1.6.1.406/20/00 Joseph Kain Fixed errors introduced by
** my previous merge.
** 83 3dfx 1.71.1.6.1.306/20/00 Joseph Kain Changes to support the
@@ -68,7 +85,7 @@
** Reset FBI & 2D when Glide starts up.
** 60 3dfx 1.59 03/21/00 Kenneth Dyke Lots of video backend fixes
** for SLI/AA/32-bit.
** 59 3dfx 1.58 03/16/00 Kenneth Dyke Don't let the user do
** 59 3dfx 1.58 03/15/00 Kenneth Dyke Don't let the user do
** something dumb. ;)
** 58 3dfx 1.57 03/14/00 Adam Briggs let glide decide when to
** use analog sli
@@ -140,7 +157,7 @@
** whining
** 27 3dfx 1.26 01/21/00 Adam Briggs get the correct linear
** mappings of slave regs
** 26 3dfx 1.25 01/20/00 Kenneth Dyke Do proper Napalm fifo
** 26 3dfx 1.25 01/19/00 Kenneth Dyke Do proper Napalm fifo
** padding.
** 25 3dfx 1.24 01/19/00 Adam Briggs for some strange reason,
** display driver escapes don't seem to work in DOS.
@@ -853,9 +870,31 @@ typedef struct sli_aa_request {
#define HWC_RAW_LFB_STRIDE SST_RAW_LFB_ADDR_STRIDE_8K
hwcInfo hInfo;
static char errorString[1024];
#define MAX_ERROR_SIZE 1024
static char errorString[MAX_ERROR_SIZE];
static FxU32 fenceVar;
FxU32 hwc_errncpy(char *dst,const char *src);
/* like strncpy, for the error string except it always null terminates */
FxU32 hwc_errncpy(char *dst,const char *src)
{
FxU32 i,size=MAX_ERROR_SIZE;
if (size==0)
return 0;
for(i=0;i<size;i++)
{
*dst++=*src++;
if (src[-1]==0)
return i;
}
dst[-1]=0;
return (i-1);
}
#if defined(__WATCOMC__)
/*
@@ -910,7 +949,7 @@ calcBufferSizeInTiles(hwcBoardInfo* bInfo, FxU32 xres, FxU32 yres);
static FxU32
calcBufferHeightInTiles(hwcBoardInfo* bInfo, FxU32 yres);
static FxBool resolutionSupported[HWC_MAX_BOARDS][0xF];
static FxBool resolutionSupported[HWC_MAX_BOARDS][0x20][0x10];
/*
** DOS-only stuff for multi-chip boards.
@@ -1261,114 +1300,119 @@ hwcInit(FxU32 vID, FxU32 dID)
hInfo.boardInfo[monitor].h3Mem = atoi(GETENV("FX_GLIDE_FBRAM"));
}
checkResolutions(resolutionSupported[monitor],
checkResolutions((int *) resolutionSupported[monitor],
(FxU32) sizeof(resolutionSupported[0][0]) / sizeof(FxBool),
(void *) hInfo.boardInfo[monitor].hMon);
}
}
#elif defined(HWC_GDX_INIT)
{
FxU32 i, j = 0, numTargets;
{
FxU32 i, j = 0, numTargets;
/* Grab hrm extensions we need. */
_hrmGetVersionInfo = hrmGetExtension("hrmGetVersionInfo");
_hrmSetExclusiveMode = hrmGetExtension("hrmSetExclusiveMode");
_hrmSetVideoMode = hrmGetExtension("hrmSetVideoMode");
_hrmReleaseExclusiveMode = hrmGetExtension("hrmReleaseExclusiveMode");
_hrmGetTargetBoardInfo = hrmGetExtension("hrmGetTargetBoardInfoExt");
_hrmAllocateBlock = hrmGetExtension("hrmAllocateBlock");
_hrmFreeBlock = hrmGetExtension("hrmFreeBlock");
_hrmAllocWinContext = hrmGetExtension("hrmAllocWinContext");
_hrmFreeWinContext = hrmGetExtension("hrmFreeWinContext");
_hrmExecuteWinFifo = hrmGetExtension("hrmExecuteWinFifo");
_hrmGetDeviceConfig = hrmGetExtension("hrmGetDeviceConfig");
_hrmGetAGPInfo = hrmGetExtension("hrmGetAGPInfo");
_hrmWriteConfigRegister = hrmGetExtension("hrmWriteConfigRegister");
_hrmReadConfigRegister = hrmGetExtension("hrmReadConfigRegister");
_hrmGetSlaveRegs = hrmGetExtension("hrmGetSlaveRegs");
_hrmSLIAA = hrmGetExtension("hrmSLIAA");
/* Grab hrm extensions we need. */
_hrmGetVersionInfo = hrmGetExtension("hrmGetVersionInfo");
_hrmSetExclusiveMode = hrmGetExtension("hrmSetExclusiveMode");
_hrmSetVideoMode = hrmGetExtension("hrmSetVideoMode");
_hrmReleaseExclusiveMode = hrmGetExtension("hrmReleaseExclusiveMode");
_hrmGetTargetBoardInfo = hrmGetExtension("hrmGetTargetBoardInfoExt");
_hrmAllocateBlock = hrmGetExtension("hrmAllocateBlock");
_hrmFreeBlock = hrmGetExtension("hrmFreeBlock");
_hrmAllocWinContext = hrmGetExtension("hrmAllocWinContext");
_hrmFreeWinContext = hrmGetExtension("hrmFreeWinContext");
_hrmExecuteWinFifo = hrmGetExtension("hrmExecuteWinFifo");
_hrmGetDeviceConfig = hrmGetExtension("hrmGetDeviceConfig");
_hrmGetAGPInfo = hrmGetExtension("hrmGetAGPInfo");
_hrmWriteConfigRegister = hrmGetExtension("hrmWriteConfigRegister");
_hrmReadConfigRegister = hrmGetExtension("hrmReadConfigRegister");
_hrmGetSlaveRegs = hrmGetExtension("hrmGetSlaveRegs");
_hrmSLIAA = hrmGetExtension("hrmSLIAA");
/* Have to bail out now if these aren't available. */
if(!(_hrmSetExclusiveMode && _hrmSetVideoMode &&
/* Have to bail out now if these aren't available. */
if(!(_hrmSetExclusiveMode && _hrmSetVideoMode &&
_hrmReleaseExclusiveMode && _hrmGetTargetBoardInfo && _hrmGetVersionInfo))
return NULL;
return NULL;
/* safety net: no exec if not compatible */
{
hrmVersionInfo_t theVersion;
_hrmGetVersionInfo( &theVersion );
if ( theVersion.major >= 1 && theVersion.minor >= 6 )
{
numTargets = hrmGetNumTargets();
}
else
{
sprintf(errorString, "Current version of 3dfx Hardware Resource Manager is not compatible with this version of Glide\n");
GDBG_INFO(80, "%s: ERROR... Current version of 3dfx Hardware Resource Manager is not compatible\n", FN_NAME);
numTargets = 0;
}
}
/* safety net: no exec if not compatible */
{
hrmVersionInfo_t theVersion;
_hrmGetVersionInfo( &theVersion );
if ( theVersion.major >= 1 && theVersion.minor >= 6 )
{
numTargets = hrmGetNumTargets();
}
else
{
hwc_errncpy(errorString, "Current version of 3dfx Hardware Resource Manager is not compatible with this version of Glide\n");
GDBG_INFO(80, "%s: ERROR... Current version of 3dfx Hardware Resource Manager is not compatible\n", FN_NAME);
numTargets = 0;
}
}
for(i = 0; i < numTargets; i++) {
hrmBoard_t *board;
hrmBoardInfo_t boardInfo;
for(i = 0; i < numTargets; i++)
{
hrmBoard_t *board;
hrmBoardInfo_t boardInfo;
board = hrmGetTargetAtIndex(i);
board = hrmGetTargetAtIndex(i);
/* Set the size of the struct we're passing in so the HRM has a clue
what kind of info to return in case the HRM's struct grows in the
future. */
boardInfo.size = sizeof(boardInfo);
_hrmGetTargetBoardInfo(board,&boardInfo);
/* Set the size of the struct we're passing in so the HRM has a clue
what kind of info to return in case the HRM's struct grows in the
future. */
boardInfo.size = sizeof(boardInfo);
_hrmGetTargetBoardInfo(board,&boardInfo);
hInfo.nBoards++;
hInfo.nBoards++;
/* Note that we use hMon for something different than the HRM does. */
/* We use it to store the reference back to the hrm board this data came
/* Note that we use hMon for something different than the HRM does. */
/* We use it to store the reference back to the hrm board this data came
frome. The HRM uses hMon to store the GDHandle of the board. However,
since we really do need the GDHandle too (for grDeviceQuery), we stash that in hdc. */
hInfo.boardInfo[j].hMon = board;
hInfo.boardInfo[j].hdc = (void *)boardInfo.driverRefNum;
hInfo.boardInfo[j].h3pixelSize = 2;
hInfo.boardInfo[j].h3nwaySli = 1;
hInfo.boardInfo[j].h3Mem = boardInfo.h3Mem;
hInfo.boardInfo[j].devRev = boardInfo.deviceRev;
hInfo.boardInfo[j].pciInfo.vendorID = boardInfo.vendorID;
hInfo.boardInfo[j].pciInfo.deviceID = boardInfo.deviceID;
hInfo.boardInfo[j].pciInfo.pciBaseAddr[0] = boardInfo.pciBaseAddr[0];
hInfo.boardInfo[j].pciInfo.pciBaseAddr[1] = boardInfo.pciBaseAddr[1];
hInfo.boardInfo[j].pciInfo.pciBaseAddr[2] = boardInfo.pciBaseAddr[2];
hInfo.boardInfo[j].pciInfo.initialized = 1;
hInfo.boardInfo[j].pciInfo.devNum = boardInfo.devNum;
hInfo.boardInfo[j].pciInfo.isMaster = boardInfo.isMaster;
hInfo.boardInfo[j].pciInfo.numChips = boardInfo.numChips;
hInfo.boardInfo[j].pciInfo.swizzleOffset[0] = boardInfo.swizzleOffset[0];
hInfo.boardInfo[j].pciInfo.swizzleOffset[1] = boardInfo.swizzleOffset[1];
hInfo.boardInfo[j].pciInfo.swizzleOffset[2] = boardInfo.swizzleOffset[2];
hInfo.boardInfo[j].pciInfo.swizzleOffset[3] = boardInfo.swizzleOffset[3];
if (GETENV("FX_GLIDE_FBRAM")) {
hInfo.boardInfo[j].h3Mem = atoi(GETENV("FX_GLIDE_FBRAM"));
}
hInfo.boardInfo[j].hMon = board;
hInfo.boardInfo[j].hdc = (void *)boardInfo.driverRefNum;
hInfo.boardInfo[j].h3pixelSize = 2;
hInfo.boardInfo[j].h3nwaySli = 1;
hInfo.boardInfo[j].h3Mem = boardInfo.h3Mem;
hInfo.boardInfo[j].devRev = boardInfo.deviceRev;
hInfo.boardInfo[j].pciInfo.vendorID = boardInfo.vendorID;
hInfo.boardInfo[j].pciInfo.deviceID = boardInfo.deviceID;
hInfo.boardInfo[j].pciInfo.pciBaseAddr[0] = boardInfo.pciBaseAddr[0];
hInfo.boardInfo[j].pciInfo.pciBaseAddr[1] = boardInfo.pciBaseAddr[1];
hInfo.boardInfo[j].pciInfo.pciBaseAddr[2] = boardInfo.pciBaseAddr[2];
hInfo.boardInfo[j].pciInfo.initialized = 1;
hInfo.boardInfo[j].pciInfo.devNum = boardInfo.devNum;
hInfo.boardInfo[j].pciInfo.isMaster = boardInfo.isMaster;
hInfo.boardInfo[j].pciInfo.numChips = boardInfo.numChips;
hInfo.boardInfo[j].pciInfo.swizzleOffset[0] = boardInfo.swizzleOffset[0];
hInfo.boardInfo[j].pciInfo.swizzleOffset[1] = boardInfo.swizzleOffset[1];
hInfo.boardInfo[j].pciInfo.swizzleOffset[2] = boardInfo.swizzleOffset[2];
hInfo.boardInfo[j].pciInfo.swizzleOffset[3] = boardInfo.swizzleOffset[3];
if (GETENV("FX_GLIDE_FBRAM")) {
hInfo.boardInfo[j].h3Mem = atoi(GETENV("FX_GLIDE_FBRAM"));
}
#ifdef FX_GLIDE_NAPALM
if (GETENV("FX_GLIDE_DEVICEID")) {
FxU32 deviceid = atoi(GETENV("FX_GLIDE_DEVICEID"));
hInfo.boardInfo[j].pciInfo.deviceID = deviceid;
if (GETENV("FX_GLIDE_DEVICEID"))
{
FxU32 deviceid = atoi(GETENV("FX_GLIDE_DEVICEID"));
hInfo.boardInfo[j].pciInfo.deviceID = deviceid;
}
if(GETENV("FX_GLIDE_NUM_CHIPS"))
{
FxU32 numChips;
numChips = atoi(GETENV("FX_GLIDE_NUM_CHIPS"));
/* Don't do something stupid... */
if(numChips <= hInfo.boardInfo[j].pciInfo.numChips)
{
hInfo.boardInfo[j].pciInfo.numChips = numChips;
}
}
#endif
j++;
}
if(GETENV("FX_GLIDE_NUM_CHIPS")) {
FxU32 numChips;
numChips = atoi(GETENV("FX_GLIDE_NUM_CHIPS"));
/* Don't do something stupid... */
if(numChips <= hInfo.boardInfo[j].pciInfo.numChips) {
hInfo.boardInfo[j].pciInfo.numChips = numChips;
}
}
#endif
j++;
}
}
}
#else /* HWC_GDX_INIT */
{
int i, chip;
@@ -1507,7 +1551,7 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask)
sizeof(ctxRes), (void *) &ctxRes);
if (ctxRes.resStatus != 1) {
strcpy(errorString, "HWCEXT_GETLINEARADDR Failed");
hwc_errncpy(errorString, "HWCEXT_GETLINEARADDR Failed");
return FXFALSE;
}
bInfo->isMapped = FXTRUE;
@@ -1541,7 +1585,7 @@ hwcMapBoard(hwcBoardInfo *bInfo, FxU32 bAddrMask)
if (ctxRes.resStatus != 1)
{
strcpy(errorString, "HWCEXT_GET_SLAVE_REGS Failed") ;
hwc_errncpy(errorString, "HWCEXT_GET_SLAVE_REGS Failed") ;
return FXFALSE ;
}
@@ -1676,7 +1720,7 @@ hwcInitRegisters(hwcBoardInfo *bInfo)
sgramMode, sgramMask, sgramColor;
if (bInfo->linearInfo.initialized == FXFALSE) {
printf(errorString, "%s: Called before hwcMapBoard\n", FN_NAME);
sprintf(errorString, "%s: Called before hwcMapBoard\n", FN_NAME);
return FXFALSE;
}
@@ -2416,7 +2460,7 @@ _hwcLinear2HWAddr(const FxU32 linearAddr,
sizeof(ctxReq), (LPSTR)&ctxReq,
sizeof(ctxRes), (LPSTR)&ctxRes) > 0);
if (!retVal) {
strcpy(errorString, "HWCEXT_GETDEVICECONFIG failed");
hwc_errncpy(errorString, "HWCEXT_GETDEVICECONFIG failed");
GDBG_INFO(80, "%s: %s.\n", FN_NAME, errorString);
goto __errExit;
}
@@ -2577,7 +2621,7 @@ hwcGetSurfaceInfo(const hwcBoardInfo* bInfo,
sizeof(ctxReq), (LPCSTR)&ctxReq,
sizeof(ctxRes), (LPSTR)&ctxRes) > 0);
if (!retVal) {
strcpy(errorString, "HWCEXT_LINEAR_MAP_OFFSET failed");
hwc_errncpy(errorString, "HWCEXT_LINEAR_MAP_OFFSET failed");
GDBG_INFO(80, "%s: %s.\n", FN_NAME, errorString);
}
@@ -2622,7 +2666,7 @@ hwcAllocWinContext(hwcBoardInfo* bInfo)
if (ExtEscape(bInfo->hdc, HWCEXT_ESCAPE(bInfo->boardNum), /**/
sizeof(ctxReq), (LPSTR)&ctxReq,
sizeof(ctxRes), (LPSTR)&ctxRes) < 1) {
strcpy(errorString, FN_NAME": HWCEXT_ALLOCCONTEXT failed");
hwc_errncpy(errorString, FN_NAME": HWCEXT_ALLOCCONTEXT failed");
} else {
retVal = ctxRes.optData.allocContextRes.contextID;
}
@@ -3065,7 +3109,7 @@ hwcLockWinFifo(hwcBoardInfo* bInfo,
*/
IDirectDrawSurface_Unlock((LPDIRECTDRAWSURFACE)fifo->surfaceFifo, NULL);
if (!retVal) {
strcpy(errorString, "Could not lock cmdFifo surface");
hwc_errncpy(errorString, "Could not lock cmdFifo surface");
GDBG_INFO(80, "%s: %s.\n", FN_NAME, errorString);
goto __errFifoLock;
}
@@ -3084,7 +3128,7 @@ hwcLockWinFifo(hwcBoardInfo* bInfo,
*/
IDirectDrawSurface_Unlock((LPDIRECTDRAWSURFACE)fifo->surfaceSentinal, NULL);
if (!retVal) {
strcpy(errorString, "Could not lock serial # surface");
hwc_errncpy(errorString, "Could not lock serial # surface");
GDBG_INFO(80, "%s: %s.\n", FN_NAME, errorString);
goto __errFifoLock;
}
@@ -3115,7 +3159,7 @@ hwcLockWinFifo(hwcBoardInfo* bInfo,
sizeof(ctxReq), (LPSTR)&ctxReq,
sizeof(ctxRes), (LPSTR)&ctxRes) > 0);
if (!retVal) {
strcpy(errorString, "HWCEXT_GETDEVICECONFIG failed");
hwc_errncpy(errorString, "HWCEXT_GETDEVICECONFIG failed");
GDBG_INFO(80, "%s: %s.\n", FN_NAME, errorString);
goto __errFifoLock;
}
@@ -3147,7 +3191,7 @@ hwcLockWinFifo(hwcBoardInfo* bInfo,
sizeof(ctxReq), (LPCSTR)&ctxReq,
sizeof(ctxRes), (LPSTR)&ctxRes) > 0);
if (!retVal) {
strcpy(errorString, "HWCEXT_LINEAR_MAP_OFFSET failed");
hwc_errncpy(errorString, "HWCEXT_LINEAR_MAP_OFFSET failed");
GDBG_INFO(80, "%s: %s.\n", FN_NAME, errorString);
goto __errFifoLock;
}
@@ -3780,60 +3824,62 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
hwcExtResult_t ctxRes;
#endif
{
FxU32 refresh;
static FxU32 refConstToRefreshHz[] = {
60, /* GR_REFRESH_60Hz */
70, /* GR_REFRESH_70Hz */
72, /* GR_REFRESH_72Hz */
75, /* GR_REFRESH_75Hz */
80, /* GR_REFRESH_80Hz */
90, /* GR_REFRESH_90Hz */
100, /* GR_REFRESH_100Hz */
85, /* GR_REFRESH_85Hz */
120, /* GR_REFRESH_120Hz */
0
};
{
FxU32 refresh;
static FxU32 refConstToRefreshHz[] =
{
60, /* GR_REFRESH_60Hz */
70, /* GR_REFRESH_70Hz */
72, /* GR_REFRESH_72Hz */
75, /* GR_REFRESH_75Hz */
80, /* GR_REFRESH_80Hz */
90, /* GR_REFRESH_90Hz */
100, /* GR_REFRESH_100Hz */
85, /* GR_REFRESH_85Hz */
120, /* GR_REFRESH_120Hz */
0
};
if (bInfo->vidInfo.vRefresh > GR_REFRESH_120Hz)
refresh = 0;
else
refresh = bInfo->vidInfo.vRefresh;
if (bInfo->vidInfo.vRefresh > GR_REFRESH_120Hz)
refresh = 0;
else
refresh = bInfo->vidInfo.vRefresh;
refresh = refConstToRefreshHz[refresh]; /* Make sure we use the table, otherwise
refresh = refConstToRefreshHz[refresh]; /* Make sure we use the table, otherwise
we will always pass 0Hz to setVideoMode */
if (GETENV("FX_GLIDE_REFRESH")) {
refresh = atoi(GETENV("FX_GLIDE_REFRESH"));
}
if ( !setVideoMode( (void*)bInfo->vidInfo.hWnd,
if (GETENV("FX_GLIDE_REFRESH"))
refresh = atoi(GETENV("FX_GLIDE_REFRESH"));
if ( !setVideoMode( (void*)bInfo->vidInfo.hWnd,
bInfo->vidInfo.xRes,
bInfo->vidInfo.yRes,
bInfo->h3pixelSize,
refresh,
bInfo->hMon ) ) {
GDBG_INFO(80, "%s: dxOpen() failed!\n", FN_NAME);
return FXFALSE;
}
bInfo->hMon ) )
{
GDBG_INFO(80, "%s: dxOpen() failed!\n", FN_NAME);
return FXFALSE;
}
#if SET_SWIZZLEHACK
setLfbSwizzleMode(bInfo->regInfo.rawLfbBase,bInfo->regInfo.ioMemBase,8);
setLfbSwizzleMode(bInfo->regInfo.rawLfbBase,bInfo->regInfo.ioMemBase,8);
#endif
}
}
#ifdef HWC_EXT_INIT
ctxReq.which = HWCEXT_HWCSETEXCLUSIVE;
ctxReq.optData.linearAddrReq.devNum = 0;
GDBG_INFO(80, FN_NAME ": ExtEscape:HWCEXT_HWCSETEXCLUSIVE\n");
ctxReq.which = HWCEXT_HWCSETEXCLUSIVE;
ctxReq.optData.linearAddrReq.devNum = 0;
GDBG_INFO(80, FN_NAME ": ExtEscape:HWCEXT_HWCSETEXCLUSIVE\n");
ExtEscape((HDC) bInfo->hdc, HWCEXT_ESCAPE(bInfo->boardNum), sizeof(ctxReq), (void *) &ctxReq, /**/
ExtEscape((HDC) bInfo->hdc, HWCEXT_ESCAPE(bInfo->boardNum), sizeof(ctxReq), (void *) &ctxReq, /**/
sizeof(ctxRes), (void *) &ctxRes);
status = ctxRes.resStatus;
status = ctxRes.resStatus;
if (status != 1) {
strcpy(errorString, "HWCEXT_HWCSETEXCLUSIVE Failed");
return FXFALSE;
}
if (status != 1)
{
hwc_errncpy(errorString,"HWCEXT_HWCSETEXCLUSIVE Failed");
return FXFALSE;
}
#else
/* This is off for now until the rest of the alt-tab type things are done. */
@@ -3843,66 +3889,74 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
* doing this before dorking w/ things that are going to make it
* unhappy.
*/
if (Dpmi2DEnvironmentP()) {
bInfo->hdc = DpmiDeviceContextGet("3DFXVB");
if (bInfo->hdc == 0x00UL) return FXFALSE;
if (!DpmiDeviceContextDispatch(bInfo->hdc, FxDCIsFullscreenP)) return FXFALSE;
if (!DpmiDeviceContextDispatch(bInfo->hdc, FxDCExclusiveLock)) return FXFALSE;
}
if (Dpmi2DEnvironmentP())
{
bInfo->hdc = DpmiDeviceContextGet("3DFXVB");
if (bInfo->hdc == 0x00UL)
return FXFALSE;
if (!DpmiDeviceContextDispatch(bInfo->hdc, FxDCIsFullscreenP))
return FXFALSE;
if (!DpmiDeviceContextDispatch(bInfo->hdc, FxDCExclusiveLock))
return FXFALSE;
}
#endif
#endif
switch(pixFmt) {
case SST_OVERLAY_PIXEL_RGB565D:
case SST_OVERLAY_PIXEL_RGB565U:
case SST_OVERLAY_PIXEL_RGB1555U:
case SST_OVERLAY_PIXEL_RGB1555D:
pixelShift = 1;
break;
case SST_OVERLAY_PIXEL_RGB32U:
pixelShift = 2;
break;
default:
GDBG_INFO(80, "%s: Invalid overlay pixel format: %08lx failed!\n", FN_NAME, pixFmt);
return FXFALSE;
}
HWC_IO_STORE(bInfo->regInfo, vidOverlayDudxOffsetSrcWidth,
((bInfo->vidInfo.xRes << pixelShift) << 19));
switch(pixFmt)
{
case SST_OVERLAY_PIXEL_RGB565D:
case SST_OVERLAY_PIXEL_RGB565U:
pixelShift = 1;
bpp=16;
break;
case SST_OVERLAY_PIXEL_RGB1555U:
case SST_OVERLAY_PIXEL_RGB1555D:
pixelShift = 1;
bpp=15;
break;
case SST_OVERLAY_PIXEL_RGB32U:
pixelShift = 2;
bpp=32;
break;
default:
GDBG_INFO(80, "%s: Invalid overlay pixel format: %08lx failed!\n", FN_NAME, pixFmt);
return FXFALSE;
}
HWC_IO_STORE(bInfo->regInfo, vidOverlayDudxOffsetSrcWidth,
((bInfo->vidInfo.xRes << pixelShift) << 19));
/* Video pixel buffer threshold */
{
FxU32 vidPixelBufThold;
FxU32 thold = 32;
/* Video pixel buffer threshold */
{
FxU32 vidPixelBufThold;
FxU32 thold = 32;
if (GETENV("SSTVB_PIXTHOLD")) {
thold = atoi(GETENV("SSTVB_PIXTHOLD"));
}
if (GETENV("SSTVB_PIXTHOLD"))
thold = atoi(GETENV("SSTVB_PIXTHOLD"));
thold &= 0x3f;
thold &= 0x3f;
vidPixelBufThold = (thold | (thold << 6) | (thold << 12));
vidPixelBufThold = (thold | (thold << 6) | (thold << 12));
HWC_IO_STORE(bInfo->regInfo, vidPixelBufThold, vidPixelBufThold);
}
HWC_IO_STORE(bInfo->regInfo, vidPixelBufThold, vidPixelBufThold);
}
#ifdef __WIN32__
if (vidTiming) {
hwcExtRequest_t ctxReq;
hwcExtResult_t ctxRes;
if (vidTiming)
{
hwcExtRequest_t ctxReq;
hwcExtResult_t ctxRes;
if( HWCEXT_PROTOCOL(bInfo->boardNum) )
{
ctxReq.which = HWCEXT_VIDTIMING;
ctxReq.optData.vidTimingReq.vidTiming = (void *) vidTiming;
GDBG_INFO(80, FN_NAME ": ExtEscape:HWCEXT_VIDTIMING\n");
ExtEscape((HDC) bInfo->hdc, HWCEXT_ESCAPE(bInfo->boardNum), sizeof(ctxReq), (void *) &ctxReq, /**/
sizeof(ctxRes), (void *) &ctxRes);
}
/* Ignore failure */
}
if( HWCEXT_PROTOCOL(bInfo->boardNum) )
{
ctxReq.which = HWCEXT_VIDTIMING;
ctxReq.optData.vidTimingReq.vidTiming = (void *) vidTiming;
GDBG_INFO(80, FN_NAME ": ExtEscape:HWCEXT_VIDTIMING\n");
ExtEscape((HDC) bInfo->hdc, HWCEXT_ESCAPE(bInfo->boardNum), sizeof(ctxReq), (void *) &ctxReq, /**/
sizeof(ctxRes), (void *) &ctxRes);
}
/* Ignore failure */
}
#endif
#ifdef __DOS32__
@@ -4027,42 +4081,48 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
** Adding user support for switching the video filter from 2x2 to 4x1
*/
if (NULL == GETENV("SSTH3_OVERLAYMODE")) {
/* We are in optimal mode by default */
if(bInfo->vidInfo.xRes < 1024)
vidProcCfg |= SST_OVERLAY_FILTER_2X2;
else
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
} else {
switch(atoi(GETENV("SSTH3_OVERLAYMODE"))) {
default:
case 1: /* Optimal */
if (NULL == GETENV("SSTH3_OVERLAYMODE"))
{
/* We are in optimal mode by default */
if(bInfo->vidInfo.xRes < 1024)
vidProcCfg |= SST_OVERLAY_FILTER_2X2;
vidProcCfg |= SST_OVERLAY_FILTER_2X2;
else
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
break;
case 2: /* Normal */
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
break;
case 3: /* High */
/* make sure that if 2x video mode is enabled, we use the 4x1 filter. */
if(vidProcCfg & SST_VIDEO_2X_MODE_EN)
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
else
vidProcCfg |= SST_OVERLAY_FILTER_2X2;
break;
case -1: /* Disabled */
break;
}
}
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
}
else
{
switch(atoi(GETENV("SSTH3_OVERLAYMODE")))
{
default:
case 1: /* Optimal */
if(bInfo->vidInfo.xRes < 1024)
vidProcCfg |= SST_OVERLAY_FILTER_2X2;
else
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
break;
case 2: /* Normal */
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
break;
case 3: /* High */
/* make sure that if 2x video mode is enabled, we use the 4x1 filter. */
if(vidProcCfg & SST_VIDEO_2X_MODE_EN)
vidProcCfg |= SST_OVERLAY_FILTER_4X4;
else
vidProcCfg |= SST_OVERLAY_FILTER_2X2;
break;
case -1: /* Disabled */
break;
}
}
if (bInfo->h3pixelSample < 2) {
if (bInfo->h3pixelSample < 2)
{
vidScreenSize &= ~SST_VIDEO_SCREEN_DESKTOPADDR_FIFO_ENABLE;
HWC_IO_STORE(bInfo->regInfo, vidScreenSize, vidScreenSize);
vidProcCfg &= ~(SST_CHROMA_EN|SST_DESKTOP_EN);
} else if (bInfo->h3pixelSample > 1 && bInfo->buffInfo.enable2ndbuffer) {
}
else if (bInfo->h3pixelSample > 1 && bInfo->buffInfo.enable2ndbuffer)
{
vidScreenSize |= SST_VIDEO_SCREEN_DESKTOPADDR_FIFO_ENABLE;
/*
@@ -4227,6 +4287,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
bInfo->h3analogSli = FXFALSE;
}
}
#ifdef HWC_EXT_INIT
#ifdef HWC_MINIVDD_HACK
@@ -4261,8 +4322,13 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
ctxReq.optData.sliAAReq.ChipInfo.dwChips = bInfo->pciInfo.numChips ;
/* Fill out AA mode information. */
ctxReq.optData.sliAAReq.ChipInfo.dwaaSampleHigh = (bInfo->h3pixelSample == 4) ;
/* 8xaa */
ctxReq.optData.sliAAReq.ChipInfo.dwaaSampleHigh = 0;
if(bInfo->h3pixelSample == 4)
ctxReq.optData.sliAAReq.ChipInfo.dwaaSampleHigh = 1;
else if(bInfo->h3pixelSample == 8)
ctxReq.optData.sliAAReq.ChipInfo.dwaaSampleHigh = 2;
ctxReq.optData.sliAAReq.MemInfo.dwaaSecondaryColorBufBegin = bInfo->buffInfo.colBuffStart1[0] ;
ctxReq.optData.sliAAReq.MemInfo.dwaaSecondaryDepthBufBegin = bInfo->buffInfo.lfbBuffAddr0[bInfo->buffInfo.nColBuffers];
ctxReq.optData.sliAAReq.MemInfo.dwaaSecondaryDepthBufEnd = bInfo->buffInfo.lfbBuffAddr0End[bInfo->buffInfo.nColBuffers];
@@ -4286,6 +4352,7 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
Sli_AA_Request.ChipInfo.dwaaEn = (bInfo->h3pixelSample > 1) ;
Sli_AA_Request.ChipInfo.dwsliEn = (bInfo->h3nwaySli > 1) ;
/* 8xaa */
Sli_AA_Request.ChipInfo.dwsliAaAnalog = bInfo->h3analogSli ;
Sli_AA_Request.ChipInfo.dwsli_nlines = bInfo->h3sliBandHeight;
Sli_AA_Request.ChipInfo.dwCfgSwapAlgorithm = 1 ; /* What the *F* is this about? */
@@ -4299,7 +4366,12 @@ hwcInitVideo(hwcBoardInfo *bInfo, FxBool tiled, FxVideoTimingInfo *vidTiming,
Sli_AA_Request.ChipInfo.dwChips = bInfo->pciInfo.numChips ;
/* Fill out AA mode information. */
Sli_AA_Request.ChipInfo.dwaaSampleHigh = (bInfo->h3pixelSample == 4) ;
/* 8xaa */
Sli_AA_Request.ChipInfo.dwaaSampleHigh = 0;
if(bInfo->h3pixelSample == 4)
Sli_AA_Request.ChipInfo.dwaaSampleHigh = 1;
else if(bInfo->h3pixelSample == 8)
Sli_AA_Request.ChipInfo.dwaaSampleHigh = 2;
Sli_AA_Request.MemInfo.dwaaSecondaryColorBufBegin = bInfo->buffInfo.colBuffStart1[0] ;
Sli_AA_Request.MemInfo.dwaaSecondaryDepthBufBegin = bInfo->buffInfo.lfbBuffAddr0[bInfo->buffInfo.nColBuffers];
@@ -5171,7 +5243,7 @@ hwcRestoreVideo(hwcBoardInfo *bInfo)
GDBG_INFO(80, "%s: ctxRes.resStatus = %d\n", FN_NAME, status);
if (ctxRes.resStatus != 1) {
strcpy(errorString, "HWCEXT_HWCRLSEXCLUSIVE Failed");
hwc_errncpy(errorString, "HWCEXT_HWCRLSEXCLUSIVE Failed");
return FXFALSE;
}
@@ -5536,7 +5608,9 @@ hwcInitAGPFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting)
agpSize = ctxRes.optData.agpInfoRes.size;
/* If we fail, bail and go to memory fifo */
if (status != 1) {
if ((status != 1) ||
(agpSize == 0))
{
return hwcInitFifo(bInfo, enableHoleCounting);
}
@@ -5750,9 +5824,9 @@ static void hwcReadBuffer8888(hwcBoardInfo *bInfo, FxU32 src, FxU32 strideInByte
b = (FxU8)(pix32 & 0xff);
/* Targa is bgr. */
*d++ = b;
*d++ = g;
*d++ = r;
*d++ += b >> (aaShift) ;
*d++ += g >> (aaShift) ;
*d++ += r >> (aaShift) ;
}
srcY++;
}
@@ -5821,8 +5895,10 @@ void hwcAAScreenShot(hwcBoardInfo *bInfo, FxU32 colBufNum)
if(!buffer)
return;
/* Have to do it the hard way for 16-bit */
if(bInfo->h3pixelSize == 2) {
/* Have to do it the hard way for 16-bit
* or for the new way of doing 2-sample */
if ((bInfo->h3pixelSize == 2) ||
(bInfo->h3pixelSample == 2)) {
/* Figure out framebuffer format (1555 or 565) */
HWC_IO_LOAD(bInfo->regInfo, vidProcCfg, vidProcCfg);
@@ -5836,6 +5912,10 @@ void hwcAAScreenShot(hwcBoardInfo *bInfo, FxU32 colBufNum)
case SST_OVERLAY_PIXEL_RGB565U:
hwcReadBufferFunc = hwcReadBuffer565;
break;
case SST_OVERLAY_PIXEL_RGB32U:
hwcReadBufferFunc = hwcReadBuffer8888;
break ;
}
/* First, figure out where everything is. */
@@ -6010,6 +6090,67 @@ void hwcAAScreenShot(hwcBoardInfo *bInfo, FxU32 colBufNum)
#define GREEN_SHIFT 8
#define BLUE_SHIFT 0
#define CLAMP(val, min, max) if (val > max) val = max; else if (val < min) val = min;
#define ADJUST(val, lowest, low, high, typ) if (high < lowest) val=(typ)(low); else val = (typ)(high)
#define GETFLOATENV(s, v) if (GETENV(s)) v = (FxFloat)(atof(GETENV(s)))
/*---------------------------------------------------------------------------
* Function : adjustBrightnessAndContrast_m
*
* Description :
* Routine to generate and apply a new gamma table based on
* passed in Brightness and Contrast values.
* contrast is >=0.0
* Brightness may be negative.
*---------------------------------------------------------------------------*/
static FxBool adjustBrightnessAndContrast_m(FxFloat contrast,
FxFloat brightness,
FxU32 nEntries,
FxU32 *pR, FxU32 *pG, FxU32 *pB)
{
FxU16 i;
FxFloat r,g,b;
if (pR == NULL || pG == NULL || pG == NULL)
return FXFALSE;
GDBG_INFO(69, ":\tSlot\t\tRed\t\tGreen\t\tBlue\n");
/* If the 0th row of the table contains non zero values then we get strange banding effects (Napalm) on
* returning to the desktop to ensure this does not happen these values are intialised to zero.
* Note this will not happen unless a brightness modifier is supplied, which highlighted the issue. */
GDBG_INFO(69, "Note r[0]=g[0]=b[0]=special default \n");
pB[0] = pG[0] = pR[0] = 0;
for (i=1; i<nEntries; i++)
{
/* Note to resolve rouding/sign errors, keep everything in the Fp domain until the last minute */
/* R */
r = (pR[i] * contrast) + brightness;
ADJUST(pR[i], 0.0f, 0, r, FxU32);
CLAMP(pR[i], 0, 255);
/* G */
g = (pG[i] * contrast) + brightness;
ADJUST(pG[i], 0.0f, 0, g, FxU32);
CLAMP(pG[i], 0, 255);
/* B */
b = (pB[i] * contrast) + brightness;
ADJUST(pB[i], 0.0f, 0, b, FxU32);
CLAMP(pB[i], 0, 255);
GDBG_INFO(69, "\t%d\t\t%d\t\t%d\t\t%d\n", i, pR[i], pG[i], pB[i]);
}
return FXTRUE;
}
/* Gamma */
FxBool
hwcGammaTable(hwcBoardInfo *bInfo, FxU32 nEntries, FxU32 *r, FxU32 *g, FxU32 *b)
{
@@ -6020,13 +6161,39 @@ hwcGammaTable(hwcBoardInfo *bInfo, FxU32 nEntries, FxU32 *r, FxU32 *g, FxU32 *b)
FxU32 dacBase;
FxU32 rDacBase;
FxU32 rDacData;
char *psBrightness = "FX_GLIDE_BRIGHTNESS";
char *psContrast = "FX_GLIDE_CONTRAST";
/* Adjust Gamma as user selected */
if (GETENV(psBrightness) || GETENV(psContrast))
{
FxFloat brightness = 0.0f;
FxFloat contrast = 1.0f;
/* override */
GETFLOATENV(psBrightness, brightness);
GETFLOATENV(psContrast, contrast);
/* clamp contrast to > 0.0 */
if (contrast <= 0.0f)
{
contrast = 1.0f;
GDBG_INFO(69,": minihwc Readjusting contrast to %3.3f as <=0.0 \n", contrast);
}
GDBG_INFO(69,": minihwc Overriding Brightness with %3.3f and Contrast with %3.3f\n", brightness, contrast);
adjustBrightnessAndContrast_m(contrast, brightness, nEntries, r,g,b);
}
/* Load the table into the Display driver as above */
for (i = 0; i < nEntries; i++) {
gRamp[i] =
((r[i] & 0xff) << RED_SHIFT) |
((g[i] & 0xff) << GREEN_SHIFT) |
((b[i] & 0xff) << BLUE_SHIFT);
GDBG_INFO(69,": gRamp[%d] = %d\n", i, gRamp[i]);
}
/*
@@ -6049,7 +6216,7 @@ hwcGammaTable(hwcBoardInfo *bInfo, FxU32 nEntries, FxU32 *r, FxU32 *g, FxU32 *b)
FN_NAME, (vidProcCfg & SST_OVERLAY_EN) ? 1 : 0);
GDBG_INFO(80, "%s: vidProcCFG(SST_OVERLAY_CLUT_BYPASS) = %d\n",
FN_NAME, (vidProcCfg & SST_OVERLAY_CLUT_BYPASS) ? 1 : 0);
for (i = 0; i < nEntries; i++) {
int repeat = 100;
while (repeat) {
@@ -6203,7 +6370,7 @@ hwcGammaRGB(hwcBoardInfo *bInfo, float gammaR, float gammaG, float gammaB)
int
i;
GDBG_INFO(80, FN_NAME "(0x%x, %1.2f, %1.2f, %1.2f)\n",
GDBG_INFO(69, FN_NAME "(0x%x, %1.2f, %1.2f, %1.2f)\n",
bInfo, gammaR, gammaG, gammaB);
/*
@@ -6270,7 +6437,7 @@ hwcSetMemClock(hwcBoardInfo *bInfo, FxU32 speedInMHz)
FxBool
hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res)
hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res, GrScreenRefresh_t ref)
{
#define FN_NAME "hwcResolutionSupported"
static char *resNames[] = {
@@ -6332,14 +6499,27 @@ hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res)
};
#endif
GDBG_INFO(80, FN_NAME ": res == %s (0x%x), supported == %s\n",
resNames[res], resolutionSupported[bInfo->boardNum][res],
resolutionSupported[bInfo->boardNum][res] ? "FXTRUE" : "FXFALSE");
static char *refresh[] = {
"GR_REFRESH_60Hz",
"GR_REFRESH_70Hz",
"GR_REFRESH_72Hz",
"GR_REFRESH_75Hz",
"GR_REFRESH_80Hz",
"GR_REFRESH_90Hz",
"GR_REFRESH_100Hz",
"GR_REFRESH_85Hz",
"GR_REFRESH_120Hz"
};
GDBG_INFO(80, FN_NAME ": res == %s (0x%x) ref == %s, supported == %s\n",
resNames[res], resolutionSupported[bInfo->boardNum][res][ref], refresh[ref],
resolutionSupported[bInfo->boardNum][res][ref] ? "FXTRUE" : "FXFALSE");
/* Glide has very good checking to see if the memory required is
available, so we'll just return whether the driver can do it. */
return resolutionSupported[bInfo->boardNum][res];
return resolutionSupported[bInfo->boardNum][res][ref];
#undef FN_NAME
} /* hwcResolutionSupported */

View File

@@ -1,21 +1,21 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONL
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGH
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DF
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT T
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS I
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FA
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS O
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVE
**
** $Header: minihwc.h, 22, 5/9/2000 12:58:24 PM, Kenneth Dyke
** $Log:
@@ -307,6 +307,8 @@ typedef struct hwcPCIInfo_s {
#if macintosh
FxU32
swizzleOffset[4]; /* Byte swizzle offsets */
FxBool
is66MHz; /* TRUE if the board is in a 66MHz PCI slot */
#endif
} hwcPCIInfo;
@@ -694,7 +696,7 @@ FxBool
hwcSetMemClock(hwcBoardInfo *bInfo, FxU32 speedInMHz);
FxBool
hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res);
hwcResolutionSupported(hwcBoardInfo *bInfo, GrScreenResolution_t res, GrScreenRefresh_t ref);
char *
hwcGetenv(char *a);

View File

@@ -27,5 +27,6 @@ FxBool setVideoMode( void *hwnd,
void resetVideo( void );
FxBool checkResolutions(FxBool *reslist, void *hmon);
FxBool checkResolutions(FxBool *reslist, FxU32 stride, void *hmon);

View File

@@ -20,12 +20,14 @@
** $Revision$
** $Date$
** $Log:
** 4 3dfx 1.1.2.0.1.0 10/11/00 Brent Forced check in to enforce
** branching.
** 3 3dfx 1.1.2.0 06/20/00 Joseph Kain Changes to support the
** Napalm Glide open source release. Changes include cleaned up offensive
** comments and new legal headers.
** 2 3dfx 1.1 09/24/99 Mark McMahon Fixed PRS 7906:
** Incorrect memory size reported by control panel in SLI mode
** 1 3dfx 1.0 09/12/99 StarTeam VTS Administrator
** 1 3dfx 1.0 09/11/99 StarTeam VTS Administrator
** $
//
// 1 17/09/99 15:29 Mmcmahon