more warning fixing and syncing glide2x init with glide3x
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Initialization code for initializing canpus cards w/ assymetric
|
||||
** inter-chip buses.
|
||||
**
|
||||
@@ -92,12 +91,12 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming)
|
||||
lBestErr = 99999999;
|
||||
sNBest = 0;
|
||||
sMBest = 0;
|
||||
lRatio = (unsigned long)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000]
|
||||
lRatio = (FxU32)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000]
|
||||
for ( sN= (NMID-NDELTA); sN <= (NMID+NDELTA); sN++ ) {
|
||||
sM = (unsigned short)((lRatio * sN + 500) / 1000l);
|
||||
if (sM > MMAX) sM = MMAX;
|
||||
|
||||
lActual = (unsigned long)((FI * sM) / (sN * lPDiv));
|
||||
lActual = (FxU32)((FI * sM) / (sN * lPDiv));
|
||||
lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual);
|
||||
if ( lError < lBestErr ) {
|
||||
sNBest = sN;
|
||||
@@ -110,7 +109,7 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming)
|
||||
sM++;
|
||||
if (sM > MMAX) sM = MMAX;
|
||||
|
||||
lActual = (unsigned long)((FI * sM) / (sN * lPDiv));
|
||||
lActual = (FxU32)((FI * sM) / (sN * lPDiv));
|
||||
lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual);
|
||||
if ( lError < lBestErr) {
|
||||
sNBest = sN;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _CANOPUS_H_
|
||||
@@ -25,8 +24,7 @@
|
||||
|
||||
// if we use FFLOAT as an integer, we need to handle clocks in Hz
|
||||
#define CLOCK_MULTIPLIER 1000000L
|
||||
typedef unsigned long FFLOAT;
|
||||
typedef unsigned long DDOUBLE;
|
||||
typedef FxU32 FFLOAT;
|
||||
|
||||
/* FixMe!! Is this right? */
|
||||
#define CANOPUS_ID 0x10UL
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Initialization code for initializing supported SST-1 DACs
|
||||
**
|
||||
*/
|
||||
@@ -560,7 +559,7 @@ sst1InitComputeClkParams(float freq, sst1ClkTimingStruct* clkTiming)
|
||||
return sst1InitComputeClkParamsTI(freq, clkTiming);
|
||||
} else if (sst1CurrentBoard->fbiVideoDacType == SST_FBI_DACTYPE_PROXY) {
|
||||
FxU32 i;
|
||||
FxBool retval;
|
||||
FxBool retval = FXTRUE;
|
||||
sst1DeviceInfoStruct *saveBoard;
|
||||
|
||||
/* if we are a single board SLI (proxy dac) we need to do all changes
|
||||
@@ -589,7 +588,7 @@ sst1InitComputeClkParams(float freq, sst1ClkTimingStruct* clkTiming)
|
||||
FxBool sst1InitComputeClkParamsATT(float freq, sst1ClkTimingStruct
|
||||
*clkTiming)
|
||||
{
|
||||
float vcoFreqDivide, freqMultRatio, clkError;
|
||||
float vcoFreqDivide = 0.0f, freqMultRatio, clkError;
|
||||
float clkErrorMin;
|
||||
FxU32 p, n, m, nPlusTwo;
|
||||
int mPlusTwo;
|
||||
@@ -623,7 +622,7 @@ FxBool sst1InitComputeClkParamsATT(float freq, sst1ClkTimingStruct
|
||||
freqMultRatio = (freq * vcoFreqDivide) * (float) 0.06984216;
|
||||
|
||||
/* Calculate proper N and M parameters which yield the lowest error */
|
||||
clkErrorMin = (float) 9999.; n = 0;
|
||||
clkErrorMin = (float) 9999.; n = 0; m = 0;
|
||||
for(nPlusTwo = 3; nPlusTwo < 32; nPlusTwo++) {
|
||||
#ifdef DIRECTX
|
||||
mPlusTwo = FTOL( (((float) nPlusTwo * freqMultRatio) + (float) 0.5) );
|
||||
@@ -694,7 +693,7 @@ FxBool sst1InitComputeClkParamsTI(float freq, sst1ClkTimingStruct
|
||||
|
||||
/* Loop through all the possible combinations and find the frequency
|
||||
with the least error */
|
||||
clkErrorMin = (float) 9999.; nBest = 9999;
|
||||
clkErrorMin = (float) 9999.; pBest = 9999; nBest = 9999; mBest = 9999;
|
||||
for(p=0; p<4; p++) {
|
||||
for(m=0; m<64; m++) {
|
||||
for(n=0; n<5; n++) {
|
||||
|
||||
@@ -41,14 +41,14 @@ static FxBool FindHole(RangeStruct *conflict);
|
||||
static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict);
|
||||
static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict);
|
||||
static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict);
|
||||
static FxU32 pciGetType(long i);
|
||||
static FxU32 pciGetType(int i);
|
||||
static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data);
|
||||
static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data);
|
||||
|
||||
static void ForceCleanUp(void);
|
||||
static FxBool FindNecessaryCards(void);
|
||||
static FxBool IsCardVoodoo(long i);
|
||||
static FxBool IsCardS3(long i);
|
||||
static FxBool IsCardVoodoo(int i);
|
||||
static FxBool IsCardS3(int i);
|
||||
static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card);
|
||||
#if 0 /* not used */
|
||||
static void HandleMemoryOverlap(void);
|
||||
@@ -63,7 +63,7 @@ static RangeStruct hole[80];
|
||||
#endif
|
||||
static RangeStruct *first_entry;
|
||||
static RangeStruct *last_entry;
|
||||
static long entries=0;
|
||||
static int entries=0;
|
||||
static RangeStruct master_hole;
|
||||
static FxU32 conflicts_found=0;
|
||||
|
||||
@@ -142,7 +142,7 @@ static void GetMemoryMap(void)
|
||||
{
|
||||
FxU32 temp,temp2;
|
||||
FxU32 type;
|
||||
long devNum;
|
||||
int devNum;
|
||||
int fn; /* function number iterator */
|
||||
int maxFnNumber;
|
||||
int multi_fn = 0;
|
||||
@@ -277,12 +277,12 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB
|
||||
RangeStruct *temp,*cur,*next;
|
||||
|
||||
//jcochrane@3dfx.com
|
||||
long entry=0;
|
||||
int entry=0;
|
||||
FxU32 tmp_address=0;
|
||||
//END
|
||||
|
||||
#if 0
|
||||
static long test_entry=0;
|
||||
static int test_entry=0;
|
||||
|
||||
address=test_data[test_entry].address;
|
||||
range=~(test_data[test_entry++].range - 0x1);
|
||||
@@ -563,7 +563,7 @@ static void ForceCleanUp(void)
|
||||
static FxBool FindNecessaryCards(void)
|
||||
{
|
||||
FxBool voodoo_found=FXFALSE;
|
||||
long i;
|
||||
int i;
|
||||
|
||||
for (i=0;i<MAX_PCI_DEVICES;i++)
|
||||
{
|
||||
@@ -581,7 +581,7 @@ static FxBool FindNecessaryCards(void)
|
||||
return FXTRUE;
|
||||
}
|
||||
|
||||
static FxU32 pciGetType(long i)
|
||||
static FxU32 pciGetType(int i)
|
||||
{
|
||||
FxU32 header_type;
|
||||
|
||||
@@ -590,7 +590,7 @@ static FxU32 pciGetType(long i)
|
||||
return header_type;
|
||||
}
|
||||
|
||||
static FxBool IsCardVoodoo(long i)
|
||||
static FxBool IsCardVoodoo(int i)
|
||||
{
|
||||
FxU32 vendor,dev_id;
|
||||
FxU32 fn_num = (i >> 13) & 0x7;
|
||||
@@ -621,7 +621,7 @@ static FxBool IsCardVoodoo(long i)
|
||||
return FXFALSE;
|
||||
}
|
||||
|
||||
static FxBool IsCardS3(long i)
|
||||
static FxBool IsCardS3(int i)
|
||||
{
|
||||
FxU32 vendor,dev_id;
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Initialization code for loading SST-1 gamma tables
|
||||
**
|
||||
*/
|
||||
|
||||
@@ -65,7 +65,7 @@ EngDebugPrint(
|
||||
static char *gdbg_myname = "gd"; // default library name
|
||||
static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls
|
||||
|
||||
static long gdbg_errors = 0;
|
||||
static int gdbg_errors = 0;
|
||||
|
||||
|
||||
#ifdef KERNEL
|
||||
@@ -102,7 +102,7 @@ static FILE *gdbg_msgfile = NULL; /* stdout; */ // GDBG info/error file
|
||||
//----------------------------------------------------------------------
|
||||
static const char *setRange(const char *buf, int val)
|
||||
{
|
||||
int r0,r1,pos;
|
||||
int r0,r1,pos=0;
|
||||
|
||||
sscanf(buf,"%i%n",&r0,&pos); // parse the first integer
|
||||
if (buf[pos]=='-' || buf[pos]==':') { // if there's a second
|
||||
@@ -159,7 +159,6 @@ gdbg_init(void)
|
||||
* I do it now */
|
||||
gdbg_msgfile = stdout;
|
||||
|
||||
|
||||
#if __MWERKS__
|
||||
SIOUXSettings.standalone = false;
|
||||
SIOUXSettings.setupmenus = false;
|
||||
@@ -358,7 +357,7 @@ gdbg_info_more (const int level, const char *format, ...)
|
||||
#endif /* #ifndef KERNEL */
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
static GDBGErrorProc errorProcList[3];
|
||||
|
||||
FX_EXPORT int FX_CSTYLE gdbg_error_set_callback(GDBGErrorProc p)
|
||||
@@ -479,9 +478,10 @@ gdbg_set_file(const char *name)
|
||||
{
|
||||
outf = fopen(name,"w"); // open up a new one
|
||||
if (outf) gdbg_msgfile = outf;
|
||||
return (outf != NULL);
|
||||
}
|
||||
|
||||
return (outf != NULL);
|
||||
return 1;
|
||||
#else /* #ifndef KERNEL */
|
||||
return 0;
|
||||
#endif /* #ifndef KERNEL */
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Routines to detect memory size, strapping pin, and other initialization
|
||||
** configuration information.
|
||||
**
|
||||
@@ -44,10 +43,10 @@
|
||||
|
||||
static FxBool
|
||||
readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
|
||||
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
|
||||
{
|
||||
FxU32 rd_x, rd_y;
|
||||
FxU32 rd_col;
|
||||
FxU32 rd_col = 0;
|
||||
FxU32 rd_r, rd_g, rd_b;
|
||||
SstRegs *sst = (SstRegs *) sstbase;
|
||||
|
||||
@@ -83,7 +82,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
}
|
||||
INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n",
|
||||
*r_sum, *g_sum, *b_sum));
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* xxx - Give these guys some meaningful comments */
|
||||
@@ -154,7 +153,7 @@ initSumTables(FxU32 *sstbase)
|
||||
}
|
||||
g_tbl[g_sum] = tst_color;
|
||||
}
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* remove dither to derive actual 24-bit RGB value */
|
||||
@@ -167,7 +166,7 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result)
|
||||
return(FXFALSE);
|
||||
}
|
||||
*result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum];
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
static FxBool
|
||||
@@ -176,7 +175,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
int x=0, y=0;
|
||||
FxU32 r_sum, g_sum, b_sum;
|
||||
SstRegs *sst = (SstRegs *) sstbase;
|
||||
FxU32 tmuRevision;
|
||||
FxU32 tmuRevision;
|
||||
|
||||
/* set trex's (all 3) to output configuration bits */
|
||||
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
||||
@@ -192,12 +191,12 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
drawTriangle(sst,x,y,36);
|
||||
|
||||
readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum);
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuConfig = 0x0;
|
||||
} else {
|
||||
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuConfig = 0x0;
|
||||
} else {
|
||||
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
// Get new revision...
|
||||
@@ -216,16 +215,16 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
drawTriangle(sst,x,y,36);
|
||||
|
||||
readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum);
|
||||
if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
|
||||
info->tmuFab[0] = (tmuRevision >> 4) & 0xf;
|
||||
info->tmuFab[1] = (tmuRevision >> 12) & 0xf;
|
||||
info->tmuFab[2] = (tmuRevision >> 20) & 0xf;
|
||||
info->tmuFab[0] = (tmuRevision >> 4) & 0xf;
|
||||
info->tmuFab[1] = (tmuRevision >> 12) & 0xf;
|
||||
info->tmuFab[2] = (tmuRevision >> 20) & 0xf;
|
||||
|
||||
/* Adjust configuration structure for "new" revision ID */
|
||||
info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14));
|
||||
info->tmuConfig |= (((tmuRevision & 0x7) + 3) |
|
||||
/* Adjust configuration structure for "new" revision ID */
|
||||
info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14));
|
||||
info->tmuConfig |= (((tmuRevision & 0x7) + 3) |
|
||||
((((tmuRevision >> 8) & 0x7) + 3) << 7) |
|
||||
((((tmuRevision >> 16) & 0x7) + 3) << 14));
|
||||
|
||||
@@ -234,10 +233,10 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]);
|
||||
ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]);
|
||||
|
||||
if(GETENV(("SSTV2_TMUCFG")))
|
||||
SSCANF(GETENV(("SSTV2_TMUCFG")), "%ld", &info->tmuConfig);
|
||||
if(GETENV(("SSTV2_TMUCFG")))
|
||||
SSCANF(GETENV(("SSTV2_TMUCFG")), "%ld", &info->tmuConfig);
|
||||
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
#define SENSE2 0x92F56EB0
|
||||
@@ -287,19 +286,19 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
||||
|
||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
// If user specifies 2 MBytes on a 4 MBytes board, disable the
|
||||
// second RAS so that apps which may incorrectly store data in the
|
||||
// upper 2 Mbytes will not function properly...
|
||||
if(*TmuMemorySize == 2) {
|
||||
info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
|
||||
sst1InitIdle(sstbase);
|
||||
ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]);
|
||||
sst1InitIdle(sstbase);
|
||||
}
|
||||
return(FXTRUE);
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
|
||||
* second RAS so that apps which may incorrectly store data in the
|
||||
* upper 2 Mbytes will not function properly... */
|
||||
if (*TmuMemorySize == 2) {
|
||||
info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
|
||||
sst1InitIdle(sstbase);
|
||||
ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]);
|
||||
sst1InitIdle(sstbase);
|
||||
}
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER);
|
||||
ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK);
|
||||
@@ -330,7 +329,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
||||
if (data == SENSE0) {*TmuMemorySize = 1; return(FXTRUE);}
|
||||
|
||||
INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n"));
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@@ -344,50 +343,49 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
FxU32 trev;
|
||||
|
||||
if(initSumTables(sstbase) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
if(getTmuConfigData(sstbase,info) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
|
||||
info->numberTmus = 1;
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuRevision = 4;
|
||||
sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]);
|
||||
info->tmuMemSize[0] = 2;
|
||||
} else {
|
||||
/* Get TMU memory size */
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) ==
|
||||
FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuRevision = 4;
|
||||
sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]);
|
||||
info->tmuMemSize[0] = 2;
|
||||
} else {
|
||||
/* Get TMU memory size */
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
|
||||
INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0]));
|
||||
if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */
|
||||
info->numberTmus++; /* increment TMU count */
|
||||
trev = (info->tmuConfig>>7) & 0x7; /* get its revision */
|
||||
#if 0 // Ignore for now...
|
||||
#if 0 /* Ignore for now... */
|
||||
if (info->tmuRevision != trev) {
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
#endif
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
if (sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */
|
||||
info->numberTmus++; /* increment TMU count */
|
||||
trev = (info->tmuConfig>>14) & 0x7; /* get its revision */
|
||||
#if 0 // Ignore for now...
|
||||
#if 0 /* Ignore for now... */
|
||||
if (info->tmuRevision != trev) {
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
#endif
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(GETENV(("SSTV2_NUM_TMUS")))
|
||||
info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
|
||||
if (GETENV(("SSTV2_NUM_TMUS")))
|
||||
info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
|
||||
|
||||
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
||||
return(FXTRUE);
|
||||
@@ -420,7 +418,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||
/* for rendering */
|
||||
ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
/* Setup Basic rendering datapath */
|
||||
@@ -429,7 +427,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK | SST_DRAWBUFFER_FRONT);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER |
|
||||
@@ -447,7 +445,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(128, 100) == 0xdead) &&
|
||||
(LFB_GETPIXEL(200, 200) == 0x55aa)) {
|
||||
retval = 4;
|
||||
retval = 4;
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
goto fbiMemSizeDone;
|
||||
@@ -455,7 +453,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
|
||||
/* Check for 2 MBytes... */
|
||||
/* Write to color buffer in 640x480 resolution */
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
|
||||
SST_LFB_READFRONTBUFFER);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
@@ -474,7 +472,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if(LFB_GETPIXEL(178, 436) == 0xaa55) {
|
||||
retval = 2;
|
||||
retval = 2;
|
||||
goto fbiMemSizeDone;
|
||||
}
|
||||
|
||||
@@ -491,7 +489,7 @@ check1MByte:
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(10, 10) == 0xdead) &&
|
||||
(LFB_GETPIXEL(100, 200) == 0x5a5a))
|
||||
retval = 1;
|
||||
retval = 1;
|
||||
|
||||
fbiMemSizeDone:
|
||||
/* Restore init registers to original state */
|
||||
@@ -508,13 +506,13 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
{
|
||||
SstRegs *sst = (SstRegs *) sstbase;
|
||||
|
||||
info->fbiMemSize = fbiMemSize(sstbase);
|
||||
info->fbiMemSize = fbiMemSize(sstbase);
|
||||
|
||||
/* Detect board identification and memory speed */
|
||||
if(GETENV(("SSTV2_FBICFG")))
|
||||
SSCANF(GETENV(("SSTV2_FBICFG")), "%ld", &info->fbiConfig);
|
||||
else
|
||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||
SSCANF(GETENV(("SSTV2_FBICFG")), "%ld", &info->fbiConfig);
|
||||
else
|
||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||
SST_FBI_MEM_TYPE_SHIFT;
|
||||
|
||||
info->fbiBoardID = (IGET(sst->fbiInit5) >> 5) & 0xf;
|
||||
@@ -523,9 +521,9 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
|
||||
/* Detect scanline interleaving */
|
||||
info->sliPaired = sst1InitSliPaired(sstbase);
|
||||
info->sliDetected = sst1InitSliDetect(sstbase);
|
||||
info->sliDetected = sst1InitSliDetect(sstbase);
|
||||
|
||||
return FXTRUE;
|
||||
return FXTRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -535,8 +533,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
** been allocated
|
||||
**
|
||||
*/
|
||||
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase,
|
||||
sst1DeviceInfoStruct *info)
|
||||
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
{
|
||||
FxBool retval;
|
||||
|
||||
@@ -562,90 +559,92 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
|
||||
if(GETENV(("SSTV2_NODEVICEINFO"))) {
|
||||
/* fill device info struct with sane values... */
|
||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||
|
||||
if(GETENV(("SSTV2_FBICFG")))
|
||||
SSCANF(GETENV(("SSTV2_FBICFG")), "%ld", &info->fbiConfig);
|
||||
else
|
||||
info->fbiConfig = 0x0;
|
||||
if(GETENV(("SSTV2_FBICFG")))
|
||||
SSCANF(GETENV(("SSTV2_FBICFG")), "%ld", &info->fbiConfig);
|
||||
else
|
||||
info->fbiConfig = 0x0;
|
||||
|
||||
if(GETENV(("SSTV2_TMUCFG")))
|
||||
SSCANF(GETENV(("SSTV2_TMUCFG")), "%ld", &info->tmuConfig);
|
||||
else
|
||||
info->tmuConfig = 0x0;
|
||||
if(GETENV(("SSTV2_TMUCFG")))
|
||||
SSCANF(GETENV(("SSTV2_TMUCFG")), "%ld", &info->tmuConfig);
|
||||
else
|
||||
info->tmuConfig = 0x0;
|
||||
|
||||
info->numberTmus = 1;
|
||||
if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */
|
||||
info->numberTmus++;
|
||||
if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */
|
||||
info->numberTmus++;
|
||||
info->numberTmus = 1;
|
||||
if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */
|
||||
info->numberTmus++;
|
||||
if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */
|
||||
info->numberTmus++;
|
||||
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
|
||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
||||
info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
|
||||
else
|
||||
info->fbiMemSize = 2;
|
||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
||||
info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
|
||||
else
|
||||
info->fbiMemSize = 2;
|
||||
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE")))
|
||||
info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
else
|
||||
info->tmuMemSize[0] = 2;
|
||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||
info->tmuMemSize[2] = info->tmuMemSize[0];
|
||||
} else {
|
||||
int i;
|
||||
|
||||
for(i=0; i<5; i++) {
|
||||
if(i)
|
||||
INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i));
|
||||
/* GetFbiInfo() must be called before GetTmuInfo() */
|
||||
if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
/* get the revision ID of each TMU and verify that they are all the
|
||||
same */
|
||||
if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if(i == 5)
|
||||
return(FXFALSE);
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE")))
|
||||
info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
else
|
||||
info->tmuMemSize[0] = 2;
|
||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||
info->tmuMemSize[2] = info->tmuMemSize[0];
|
||||
}
|
||||
// Measure silicon performance
|
||||
sst1InitMeasureSiProcess(sstbase, 0); // measure NAND-tree
|
||||
sst1InitMeasureSiProcess(sstbase, 1); // measure NOR-tree
|
||||
else {
|
||||
int i;
|
||||
|
||||
INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
|
||||
for (i=0; i<5; i++) {
|
||||
if (i)
|
||||
INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i));
|
||||
/* GetFbiInfo() must be called before GetTmuInfo() */
|
||||
if (sst1InitGetFbiInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
/* get the revision ID of each TMU and verify that they are all the
|
||||
same */
|
||||
if (sst1InitGetTmuInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if (i == 5)
|
||||
return(FXFALSE);
|
||||
}
|
||||
/* Measure silicon performance */
|
||||
sst1InitMeasureSiProcess(sstbase, 0); /* measure NAND-tree */
|
||||
sst1InitMeasureSiProcess(sstbase, 1); /* measure NOR-tree */
|
||||
|
||||
INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
|
||||
INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n",
|
||||
info->fbiConfig, info->tmuConfig));
|
||||
info->fbiConfig, info->tmuConfig));
|
||||
INIT_PRINTF(("sst1DeviceInfo: FBI Revision:%d, TMU Revison:%d, Num TMUs:%d\n",
|
||||
info->fbiRevision, info->tmuRevision, info->numberTmus));
|
||||
info->fbiRevision, info->tmuRevision, info->numberTmus));
|
||||
INIT_PRINTF(("sst1DeviceInfo: FBI Memory:%d, TMU[0] Memory:%d",
|
||||
info->fbiMemSize, info->tmuMemSize[0]));
|
||||
if(info->numberTmus > 1)
|
||||
info->fbiMemSize, info->tmuMemSize[0]));
|
||||
if (info->numberTmus > 1)
|
||||
INIT_PRINTF((", TMU[1] Memory:%d", info->tmuMemSize[1]));
|
||||
if(info->numberTmus > 2)
|
||||
if (info->numberTmus > 2)
|
||||
INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2]));
|
||||
INIT_PRINTF(("\n"));
|
||||
if(sst1InitUseVoodooFile == FXTRUE) {
|
||||
if(iniDac == (sst1InitDacStruct *) NULL)
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
|
||||
else
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
|
||||
if (sst1InitUseVoodooFile == FXTRUE) {
|
||||
if(iniDac == NULL)
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
|
||||
else
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
|
||||
iniDac->dacManufacturer, iniDac->dacDevice));
|
||||
} else {
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
|
||||
if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
|
||||
INIT_PRINTF(("AT&T ATT20C409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS)
|
||||
INIT_PRINTF(("ICS ICS5342\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI)
|
||||
INIT_PRINTF(("TI TVP3409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY)
|
||||
INIT_PRINTF(("(SLI PROXY)\n"));
|
||||
else
|
||||
INIT_PRINTF(("Unknown\n"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
|
||||
if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
|
||||
INIT_PRINTF(("AT&T ATT20C409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS)
|
||||
INIT_PRINTF(("ICS ICS5342\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI)
|
||||
INIT_PRINTF(("TI TVP3409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY)
|
||||
INIT_PRINTF(("(SLI PROXY)\n"));
|
||||
else
|
||||
INIT_PRINTF(("Unknown\n"));
|
||||
}
|
||||
INIT_PRINTF(("sst1DeviceInfo: SLI Detected:%d\n", info->sliDetected));
|
||||
|
||||
return(FXTRUE);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Parsing code for grabbing information from "voodoo2.ini" initialization file
|
||||
**
|
||||
*/
|
||||
@@ -78,7 +77,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile()
|
||||
|
||||
#ifndef DIRECTX
|
||||
int inCfg, inDac;
|
||||
FILE *file = (FILE *) NULL;
|
||||
FILE *file = NULL;
|
||||
char buffer[1024], filename[256];
|
||||
int helper = (getenv(("SSTV2_DEBUGDAC"))) ? 1 : 0;
|
||||
|
||||
@@ -228,7 +227,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile()
|
||||
|
||||
inCfg = inDac = 0;
|
||||
while(sst1InitFgets(buffer, file)) {
|
||||
buffer[strlen(buffer)-1] = (char) NULL;
|
||||
buffer[strlen(buffer)-1] = 0;
|
||||
if(!strcmp(buffer, "[VOODOO2]")) {
|
||||
inCfg = 1; inDac = 0;
|
||||
continue;
|
||||
@@ -359,7 +358,7 @@ static void foo(int argc, char **argv)
|
||||
|
||||
inCfg = inDac = 0;
|
||||
while(sst1InitFgets(buffer, file)) {
|
||||
buffer[strlen(buffer)-1] = (char) NULL;
|
||||
buffer[strlen(buffer)-1] = 0;
|
||||
if(!strcmp(buffer, "[CFG]")) {
|
||||
inCfg = 1; inDac = 0;
|
||||
continue;
|
||||
@@ -435,7 +434,7 @@ static void sst1InitFixFilename(char *dst, char *src)
|
||||
*dst++ = *src;
|
||||
src++;
|
||||
}
|
||||
*dst = (char) NULL;
|
||||
*dst = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -449,7 +448,7 @@ static int sst1InitFgets(char *string, FILE *stream)
|
||||
*ptr++ = (char) charRead;
|
||||
validChars++;
|
||||
if(charRead == '\n') {
|
||||
*ptr++ = (char) NULL;
|
||||
*ptr++ = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -508,7 +507,7 @@ static int sst1InitParseFieldCfg(char *string)
|
||||
|
||||
if((envName = strtok(string, "=")) == NULL)
|
||||
return(0);
|
||||
if((envVal = strtok((char *) NULL, "=")) == NULL)
|
||||
if((envVal = strtok(NULL, "=")) == NULL)
|
||||
/* Valid environment variable, NULL value */
|
||||
return(1);
|
||||
|
||||
@@ -516,25 +515,23 @@ static int sst1InitParseFieldCfg(char *string)
|
||||
sst1InitToLower(envName);
|
||||
sst1InitToLower(envVal);
|
||||
|
||||
if(envVarsBase == (sst1InitEnvVarStruct *) NULL) {
|
||||
if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) ==
|
||||
(sst1InitEnvVarStruct *) NULL)
|
||||
if(envVarsBase == NULL) {
|
||||
if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == NULL)
|
||||
return(0);
|
||||
envVarsBase = envVarsPtr;
|
||||
} else {
|
||||
envVarsPtr = envVarsBase;
|
||||
while(1) {
|
||||
if(envVarsPtr->nextVar == (sst1InitEnvVarStruct *) NULL)
|
||||
if(envVarsPtr->nextVar == NULL)
|
||||
break;
|
||||
else
|
||||
envVarsPtr = envVarsPtr->nextVar;
|
||||
}
|
||||
if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) ==
|
||||
(sst1InitEnvVarStruct *) NULL)
|
||||
if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == NULL)
|
||||
return(0);
|
||||
envVarsPtr = envVarsPtr->nextVar;
|
||||
}
|
||||
envVarsPtr->nextVar = (sst1InitEnvVarStruct *) NULL;
|
||||
envVarsPtr->nextVar = NULL;
|
||||
strcpy(envVarsPtr->envVariable, envName);
|
||||
strcpy(envVarsPtr->envValue, envVal);
|
||||
|
||||
@@ -544,64 +541,62 @@ static int sst1InitParseFieldCfg(char *string)
|
||||
static int sst1InitParseFieldDac(char *string)
|
||||
{
|
||||
char *dacFieldReference, *dacFieldValue;
|
||||
static sst1InitDacStruct *dacPtr = (sst1InitDacStruct *) NULL;
|
||||
static sst1InitDacStruct *dacPtr = NULL;
|
||||
|
||||
if((dacFieldReference = strtok(string, "=")) == NULL)
|
||||
return(0);
|
||||
if(!strcmp(dacFieldReference, "MANUFACTURER")) {
|
||||
/* Add new dac device */
|
||||
if(dacStructBase == (sst1InitDacStruct *) NULL) {
|
||||
if((dacPtr = malloc(sizeof(sst1InitDacStruct))) ==
|
||||
(sst1InitDacStruct *) NULL)
|
||||
if(dacStructBase == NULL) {
|
||||
if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == NULL)
|
||||
return(0);
|
||||
dacStructBase = dacPtr;
|
||||
} else {
|
||||
dacPtr = dacStructBase;
|
||||
while(1) {
|
||||
if(dacPtr->nextDac == (sst1InitDacStruct *) NULL)
|
||||
if(dacPtr->nextDac == NULL)
|
||||
break;
|
||||
else
|
||||
dacPtr = dacPtr->nextDac;
|
||||
}
|
||||
if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) ==
|
||||
(sst1InitDacStruct *) NULL)
|
||||
if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == NULL)
|
||||
return(0);
|
||||
dacPtr = dacPtr->nextDac;
|
||||
}
|
||||
dacPtr->nextDac = (sst1InitDacStruct *) NULL;
|
||||
dacPtr->dacManufacturer[0] = (char) NULL;
|
||||
dacPtr->dacDevice[0] = (char) NULL;
|
||||
dacPtr->detect = (sst1InitDacRdWrStruct *) NULL;
|
||||
dacPtr->setVideo = (sst1InitDacSetVideoStruct *) NULL;
|
||||
dacPtr->setMemClk = (sst1InitDacSetMemClkStruct *) NULL;
|
||||
dacPtr->setVideoMode = (sst1InitDacSetVideoModeStruct *) NULL;
|
||||
dacPtr->nextDac = NULL;
|
||||
dacPtr->dacManufacturer[0] = 0;
|
||||
dacPtr->dacDevice[0] = 0;
|
||||
dacPtr->detect = NULL;
|
||||
dacPtr->setVideo = NULL;
|
||||
dacPtr->setMemClk = NULL;
|
||||
dacPtr->setVideoMode = NULL;
|
||||
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
|
||||
return(0);
|
||||
strcpy(dacPtr->dacManufacturer, dacFieldValue);
|
||||
} else if(!strcmp(dacFieldReference, "DEVICE")) {
|
||||
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
|
||||
if((dacFieldValue = strtok(NULL, "=")) == NULL)
|
||||
return(0);
|
||||
strcpy(dacPtr->dacDevice, dacFieldValue);
|
||||
} else if(!strcmp(dacFieldReference, "DETECT")) {
|
||||
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
|
||||
if((dacFieldValue = strtok(NULL, "=")) == NULL)
|
||||
return(0);
|
||||
sst1InitToLower(dacFieldValue);
|
||||
if(!sst1InitParseDacRdWrString(dacFieldValue, dacPtr))
|
||||
return(0);
|
||||
} else if(!strcmp(dacFieldReference, "SETVIDEO")) {
|
||||
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
|
||||
if((dacFieldValue = strtok(NULL, "=")) == NULL)
|
||||
return(0);
|
||||
sst1InitToLower(dacFieldValue);
|
||||
if(!sst1InitParseSetVideoString(dacFieldValue, dacPtr))
|
||||
return(0);
|
||||
} else if(!strcmp(dacFieldReference, "SETMEMCLK")) {
|
||||
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
|
||||
if((dacFieldValue = strtok(NULL, "=")) == NULL)
|
||||
return(0);
|
||||
sst1InitToLower(dacFieldValue);
|
||||
if(!sst1InitParseSetMemClkString(dacFieldValue, dacPtr))
|
||||
return(0);
|
||||
} else if(!strcmp(dacFieldReference, "SETVIDEOMODE")) {
|
||||
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
|
||||
if((dacFieldValue = strtok(NULL, "=")) == NULL)
|
||||
return(0);
|
||||
sst1InitToLower(dacFieldValue);
|
||||
if(!sst1InitParseSetVideoModeString(dacFieldValue, dacPtr))
|
||||
@@ -641,7 +636,7 @@ static int sst1InitParseDacRdWrString(char *string, sst1InitDacStruct *dacBase)
|
||||
|
||||
dacRdWrPtr = dacRdWrPtr->nextRdWr;
|
||||
}
|
||||
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
|
||||
dacRdWrPtr->nextRdWr = NULL;
|
||||
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
|
||||
return(0);
|
||||
cntr++;
|
||||
@@ -657,16 +652,16 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
|
||||
strcpy(stringCpy, string);
|
||||
|
||||
if(stringCpy[5] == '(') {
|
||||
stringCpy[5] = (char) NULL;
|
||||
stringCpy[5] = 0;
|
||||
addrDataCmd = &stringCpy[6];
|
||||
} else if(stringCpy[7] == '(') {
|
||||
stringCpy[7] = (char) NULL;
|
||||
stringCpy[7] = 0;
|
||||
addrDataCmd = &stringCpy[8];
|
||||
} else if(stringCpy[8] == '(') {
|
||||
stringCpy[8] = (char) NULL;
|
||||
stringCpy[8] = 0;
|
||||
addrDataCmd = &stringCpy[9];
|
||||
} else if(stringCpy[9] == '(') {
|
||||
stringCpy[9] = (char) NULL;
|
||||
stringCpy[9] = 0;
|
||||
addrDataCmd = &stringCpy[10];
|
||||
} else
|
||||
return(0);
|
||||
@@ -678,7 +673,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
|
||||
return(0);
|
||||
if(data[strlen(data)-1] != ')')
|
||||
return(0);
|
||||
data[strlen(data)-1] = (char) NULL;
|
||||
data[strlen(data)-1] = '\0';
|
||||
dacRdWrPtr->type = DACRDWR_TYPE_WR;
|
||||
SSCANF(addr, "%i", &dacRdWrPtr->addr);
|
||||
SSCANF(data, "%i", &dacRdWrPtr->data);
|
||||
@@ -691,7 +686,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
|
||||
return(0);
|
||||
if(data[strlen(data)-1] != ')')
|
||||
return(0);
|
||||
data[strlen(data)-1] = (char) NULL;
|
||||
data[strlen(data)-1] = 0;
|
||||
dacRdWrPtr->type = DACRDWR_TYPE_WRMOD_POP;
|
||||
SSCANF(addr, "%i", &dacRdWrPtr->addr);
|
||||
SSCANF(mask, "%i", &dacRdWrPtr->mask);
|
||||
@@ -705,7 +700,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
|
||||
return(0);
|
||||
if(data[strlen(data)-1] != ')')
|
||||
return(0);
|
||||
data[strlen(data)-1] = (char) NULL;
|
||||
data[strlen(data)-1] = 0;
|
||||
dacRdWrPtr->type = DACRDWR_TYPE_RDMODWR;
|
||||
SSCANF(addr, "%i", &dacRdWrPtr->addr);
|
||||
SSCANF(mask, "%i", &dacRdWrPtr->mask);
|
||||
@@ -722,7 +717,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
|
||||
return(0);
|
||||
if(data[strlen(data)-1] != ')')
|
||||
return(0);
|
||||
data[strlen(data)-1] = (char) NULL;
|
||||
data[strlen(data)-1] = 0;
|
||||
SSCANF(addr, "%i", &dacRdWrPtr->addr);
|
||||
SSCANF(data, "%i", &dacRdWrPtr->data);
|
||||
}
|
||||
@@ -799,7 +794,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase)
|
||||
return(0);
|
||||
dacSetVideoPtr = dacSetVideoPtr->nextSetVideo;
|
||||
}
|
||||
dacSetVideoPtr->nextSetVideo = (sst1InitDacSetVideoStruct *) NULL;
|
||||
dacSetVideoPtr->nextSetVideo = NULL;
|
||||
/* Width */
|
||||
SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width);
|
||||
/* Height */
|
||||
@@ -833,7 +828,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase)
|
||||
return(0);
|
||||
dacRdWrPtr = dacRdWrPtr->nextRdWr;
|
||||
}
|
||||
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
|
||||
dacRdWrPtr->nextRdWr = NULL;
|
||||
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
|
||||
return(0);
|
||||
cntr++;
|
||||
@@ -873,8 +868,7 @@ static int sst1InitParseSetMemClkString(char *string,
|
||||
return(0);
|
||||
dacSetMemClkPtr = dacSetMemClkPtr->nextSetMemClk;
|
||||
}
|
||||
dacSetMemClkPtr->nextSetMemClk = (sst1InitDacSetMemClkStruct *)
|
||||
NULL;
|
||||
dacSetMemClkPtr->nextSetMemClk = NULL;
|
||||
/* Frequency */
|
||||
SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency);
|
||||
|
||||
@@ -897,7 +891,7 @@ static int sst1InitParseSetMemClkString(char *string,
|
||||
return(0);
|
||||
dacRdWrPtr = dacRdWrPtr->nextRdWr;
|
||||
}
|
||||
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
|
||||
dacRdWrPtr->nextRdWr = NULL;
|
||||
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
|
||||
return(0);
|
||||
cntr++;
|
||||
@@ -937,8 +931,7 @@ static int sst1InitParseSetVideoModeString(char *string,
|
||||
return(0);
|
||||
dacSetVideoModePtr = dacSetVideoModePtr->nextSetVideoMode;
|
||||
}
|
||||
dacSetVideoModePtr->nextSetVideoMode =
|
||||
(sst1InitDacSetVideoModeStruct *) NULL;
|
||||
dacSetVideoModePtr->nextSetVideoMode = NULL;
|
||||
/* video16BPP */
|
||||
SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP);
|
||||
|
||||
@@ -961,7 +954,7 @@ static int sst1InitParseSetVideoModeString(char *string,
|
||||
return(0);
|
||||
dacRdWrPtr = dacRdWrPtr->nextRdWr;
|
||||
}
|
||||
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
|
||||
dacRdWrPtr->nextRdWr = NULL;
|
||||
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
|
||||
return(0);
|
||||
cntr++;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Print functions for SST-1 Initialization routines
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Initialization code for initializing scanline interleaving
|
||||
**
|
||||
*/
|
||||
|
||||
@@ -196,8 +196,7 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
||||
FxU32 deviceID; // 0x0002 - Look for a Voodoo2 board (0xFFFF - Find any 3Dfx board)
|
||||
FxU32 sizeOfCard = 0x1000000; // 16 MBytes of addr space for SST-1
|
||||
FxU32 *sstbase;
|
||||
FxU32 n;
|
||||
FxU32 j;
|
||||
FxU32 j, n;
|
||||
FxU32 sstv2_noremap = 0;
|
||||
|
||||
if( GETENV( ("SSTV2_DEVICEID") ) )
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Utility routines for SST-1 Initialization code
|
||||
**
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
**
|
||||
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||
**
|
||||
**
|
||||
** Initialization code for initializing SST-1 video unit
|
||||
**
|
||||
*/
|
||||
|
||||
@@ -104,7 +104,6 @@ static LPDIRECTDRAW2 lpDD = NULL;
|
||||
static LPDIRECTDRAW lpDD1 = NULL;
|
||||
|
||||
|
||||
|
||||
FxBool
|
||||
ErrorMessage(HWND hWnd, char *err)
|
||||
{
|
||||
@@ -114,7 +113,6 @@ ErrorMessage(HWND hWnd, char *err)
|
||||
} /* ErrorMessage */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Takes a DirectDraw Surface object (LPDIRECTDRAWSURFACE), looks up its
|
||||
* description (DDSURFACEDESC), and returns a pointer to the surface and its
|
||||
@@ -141,7 +139,6 @@ _dxSurfaceToBufDesc(LPDIRECTDRAWSURFACE lpSurf, InitBufDesc_t *pDesc)
|
||||
} /* _dxSurfaceToBufDesc */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Convert front, back and aux surfaces from DDraw to Glide bufDescriptors.
|
||||
*/
|
||||
@@ -222,7 +219,6 @@ _dxDDrawToGlideDesc(InitBufDesc_t *pDesc)
|
||||
} /* _dxDDrawToGlideDesc */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Allocate (or re-allocate for WM_SIZE) buffers from DDraw.
|
||||
*/
|
||||
@@ -286,7 +282,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
lpClipper = NULL;
|
||||
lpFront = NULL;
|
||||
lpBack = NULL;
|
||||
lpTriple = NULL;
|
||||
lpTriple = NULL;
|
||||
lpAux = NULL;
|
||||
|
||||
if ( !IsFullScreen ) { /* In a window */
|
||||
@@ -355,7 +351,6 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
GDBG_INFO((80, "_dxAS: Aux Buffer allocated!\n"));
|
||||
|
||||
} else {
|
||||
|
||||
/* Full screen - Set Exclusive Mode, change resolution, */
|
||||
GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n"));
|
||||
|
||||
@@ -426,10 +421,10 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
/* for now this is a goddamn baseball bat
|
||||
it can be trimmed down */
|
||||
if ( !IsFullScreen ) { /* this *REALLY* should be called for fullscreen */
|
||||
if( lpClipper) IDirectDrawClipper_Release( lpClipper);
|
||||
if( lpClipper) IDirectDrawClipper_Release ( lpClipper);
|
||||
if( lpAux ) IDirectDrawSurface2_Release( lpAux );
|
||||
if( lpBack ) IDirectDrawSurface2_Release( lpBack );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpFront ) IDirectDrawSurface2_Release( lpFront );
|
||||
|
||||
lpClipper = NULL;
|
||||
@@ -500,10 +495,10 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
return _dxDDrawToGlideDesc(pDesc);
|
||||
FUBAR:
|
||||
/* if you don't free these you can't make another attempt */
|
||||
if( lpClipper) IDirectDrawClipper_Release( lpClipper);
|
||||
if( lpClipper) IDirectDrawClipper_Release ( lpClipper);
|
||||
if( lpAux ) IDirectDrawSurface2_Release( lpAux );
|
||||
if( lpBack ) IDirectDrawSurface2_Release( lpBack );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpFront ) IDirectDrawSurface2_Release( lpFront );
|
||||
lpClipper = NULL;
|
||||
lpFront = NULL;
|
||||
@@ -641,7 +636,6 @@ dxOpen(
|
||||
return ErrorMessage(hWndApp, "failed dxOpen");
|
||||
#endif
|
||||
|
||||
|
||||
GDBG_INFO((80, "_dxAllocSurfaces OK!!!\n"));
|
||||
|
||||
for (i=0; i< NUM_BUFS; i++) {
|
||||
@@ -748,14 +742,14 @@ dxClose(void)
|
||||
if( lpDD ) IDirectDraw2_Release( lpDD );
|
||||
|
||||
if (1 /* !IsFullScreen */) {
|
||||
if( lpDD1 ) IDirectDraw_Release( lpDD1 );
|
||||
lpDD1 = NULL;
|
||||
if( lpDD1 ) IDirectDraw_Release( lpDD1 );
|
||||
lpDD1 = NULL;
|
||||
}
|
||||
|
||||
lpClipper = NULL;
|
||||
lpFront = NULL;
|
||||
lpBack = NULL;
|
||||
lpTriple = NULL;
|
||||
lpTriple = NULL;
|
||||
lpAux = NULL;
|
||||
lpDD = NULL;
|
||||
#endif /* 0 */
|
||||
@@ -873,7 +867,6 @@ dxOpen(
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
#define WAITLOOP {\
|
||||
volatile int waitfoo;\
|
||||
int waitcount;\
|
||||
@@ -998,5 +991,3 @@ dxSwap(FxU32 code)
|
||||
{
|
||||
} /* dxSwap */
|
||||
#endif /* __DOS32__ || (defined(__WIN32__) && !defined(INIT_ACCESS_DDRAW) */
|
||||
|
||||
|
||||
|
||||
@@ -513,7 +513,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGrxClk(FxU32 *sstbase)
|
||||
FxBool sst1InitComputeClkParams(float freq, sst1ClkTimingStruct
|
||||
*clkTiming)
|
||||
{
|
||||
float vcoFreqDivide, freqMultRatio, clkError;
|
||||
float vcoFreqDivide = 0.0f, freqMultRatio, clkError;
|
||||
float clkErrorMin;
|
||||
FxU32 p, n, m, nPlusTwo;
|
||||
int mPlusTwo;
|
||||
@@ -547,7 +547,7 @@ FxBool sst1InitComputeClkParams(float freq, sst1ClkTimingStruct
|
||||
freqMultRatio = (freq * vcoFreqDivide) * (float) 0.06984216;
|
||||
|
||||
/* Calculate proper N and M parameters which yield the lowest error */
|
||||
clkErrorMin = (float) 9999.; n = 0;
|
||||
clkErrorMin = (float) 9999.; n = 0; m = 0;
|
||||
for(nPlusTwo = 3; nPlusTwo < 32; nPlusTwo++) {
|
||||
#ifdef DIRECTX
|
||||
mPlusTwo = FTOL( (((float) nPlusTwo * freqMultRatio) + (float) 0.5) );
|
||||
|
||||
@@ -96,7 +96,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, double gammaR,
|
||||
FxU32 gammaTableR[256];
|
||||
FxU32 gammaTableG[256];
|
||||
FxU32 gammaTableB[256];
|
||||
FxBool sstVideoIsReset;
|
||||
FxBool sstVideoIsReset = FXFALSE;
|
||||
static FxBool calledBefore = FXFALSE;
|
||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||
|
||||
@@ -178,7 +178,7 @@ FxU32 *r, FxU32 *g, FxU32 *b)
|
||||
FxU32 gammaTableR[256];
|
||||
FxU32 gammaTableG[256];
|
||||
FxU32 gammaTableB[256];
|
||||
FxBool sstVideoIsReset;
|
||||
FxBool sstVideoIsReset = FXFALSE;
|
||||
static FxBool calledBefore = FXFALSE;
|
||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
|
||||
{
|
||||
FxU32 rd_x, rd_y;
|
||||
FxU32 rd_col;
|
||||
FxU32 rd_col = 0;
|
||||
FxU32 rd_r, rd_g, rd_b;
|
||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||
|
||||
@@ -76,7 +76,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
}
|
||||
INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n",
|
||||
*r_sum, *g_sum, *b_sum));
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* xxx - Give these guys some meaningful comments */
|
||||
@@ -147,7 +147,7 @@ initSumTables(FxU32 *sstbase)
|
||||
}
|
||||
g_tbl[g_sum] = tst_color;
|
||||
}
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* remove dither to derive actual 24-bit RGB value */
|
||||
@@ -160,7 +160,7 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result)
|
||||
return(FXFALSE);
|
||||
}
|
||||
*result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum];
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
static FxBool
|
||||
@@ -243,10 +243,10 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
||||
|
||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||
|
||||
if(GETENV(("SST_TMUMEM_SIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
||||
return(FXTRUE);
|
||||
}
|
||||
if(GETENV(("SST_TMUMEM_SIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER);
|
||||
ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK);
|
||||
@@ -291,21 +291,21 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
FxU32 trev;
|
||||
|
||||
if(initSumTables(sstbase) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
if(getTmuConfigData(sstbase,info) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
|
||||
/* TMU memory speed */
|
||||
/* tmuClkFixed is no longer used... */
|
||||
info->tmuClkFixed = 0x0;
|
||||
/* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */
|
||||
info->tmuMemSpeed = 0;
|
||||
/* TMU memory speed */
|
||||
/* tmuClkFixed is no longer used... */
|
||||
info->tmuClkFixed = 0x0;
|
||||
/* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */
|
||||
info->tmuMemSpeed = 0;
|
||||
|
||||
/* count the TMUs and verify that all TMUs are the same revision */
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
info->numberTmus = 1;
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0]));
|
||||
if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */
|
||||
info->numberTmus++; /* increment TMU count */
|
||||
@@ -314,7 +314,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */
|
||||
@@ -324,7 +324,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
||||
@@ -358,7 +358,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||
/* for rendering */
|
||||
ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
/* Setup Basic rendering datapath */
|
||||
@@ -370,7 +370,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
if(sst1InitSliDetect(sstbase))
|
||||
/* SLI cannot support 4 MBytes... */
|
||||
goto check2MByte;
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER |
|
||||
@@ -388,7 +388,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(128, 100) == 0xdead) &&
|
||||
(LFB_GETPIXEL(200, 200) == 0x55aa)) {
|
||||
retval = 4;
|
||||
retval = 4;
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
goto fbiMemSizeDone;
|
||||
@@ -397,7 +397,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
check2MByte:
|
||||
/* Check for 2 MBytes... */
|
||||
/* Write to color buffer in 640x480 resolution */
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
|
||||
SST_LFB_READFRONTBUFFER);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
@@ -416,7 +416,7 @@ check2MByte:
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if(LFB_GETPIXEL(178, 436) == 0xaa55) {
|
||||
retval = 2;
|
||||
retval = 2;
|
||||
goto fbiMemSizeDone;
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ check1MByte:
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(10, 10) == 0xdead) &&
|
||||
(LFB_GETPIXEL(100, 200) == 0x5a5a))
|
||||
retval = 1;
|
||||
retval = 1;
|
||||
|
||||
fbiMemSizeDone:
|
||||
/* Restore init registers to original state */
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
static FxBool
|
||||
readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
|
||||
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
|
||||
{
|
||||
FxU32 rd_x, rd_y;
|
||||
FxU32 rd_col = 0;
|
||||
@@ -82,7 +82,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
}
|
||||
INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n",
|
||||
*r_sum, *g_sum, *b_sum));
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* xxx - Give these guys some meaningful comments */
|
||||
@@ -153,7 +153,7 @@ initSumTables(FxU32 *sstbase)
|
||||
}
|
||||
g_tbl[g_sum] = tst_color;
|
||||
}
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* remove dither to derive actual 24-bit RGB value */
|
||||
@@ -166,7 +166,7 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result)
|
||||
return(FXFALSE);
|
||||
}
|
||||
*result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum];
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
static FxBool
|
||||
@@ -175,7 +175,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
int x=0, y=0;
|
||||
FxU32 r_sum, g_sum, b_sum;
|
||||
SstRegs *sst = (SstRegs *) sstbase;
|
||||
FxU32 tmuRevision;
|
||||
FxU32 tmuRevision;
|
||||
|
||||
/* set trex's (all 3) to output configuration bits */
|
||||
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
||||
@@ -191,12 +191,12 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
drawTriangle(sst,x,y,36);
|
||||
|
||||
readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum);
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuConfig = 0x0;
|
||||
} else {
|
||||
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuConfig = 0x0;
|
||||
} else {
|
||||
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
// Get new revision...
|
||||
@@ -215,16 +215,16 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
drawTriangle(sst,x,y,36);
|
||||
|
||||
readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum);
|
||||
if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
|
||||
info->tmuFab[0] = (tmuRevision >> 4) & 0xf;
|
||||
info->tmuFab[1] = (tmuRevision >> 12) & 0xf;
|
||||
info->tmuFab[2] = (tmuRevision >> 20) & 0xf;
|
||||
info->tmuFab[0] = (tmuRevision >> 4) & 0xf;
|
||||
info->tmuFab[1] = (tmuRevision >> 12) & 0xf;
|
||||
info->tmuFab[2] = (tmuRevision >> 20) & 0xf;
|
||||
|
||||
/* Adjust configuration structure for "new" revision ID */
|
||||
info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14));
|
||||
info->tmuConfig |= (((tmuRevision & 0x7) + 3) |
|
||||
/* Adjust configuration structure for "new" revision ID */
|
||||
info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14));
|
||||
info->tmuConfig |= (((tmuRevision & 0x7) + 3) |
|
||||
((((tmuRevision >> 8) & 0x7) + 3) << 7) |
|
||||
((((tmuRevision >> 16) & 0x7) + 3) << 14));
|
||||
|
||||
@@ -233,14 +233,14 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]);
|
||||
ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]);
|
||||
|
||||
if(GETENV(("SSTV2_TMUCFG")))
|
||||
{
|
||||
FxU32 u;
|
||||
if (SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1)
|
||||
info->tmuConfig = u;
|
||||
}
|
||||
if(GETENV(("SSTV2_TMUCFG")))
|
||||
{
|
||||
FxU32 u;
|
||||
if (SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1)
|
||||
info->tmuConfig = u;
|
||||
}
|
||||
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
#define SENSE2 0x92F56EB0
|
||||
@@ -290,19 +290,19 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
||||
|
||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
// If user specifies 2 MBytes on a 4 MBytes board, disable the
|
||||
// second RAS so that apps which may incorrectly store data in the
|
||||
// upper 2 Mbytes will not function properly...
|
||||
if(*TmuMemorySize == 2) {
|
||||
info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
|
||||
sst1InitIdle(sstbase);
|
||||
ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]);
|
||||
sst1InitIdle(sstbase);
|
||||
}
|
||||
return(FXTRUE);
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
|
||||
* second RAS so that apps which may incorrectly store data in the
|
||||
* upper 2 Mbytes will not function properly... */
|
||||
if (*TmuMemorySize == 2) {
|
||||
info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
|
||||
sst1InitIdle(sstbase);
|
||||
ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]);
|
||||
sst1InitIdle(sstbase);
|
||||
}
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER);
|
||||
ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK);
|
||||
@@ -333,7 +333,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
||||
if (data == SENSE0) {*TmuMemorySize = 1; return(FXTRUE);}
|
||||
|
||||
INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n"));
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@@ -347,50 +347,49 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
FxU32 trev;
|
||||
|
||||
if(initSumTables(sstbase) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
if(getTmuConfigData(sstbase,info) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
|
||||
info->numberTmus = 1;
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuRevision = 4;
|
||||
sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]);
|
||||
info->tmuMemSize[0] = 2;
|
||||
} else {
|
||||
/* Get TMU memory size */
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) ==
|
||||
FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
|
||||
info->tmuRevision = 4;
|
||||
sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]);
|
||||
info->tmuMemSize[0] = 2;
|
||||
} else {
|
||||
/* Get TMU memory size */
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
|
||||
INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0]));
|
||||
if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */
|
||||
info->numberTmus++; /* increment TMU count */
|
||||
trev = (info->tmuConfig>>7) & 0x7; /* get its revision */
|
||||
#if 0 // Ignore for now...
|
||||
#if 0 /* Ignore for now... */
|
||||
if (info->tmuRevision != trev) {
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
#endif
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
if (sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */
|
||||
info->numberTmus++; /* increment TMU count */
|
||||
trev = (info->tmuConfig>>14) & 0x7; /* get its revision */
|
||||
#if 0 // Ignore for now...
|
||||
#if 0 /* Ignore for now... */
|
||||
if (info->tmuRevision != trev) {
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
#endif
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(GETENV(("SSTV2_NUM_TMUS")))
|
||||
info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
|
||||
if (GETENV(("SSTV2_NUM_TMUS")))
|
||||
info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
|
||||
|
||||
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
||||
return(FXTRUE);
|
||||
@@ -423,7 +422,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||
/* for rendering */
|
||||
ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
/* Setup Basic rendering datapath */
|
||||
@@ -432,7 +431,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK | SST_DRAWBUFFER_FRONT);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER |
|
||||
@@ -450,7 +449,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(128, 100) == 0xdead) &&
|
||||
(LFB_GETPIXEL(200, 200) == 0x55aa)) {
|
||||
retval = 4;
|
||||
retval = 4;
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
goto fbiMemSizeDone;
|
||||
@@ -458,7 +457,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
|
||||
/* Check for 2 MBytes... */
|
||||
/* Write to color buffer in 640x480 resolution */
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
|
||||
SST_LFB_READFRONTBUFFER);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
@@ -477,7 +476,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if(LFB_GETPIXEL(178, 436) == 0xaa55) {
|
||||
retval = 2;
|
||||
retval = 2;
|
||||
goto fbiMemSizeDone;
|
||||
}
|
||||
|
||||
@@ -494,7 +493,7 @@ check1MByte:
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(10, 10) == 0xdead) &&
|
||||
(LFB_GETPIXEL(100, 200) == 0x5a5a))
|
||||
retval = 1;
|
||||
retval = 1;
|
||||
|
||||
fbiMemSizeDone:
|
||||
/* Restore init registers to original state */
|
||||
@@ -519,7 +518,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
(SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1))
|
||||
info->fbiConfig = u;
|
||||
else
|
||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||
SST_FBI_MEM_TYPE_SHIFT;
|
||||
|
||||
info->fbiBoardID = (IGET(sst->fbiInit5) >> 5) & 0xf;
|
||||
@@ -528,9 +527,9 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
|
||||
/* Detect scanline interleaving */
|
||||
info->sliPaired = sst1InitSliPaired(sstbase);
|
||||
info->sliDetected = sst1InitSliDetect(sstbase);
|
||||
info->sliDetected = sst1InitSliDetect(sstbase);
|
||||
|
||||
return FXTRUE;
|
||||
return FXTRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -540,8 +539,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
** been allocated
|
||||
**
|
||||
*/
|
||||
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase,
|
||||
sst1DeviceInfoStruct *info)
|
||||
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
{
|
||||
FxBool retval;
|
||||
|
||||
@@ -569,92 +567,94 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
|
||||
if(GETENV(("SSTV2_NODEVICEINFO"))) {
|
||||
/* fill device info struct with sane values... */
|
||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||
|
||||
if(GETENV(("SSTV2_FBICFG")) &&
|
||||
(SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1))
|
||||
info->fbiConfig = u;
|
||||
else
|
||||
info->fbiConfig = 0x0;
|
||||
if(GETENV(("SSTV2_FBICFG")) &&
|
||||
(SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1))
|
||||
info->fbiConfig = u;
|
||||
else
|
||||
info->fbiConfig = 0x0;
|
||||
|
||||
if(GETENV(("SSTV2_TMUCFG")) &&
|
||||
(SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1))
|
||||
info->tmuConfig = u;
|
||||
else
|
||||
info->tmuConfig = 0x0;
|
||||
if(GETENV(("SSTV2_TMUCFG")) &&
|
||||
(SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1))
|
||||
info->tmuConfig = u;
|
||||
else
|
||||
info->tmuConfig = 0x0;
|
||||
|
||||
info->numberTmus = 1;
|
||||
if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */
|
||||
info->numberTmus++;
|
||||
if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */
|
||||
info->numberTmus++;
|
||||
info->numberTmus = 1;
|
||||
if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */
|
||||
info->numberTmus++;
|
||||
if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */
|
||||
info->numberTmus++;
|
||||
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
|
||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
||||
info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
|
||||
else
|
||||
info->fbiMemSize = 2;
|
||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
||||
info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
|
||||
else
|
||||
info->fbiMemSize = 2;
|
||||
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE")))
|
||||
info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
else
|
||||
info->tmuMemSize[0] = 2;
|
||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||
info->tmuMemSize[2] = info->tmuMemSize[0];
|
||||
} else {
|
||||
int i;
|
||||
|
||||
for(i=0; i<5; i++) {
|
||||
if(i)
|
||||
INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i));
|
||||
/* GetFbiInfo() must be called before GetTmuInfo() */
|
||||
if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
/* get the revision ID of each TMU and verify that they are all the
|
||||
same */
|
||||
if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if(i == 5)
|
||||
return(FXFALSE);
|
||||
if(GETENV(("SSTV2_TMU_MEMSIZE")))
|
||||
info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
||||
else
|
||||
info->tmuMemSize[0] = 2;
|
||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||
info->tmuMemSize[2] = info->tmuMemSize[0];
|
||||
}
|
||||
// Measure silicon performance
|
||||
sst1InitMeasureSiProcess(sstbase, 0); // measure NAND-tree
|
||||
sst1InitMeasureSiProcess(sstbase, 1); // measure NOR-tree
|
||||
else {
|
||||
int i;
|
||||
|
||||
INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
|
||||
for (i=0; i<5; i++) {
|
||||
if (i)
|
||||
INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i));
|
||||
/* GetFbiInfo() must be called before GetTmuInfo() */
|
||||
if (sst1InitGetFbiInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
/* get the revision ID of each TMU and verify that they are all the
|
||||
same */
|
||||
if (sst1InitGetTmuInfo(sstbase, info) == FXFALSE)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if (i == 5)
|
||||
return(FXFALSE);
|
||||
}
|
||||
/* Measure silicon performance */
|
||||
sst1InitMeasureSiProcess(sstbase, 0); /* measure NAND-tree */
|
||||
sst1InitMeasureSiProcess(sstbase, 1); /* measure NOR-tree */
|
||||
|
||||
INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
|
||||
INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n",
|
||||
info->fbiConfig, info->tmuConfig));
|
||||
info->fbiConfig, info->tmuConfig));
|
||||
INIT_PRINTF(("sst1DeviceInfo: FBI Revision:%d, TMU Revison:%d, Num TMUs:%d\n",
|
||||
info->fbiRevision, info->tmuRevision, info->numberTmus));
|
||||
info->fbiRevision, info->tmuRevision, info->numberTmus));
|
||||
INIT_PRINTF(("sst1DeviceInfo: FBI Memory:%d, TMU[0] Memory:%d",
|
||||
info->fbiMemSize, info->tmuMemSize[0]));
|
||||
if(info->numberTmus > 1)
|
||||
info->fbiMemSize, info->tmuMemSize[0]));
|
||||
if (info->numberTmus > 1)
|
||||
INIT_PRINTF((", TMU[1] Memory:%d", info->tmuMemSize[1]));
|
||||
if(info->numberTmus > 2)
|
||||
if (info->numberTmus > 2)
|
||||
INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2]));
|
||||
INIT_PRINTF(("\n"));
|
||||
if(sst1InitUseVoodooFile == FXTRUE) {
|
||||
if(iniDac == (sst1InitDacStruct *) NULL)
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
|
||||
else
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
|
||||
if (sst1InitUseVoodooFile == FXTRUE) {
|
||||
if(iniDac == NULL)
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
|
||||
else
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
|
||||
iniDac->dacManufacturer, iniDac->dacDevice));
|
||||
} else {
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
|
||||
if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
|
||||
INIT_PRINTF(("AT&T ATT20C409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS)
|
||||
INIT_PRINTF(("ICS ICS5342\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI)
|
||||
INIT_PRINTF(("TI TVP3409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY)
|
||||
INIT_PRINTF(("(SLI PROXY)\n"));
|
||||
else
|
||||
INIT_PRINTF(("Unknown\n"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
|
||||
if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
|
||||
INIT_PRINTF(("AT&T ATT20C409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS)
|
||||
INIT_PRINTF(("ICS ICS5342\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI)
|
||||
INIT_PRINTF(("TI TVP3409\n"));
|
||||
else if(info->fbiVideoDacType == SST_FBI_DACTYPE_PROXY)
|
||||
INIT_PRINTF(("(SLI PROXY)\n"));
|
||||
else
|
||||
INIT_PRINTF(("Unknown\n"));
|
||||
}
|
||||
INIT_PRINTF(("sst1DeviceInfo: SLI Detected:%d\n", info->sliDetected));
|
||||
|
||||
return(FXTRUE);
|
||||
|
||||
@@ -123,7 +123,6 @@ static LPDIRECTDRAW2 lpDD = NULL;
|
||||
static LPDIRECTDRAW lpDD1 = NULL;
|
||||
|
||||
|
||||
|
||||
FxBool
|
||||
ErrorMessage(HWND hWnd, char *err)
|
||||
{
|
||||
@@ -133,7 +132,6 @@ ErrorMessage(HWND hWnd, char *err)
|
||||
} /* ErrorMessage */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Takes a DirectDraw Surface object (LPDIRECTDRAWSURFACE), looks up its
|
||||
* description (DDSURFACEDESC), and returns a pointer to the surface and its
|
||||
@@ -160,7 +158,6 @@ _dxSurfaceToBufDesc(LPDIRECTDRAWSURFACE lpSurf, InitBufDesc_t *pDesc)
|
||||
} /* _dxSurfaceToBufDesc */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Convert front, back and aux surfaces from DDraw to Glide bufDescriptors.
|
||||
*/
|
||||
@@ -241,7 +238,6 @@ _dxDDrawToGlideDesc(InitBufDesc_t *pDesc)
|
||||
} /* _dxDDrawToGlideDesc */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Allocate (or re-allocate for WM_SIZE) buffers from DDraw.
|
||||
*/
|
||||
@@ -305,7 +301,7 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
lpClipper = NULL;
|
||||
lpFront = NULL;
|
||||
lpBack = NULL;
|
||||
lpTriple = NULL;
|
||||
lpTriple = NULL;
|
||||
lpAux = NULL;
|
||||
|
||||
if ( !IsFullScreen ) { /* In a window */
|
||||
@@ -374,7 +370,6 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
GDBG_INFO((80, "_dxAS: Aux Buffer allocated!\n"));
|
||||
|
||||
} else {
|
||||
|
||||
/* Full screen - Set Exclusive Mode, change resolution, */
|
||||
GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n"));
|
||||
|
||||
@@ -445,10 +440,10 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
/* for now this is a goddamn baseball bat
|
||||
it can be trimmed down */
|
||||
if ( !IsFullScreen ) { /* this *REALLY* should be called for fullscreen */
|
||||
if( lpClipper) IDirectDrawClipper_Release( lpClipper);
|
||||
if( lpClipper) IDirectDrawClipper_Release ( lpClipper);
|
||||
if( lpAux ) IDirectDrawSurface2_Release( lpAux );
|
||||
if( lpBack ) IDirectDrawSurface2_Release( lpBack );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpFront ) IDirectDrawSurface2_Release( lpFront );
|
||||
|
||||
lpClipper = NULL;
|
||||
@@ -519,10 +514,10 @@ _dxReallocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
|
||||
return _dxDDrawToGlideDesc(pDesc);
|
||||
FUBAR:
|
||||
/* if you don't free these you can't make another attempt */
|
||||
if( lpClipper) IDirectDrawClipper_Release( lpClipper);
|
||||
if( lpClipper) IDirectDrawClipper_Release ( lpClipper);
|
||||
if( lpAux ) IDirectDrawSurface2_Release( lpAux );
|
||||
if( lpBack ) IDirectDrawSurface2_Release( lpBack );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpTriple ) IDirectDrawSurface2_Release( lpTriple );
|
||||
if( lpFront ) IDirectDrawSurface2_Release( lpFront );
|
||||
lpClipper = NULL;
|
||||
lpFront = NULL;
|
||||
@@ -660,7 +655,6 @@ dxOpen(
|
||||
return ErrorMessage(hWndApp, "failed dxOpen");
|
||||
#endif
|
||||
|
||||
|
||||
GDBG_INFO((80, "_dxAllocSurfaces OK!!!\n"));
|
||||
|
||||
for (i=0; i< NUM_BUFS; i++) {
|
||||
@@ -776,14 +770,14 @@ dxClose(void)
|
||||
if( lpDD ) IDirectDraw2_Release( lpDD );
|
||||
|
||||
if (1 /* !IsFullScreen */) {
|
||||
if( lpDD1 ) IDirectDraw_Release( lpDD1 );
|
||||
lpDD1 = NULL;
|
||||
if( lpDD1 ) IDirectDraw_Release( lpDD1 );
|
||||
lpDD1 = NULL;
|
||||
}
|
||||
|
||||
lpClipper = NULL;
|
||||
lpFront = NULL;
|
||||
lpBack = NULL;
|
||||
lpTriple = NULL;
|
||||
lpTriple = NULL;
|
||||
lpAux = NULL;
|
||||
lpDD = NULL;
|
||||
#endif /* 0 */
|
||||
@@ -901,7 +895,6 @@ dxOpen(
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
#define WAITLOOP {\
|
||||
volatile int waitfoo;\
|
||||
int waitcount;\
|
||||
@@ -1026,5 +1019,3 @@ dxSwap(FxU32 code)
|
||||
{
|
||||
} /* dxSwap */
|
||||
#endif /* __DOS32__ || (defined(__WIN32__) && !defined(INIT_ACCESS_DDRAW) */
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
static FxBool
|
||||
readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
|
||||
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
|
||||
{
|
||||
FxU32 rd_x, rd_y;
|
||||
FxU32 rd_col = 0;
|
||||
@@ -76,7 +76,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
|
||||
}
|
||||
INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n",
|
||||
*r_sum, *g_sum, *b_sum));
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* xxx - Give these guys some meaningful comments */
|
||||
@@ -147,7 +147,7 @@ initSumTables(FxU32 *sstbase)
|
||||
}
|
||||
g_tbl[g_sum] = tst_color;
|
||||
}
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
/* remove dither to derive actual 24-bit RGB value */
|
||||
@@ -160,7 +160,7 @@ unDither(FxU32 r_sum, FxU32 g_sum, FxU32 b_sum, FxU32 *result)
|
||||
return(FXFALSE);
|
||||
}
|
||||
*result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum];
|
||||
return(FXTRUE);
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
static FxBool
|
||||
@@ -244,10 +244,10 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
||||
|
||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||
|
||||
if(GETENV(("SST_TMUMEM_SIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
||||
return(FXTRUE);
|
||||
}
|
||||
if(GETENV(("SST_TMUMEM_SIZE"))) {
|
||||
*TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
||||
return(FXTRUE);
|
||||
}
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER);
|
||||
ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK);
|
||||
@@ -278,7 +278,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
||||
if (data == SENSE0) {*TmuMemorySize = 1; return(FXTRUE);}
|
||||
|
||||
INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n"));
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@@ -292,21 +292,21 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
FxU32 trev;
|
||||
|
||||
if(initSumTables(sstbase) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
if(getTmuConfigData(sstbase,info) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
|
||||
/* TMU memory speed */
|
||||
/* tmuClkFixed is no longer used... */
|
||||
info->tmuClkFixed = 0x0;
|
||||
/* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */
|
||||
info->tmuMemSpeed = 0;
|
||||
/* TMU memory speed */
|
||||
/* tmuClkFixed is no longer used... */
|
||||
info->tmuClkFixed = 0x0;
|
||||
/* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */
|
||||
info->tmuMemSpeed = 0;
|
||||
|
||||
/* count the TMUs and verify that all TMUs are the same revision */
|
||||
info->tmuRevision = info->tmuConfig & 0x7;
|
||||
info->numberTmus = 1;
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
return(FXFALSE);
|
||||
INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0]));
|
||||
if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */
|
||||
info->numberTmus++; /* increment TMU count */
|
||||
@@ -315,7 +315,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */
|
||||
@@ -325,7 +325,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
|
||||
return(FXFALSE);
|
||||
}
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||
return(FXFALSE);
|
||||
}
|
||||
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
||||
@@ -359,7 +359,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||
/* for rendering */
|
||||
ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
/* Setup Basic rendering datapath */
|
||||
@@ -371,7 +371,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
if(sst1InitSliDetect(sstbase))
|
||||
/* SLI cannot support 4 MBytes... */
|
||||
goto check2MByte;
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
|
||||
ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER |
|
||||
@@ -389,7 +389,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(128, 100) == 0xdead) &&
|
||||
(LFB_GETPIXEL(200, 200) == 0x55aa)) {
|
||||
retval = 4;
|
||||
retval = 4;
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
goto fbiMemSizeDone;
|
||||
@@ -398,7 +398,7 @@ static int fbiMemSize(FxU32 *sstbase)
|
||||
check2MByte:
|
||||
/* Check for 2 MBytes... */
|
||||
/* Write to color buffer in 640x480 resolution */
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
|
||||
ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
|
||||
SST_LFB_READFRONTBUFFER);
|
||||
sst1InitIdleFBI(sstbase);
|
||||
@@ -417,7 +417,7 @@ check2MByte:
|
||||
ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if(LFB_GETPIXEL(178, 436) == 0xaa55) {
|
||||
retval = 2;
|
||||
retval = 2;
|
||||
goto fbiMemSizeDone;
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ check1MByte:
|
||||
sst1InitIdleFBI(sstbase);
|
||||
if((LFB_GETPIXEL(10, 10) == 0xdead) &&
|
||||
(LFB_GETPIXEL(100, 200) == 0x5a5a))
|
||||
retval = 1;
|
||||
retval = 1;
|
||||
|
||||
fbiMemSizeDone:
|
||||
/* Restore init registers to original state */
|
||||
@@ -476,8 +476,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
** been allocated
|
||||
**
|
||||
*/
|
||||
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase,
|
||||
sst1DeviceInfoStruct *info)
|
||||
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
{
|
||||
FxBool retval;
|
||||
|
||||
@@ -574,15 +573,15 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||
iniDac->dacManufacturer, iniDac->dacDevice));
|
||||
}
|
||||
else {
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
|
||||
if(info->fbiDacType == SST_FBI_DACTYPE_ATT)
|
||||
INIT_PRINTF(("AT&T ATT20C409\n"));
|
||||
else if(info->fbiDacType == SST_FBI_DACTYPE_ICS)
|
||||
INIT_PRINTF(("ICS ICS5342\n"));
|
||||
else if(info->fbiDacType == SST_FBI_DACTYPE_TI)
|
||||
INIT_PRINTF(("TI TVP3409\n"));
|
||||
else
|
||||
INIT_PRINTF(("Unknown\n"));
|
||||
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
|
||||
if(info->fbiDacType == SST_FBI_DACTYPE_ATT)
|
||||
INIT_PRINTF(("AT&T ATT20C409\n"));
|
||||
else if(info->fbiDacType == SST_FBI_DACTYPE_ICS)
|
||||
INIT_PRINTF(("ICS ICS5342\n"));
|
||||
else if(info->fbiDacType == SST_FBI_DACTYPE_TI)
|
||||
INIT_PRINTF(("TI TVP3409\n"));
|
||||
else
|
||||
INIT_PRINTF(("Unknown\n"));
|
||||
}
|
||||
INIT_PRINTF(("sst1DeviceInfo: SliDetect:%d\n", info->sstSliDetect));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user