cvg, sst1, sst96: cache the getenv() results in init code.
This commit is contained in:
@@ -474,13 +474,15 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase)
|
|||||||
{
|
{
|
||||||
FxU32 clkFreq;
|
FxU32 clkFreq;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *e;
|
||||||
|
|
||||||
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SSTV2_GRXCLK"))) {
|
e = GETENV(("SSTV2_GRXCLK"));
|
||||||
|
if(e) {
|
||||||
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
||||||
clkFreq = ATOI(GETENV(("SSTV2_GRXCLK")));
|
clkFreq = ATOI(e);
|
||||||
if(clkFreq < 16)
|
if(clkFreq < 16)
|
||||||
clkFreq = 16;
|
clkFreq = 16;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -92,19 +92,23 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase,
|
|||||||
|
|
||||||
/* Get the user set definitions (cp or environment) */
|
/* Get the user set definitions (cp or environment) */
|
||||||
if(!calledBefore) {
|
if(!calledBefore) {
|
||||||
|
const char *envp;
|
||||||
calledBefore = FXTRUE;
|
calledBefore = FXTRUE;
|
||||||
|
envp = GETENV(("SSTV2_RGAMMA"));
|
||||||
if(GETENV(("SSTV2_RGAMMA"))) {
|
if(envp) {
|
||||||
userGammaR = (double) ATOF(GETENV(("SSTV2_RGAMMA")));
|
userGammaR = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_GGAMMA"))) {
|
envp = GETENV(("SSTV2_GGAMMA"));
|
||||||
userGammaG = (double) ATOF(GETENV(("SSTV2_GGAMMA")));
|
if(envp) {
|
||||||
|
userGammaG = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_BGAMMA"))) {
|
envp = GETENV(("SSTV2_BGAMMA"));
|
||||||
userGammaB = (double) ATOF(GETENV(("SSTV2_BGAMMA")));
|
if(envp) {
|
||||||
|
userGammaB = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_GAMMA"))) {
|
envp = GETENV(("SSTV2_GAMMA"));
|
||||||
userGammaR = (double) ATOF(GETENV(("SSTV2_GAMMA")));
|
if(envp) {
|
||||||
|
userGammaR = (double) ATOF(envp);
|
||||||
userGammaG = userGammaR;
|
userGammaG = userGammaR;
|
||||||
userGammaB = userGammaR;
|
userGammaB = userGammaR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ FX_EXPORT void FX_CSTYLE
|
|||||||
gdbg_init(void)
|
gdbg_init(void)
|
||||||
{
|
{
|
||||||
static int done=0; // only execute once
|
static int done=0; // only execute once
|
||||||
char *env;
|
const char *env;
|
||||||
|
|
||||||
if (done) return;
|
if (done) return;
|
||||||
|
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
FxU32 r_sum, g_sum, b_sum;
|
FxU32 r_sum, g_sum, b_sum;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
FxU32 tmuRevision;
|
FxU32 tmuRevision;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
/* set trex's (all 3) to output configuration bits */
|
/* set trex's (all 3) to output configuration bits */
|
||||||
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
||||||
@@ -233,10 +234,11 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]);
|
ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]);
|
||||||
ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]);
|
ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]);
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMUCFG")))
|
envp = GETENV(("SSTV2_TMUCFG"));
|
||||||
|
if(envp)
|
||||||
{
|
{
|
||||||
FxU32 u;
|
FxU32 u;
|
||||||
if (SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1)
|
if (SSCANF(envp, "%u", &u) == 1)
|
||||||
info->tmuConfig = u;
|
info->tmuConfig = u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,11 +289,13 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
|||||||
{
|
{
|
||||||
FxU32 i,data;
|
FxU32 i,data;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
|
envp = GETENV(("SSTV2_TMU_MEMSIZE"));
|
||||||
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
if(envp) {
|
||||||
|
*TmuMemorySize = ATOI(envp);
|
||||||
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
|
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
|
||||||
* second RAS so that apps which may incorrectly store data in the
|
* second RAS so that apps which may incorrectly store data in the
|
||||||
* upper 2 Mbytes will not function properly... */
|
* upper 2 Mbytes will not function properly... */
|
||||||
@@ -344,6 +348,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
|||||||
FX_EXPORT FxBool FX_CSTYLE
|
FX_EXPORT FxBool FX_CSTYLE
|
||||||
sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||||
{
|
{
|
||||||
|
const char *envp;
|
||||||
FxU32 trev;
|
FxU32 trev;
|
||||||
|
|
||||||
if(initSumTables(sstbase) == FXFALSE)
|
if(initSumTables(sstbase) == FXFALSE)
|
||||||
@@ -388,8 +393,9 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
if (GETENV(("SSTV2_NUM_TMUS")))
|
envp = GETENV(("SSTV2_NUM_TMUS"));
|
||||||
info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
|
if (envp)
|
||||||
|
info->numberTmus = ATOI(envp);
|
||||||
|
|
||||||
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
@@ -415,9 +421,10 @@ static int fbiMemSize(FxU32 *sstbase)
|
|||||||
FxU32 init1Save = IGET(sst->fbiInit1);
|
FxU32 init1Save = IGET(sst->fbiInit1);
|
||||||
FxU32 init2Save = IGET(sst->fbiInit2);
|
FxU32 init2Save = IGET(sst->fbiInit2);
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
const char *envp = GETENV(("SSTV2_FBI_MEMSIZE"));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
if(envp)
|
||||||
return(ATOI(GETENV(("SSTV2_FBI_MEMSIZE"))));
|
return ATOI(envp);
|
||||||
|
|
||||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||||
/* for rendering */
|
/* for rendering */
|
||||||
@@ -510,12 +517,13 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
{
|
{
|
||||||
FxU32 u;
|
FxU32 u;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
info->fbiMemSize = fbiMemSize(sstbase);
|
info->fbiMemSize = fbiMemSize(sstbase);
|
||||||
|
|
||||||
/* Detect board identification and memory speed */
|
/* Detect board identification and memory speed */
|
||||||
if(GETENV(("SSTV2_FBICFG")) &&
|
envp = GETENV(("SSTV2_FBICFG"));
|
||||||
(SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1))
|
if(envp && (SSCANF(envp, "%u", &u) == 1))
|
||||||
info->fbiConfig = u;
|
info->fbiConfig = u;
|
||||||
else
|
else
|
||||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||||
@@ -567,16 +575,17 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
if(GETENV(("SSTV2_NODEVICEINFO"))) {
|
if(GETENV(("SSTV2_NODEVICEINFO"))) {
|
||||||
/* fill device info struct with sane values... */
|
/* fill device info struct with sane values... */
|
||||||
|
const char *envp;
|
||||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_FBICFG")) &&
|
envp = GETENV(("SSTV2_FBICFG"));
|
||||||
(SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1))
|
if(envp && (SSCANF(envp, "%u", &u) == 1))
|
||||||
info->fbiConfig = u;
|
info->fbiConfig = u;
|
||||||
else
|
else
|
||||||
info->fbiConfig = 0x0;
|
info->fbiConfig = 0x0;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMUCFG")) &&
|
envp = GETENV(("SSTV2_TMUCFG"));
|
||||||
(SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1))
|
if(envp && (SSCANF(envp, "%u", &u) == 1))
|
||||||
info->tmuConfig = u;
|
info->tmuConfig = u;
|
||||||
else
|
else
|
||||||
info->tmuConfig = 0x0;
|
info->tmuConfig = 0x0;
|
||||||
@@ -589,13 +598,15 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
info->tmuRevision = info->tmuConfig & 0x7;
|
info->tmuRevision = info->tmuConfig & 0x7;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
envp = GETENV(("SSTV2_FBI_MEMSIZE"));
|
||||||
info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
|
if(envp)
|
||||||
|
info->fbiMemSize = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->fbiMemSize = 2;
|
info->fbiMemSize = 2;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMU_MEMSIZE")))
|
envp = GETENV(("SSTV2_TMU_MEMSIZE"));
|
||||||
info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
if(envp)
|
||||||
|
info->tmuMemSize[0] = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->tmuMemSize[0] = 2;
|
info->tmuMemSize[0] = 2;
|
||||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||||
|
|||||||
@@ -49,15 +49,17 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...)
|
|||||||
static FxBool printIt = FXFALSE;
|
static FxBool printIt = FXFALSE;
|
||||||
|
|
||||||
if(firstPass == FXTRUE) {
|
if(firstPass == FXTRUE) {
|
||||||
|
const char *envf;
|
||||||
sst1InitMsgFile = stdout;
|
sst1InitMsgFile = stdout;
|
||||||
firstPass = FXFALSE;
|
firstPass = FXFALSE;
|
||||||
if(GETENV(("SSTV2_INITDEBUG")) || GDBG_GET_DEBUGLEVEL(5))
|
if(GETENV(("SSTV2_INITDEBUG")) || GDBG_GET_DEBUGLEVEL(5))
|
||||||
printIt = FXTRUE;
|
printIt = FXTRUE;
|
||||||
if(GETENV(("SSTV2_INITDEBUG_FILE"))) {
|
envf = GETENV(("SSTV2_INITDEBUG_FILE"));
|
||||||
printIt = ((sst1InitMsgFile = fopen(GETENV(("SSTV2_INITDEBUG_FILE")), "w")) != NULL);
|
if(envf) {
|
||||||
|
printIt = ((sst1InitMsgFile = fopen(envf, "w")) != NULL);
|
||||||
if (!printIt) {
|
if (!printIt) {
|
||||||
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n",
|
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n",
|
||||||
GETENV(("SSTV2_INITDEBUG_FILE")));
|
envf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
FxU32 videoWindowActive = 0x1;
|
FxU32 videoWindowActive = 0x1;
|
||||||
FxU32 videoWindowActiveDrag = 0xf;
|
FxU32 videoWindowActiveDrag = 0xf;
|
||||||
sst1DeviceInfoStruct *sst1M, *sst1S;
|
sst1DeviceInfoStruct *sst1M, *sst1S;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(sst1InitCheckBoard(sstbase1) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase1) == FXFALSE)
|
||||||
@@ -107,8 +108,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
initIdleEnabled = 1;
|
initIdleEnabled = 1;
|
||||||
|
|
||||||
// User override of swap algorithm...
|
// User override of swap algorithm...
|
||||||
if(GETENV(("SSTV2_SLISWAP"))) {
|
envp = GETENV(("SSTV2_SLISWAP"));
|
||||||
FxU32 swapAlg = ATOI(GETENV(("SSTV2_SLISWAP")));
|
if(envp) {
|
||||||
|
FxU32 swapAlg = ATOI(envp);
|
||||||
|
|
||||||
if(swapAlg == 1) {
|
if(swapAlg == 1) {
|
||||||
INIT_PRINTF(("sst1InitSli(): Using dac_data[0] for swapping(%d, %d)...\n", videoWindowActive, videoWindowActiveDrag));
|
INIT_PRINTF(("sst1InitSli(): Using dac_data[0] for swapping(%d, %d)...\n", videoWindowActive, videoWindowActiveDrag));
|
||||||
@@ -238,14 +240,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
slaveVOutClkDel = 0;
|
slaveVOutClkDel = 0;
|
||||||
slavePVOutClkDel = 0;
|
slavePVOutClkDel = 0;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_SLIS_VOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIS_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIS_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVOutClkDel = i;
|
slaveVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIS_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slavePVOutClkDel = i;
|
slavePVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIS_VIN_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIS_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIS_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVInClkDel = i;
|
slaveVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
||||||
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
||||||
@@ -390,14 +392,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
masterVInClkDel = 3;
|
masterVInClkDel = 3;
|
||||||
masterVOutClkDel = 2;
|
masterVOutClkDel = 2;
|
||||||
masterPVOutClkDel = 0;
|
masterPVOutClkDel = 0;
|
||||||
if(GETENV(("SSTV2_SLIM_VOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIM_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIM_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVOutClkDel = i;
|
masterVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIM_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterPVOutClkDel = i;
|
masterPVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIM_VIN_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIM_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIM_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVInClkDel = i;
|
masterVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
||||||
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
||||||
@@ -708,9 +710,11 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdownSli(FxU32 *sstbase)
|
|||||||
FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase)
|
FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase)
|
||||||
{
|
{
|
||||||
FxU32 sliDetected;
|
FxU32 sliDetected;
|
||||||
|
const char * envp;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_SLIDETECT")))
|
envp = GETENV(("SSTV2_SLIDETECT"));
|
||||||
sliDetected = ATOI(GETENV(("SSTV2_SLIDETECT")));
|
if(envp)
|
||||||
|
sliDetected = ATOI(envp);
|
||||||
else
|
else
|
||||||
sliDetected = sst1InitSliPaired(sstbase);
|
sliDetected = sst1InitSliPaired(sstbase);
|
||||||
|
|
||||||
|
|||||||
@@ -198,10 +198,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
|||||||
FxU32 *sstbase;
|
FxU32 *sstbase;
|
||||||
FxU32 j, n;
|
FxU32 j, n;
|
||||||
FxU32 sstv2_noremap = 0;
|
FxU32 sstv2_noremap = 0;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if( GETENV( ("SSTV2_DEVICEID") ) &&
|
envp = GETENV(("SSTV2_DEVICEID"));
|
||||||
(SSCANF(GETENV(("SSTV2_DEVICEID")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
deviceID = i;
|
deviceID = i;
|
||||||
else
|
else
|
||||||
deviceID = 0x0002;
|
deviceID = 0x0002;
|
||||||
@@ -228,8 +229,8 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
|||||||
// Find "voodoo2.ini" file if it exists...
|
// Find "voodoo2.ini" file if it exists...
|
||||||
sst1InitUseVoodooFile = sst1InitVoodooFile();
|
sst1InitUseVoodooFile = sst1InitVoodooFile();
|
||||||
|
|
||||||
if( GETENV( ("SSTV2_NOREMAP") ) &&
|
envp = GETENV(("SSTV2_NOREMAP"));
|
||||||
(SSCANF(GETENV(("SSTV2_NOREMAP")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
sstv2_noremap = i;
|
sstv2_noremap = i;
|
||||||
else
|
else
|
||||||
sstv2_noremap = 0;
|
sstv2_noremap = 0;
|
||||||
@@ -392,10 +393,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
|||||||
sst1BoardInfo[BoardNumber].vgaPassthruEnable = 0x0;
|
sst1BoardInfo[BoardNumber].vgaPassthruEnable = 0x0;
|
||||||
sst1BoardInfo[BoardNumber].fbiVideo16BPP = 0;
|
sst1BoardInfo[BoardNumber].fbiVideo16BPP = 0;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_VGA_PASS"))) {
|
envp = GETENV(("SSTV2_VGA_PASS"));
|
||||||
INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n",
|
if(envp) {
|
||||||
ATOI(GETENV(("SSTV2_VGA_PASS")))));
|
i = ATOI(envp);
|
||||||
if(ATOI(GETENV(("SSTV2_VGA_PASS")))) {
|
INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n", i));
|
||||||
|
if(i) {
|
||||||
sst1BoardInfo[BoardNumber].vgaPassthruEnable = SST_EN_VGA_PASSTHRU;
|
sst1BoardInfo[BoardNumber].vgaPassthruEnable = SST_EN_VGA_PASSTHRU;
|
||||||
sst1BoardInfo[BoardNumber].vgaPassthruDisable = 0x0;
|
sst1BoardInfo[BoardNumber].vgaPassthruDisable = 0x0;
|
||||||
} else {
|
} else {
|
||||||
@@ -422,6 +424,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
FxU32 ft_clkdel, tf0_clkdel, tf1_clkdel, tf2_clkdel;
|
FxU32 ft_clkdel, tf0_clkdel, tf1_clkdel, tf2_clkdel;
|
||||||
sst1ClkTimingStruct sstGrxClk;
|
sst1ClkTimingStruct sstGrxClk;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
@@ -457,16 +460,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitReturnStatus(sstbase);
|
sst1InitReturnStatus(sstbase);
|
||||||
|
|
||||||
// Adjust Trex-to-Fbi FIFO
|
// Adjust Trex-to-Fbi FIFO
|
||||||
if(GETENV(("SSTV2_TF_FIFO_THRESH")) &&
|
envp = GETENV(("SSTV2_TF_FIFO_THRESH"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF_FIFO_THRESH")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
tf_fifo_thresh = i;
|
tf_fifo_thresh = i;
|
||||||
else
|
else
|
||||||
tf_fifo_thresh = 0x8;
|
tf_fifo_thresh = 0x8;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
||||||
tf_fifo_thresh));
|
tf_fifo_thresh));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_PFT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PFT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PFT_CLKDEL")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
ft_clkdel = i;
|
ft_clkdel = i;
|
||||||
else
|
else
|
||||||
ft_clkdel = 0x8; // Okay for 16 MHz startup...
|
ft_clkdel = 0x8; // Okay for 16 MHz startup...
|
||||||
@@ -532,8 +535,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set TREX0 init values
|
// set TREX0 init values
|
||||||
if(GETENV(("SSTV2_TREX0INIT0")) &&
|
envp = GETENV(("SSTV2_TREX0INIT0"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX0INIT0")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit0[0] = i;
|
sst1CurrentBoard->tmuInit0[0] = i;
|
||||||
} else
|
} else
|
||||||
@@ -541,15 +544,15 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[0]));
|
sst1CurrentBoard->tmuInit0[0]));
|
||||||
if(GETENV(("SSTV2_TREX0INIT1")) &&
|
envp = GETENV(("SSTV2_TREX0INIT1"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX0INIT1")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit1[0] = i;
|
sst1CurrentBoard->tmuInit1[0] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_PTF0_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PTF0_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PTF0_CLKDEL")), "%i", &tf0_clkdel) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &tf0_clkdel) == 1)) {
|
||||||
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf0_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf0_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -558,22 +561,22 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1CurrentBoard->tmuInit1[0]));
|
sst1CurrentBoard->tmuInit1[0]));
|
||||||
|
|
||||||
// set TREX1 init values
|
// set TREX1 init values
|
||||||
if(GETENV(("SSTV2_TREX1INIT0")) &&
|
envp = GETENV(("SSTV2_TREX1INIT0"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX1INIT0")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit0[1] = i;
|
sst1CurrentBoard->tmuInit0[1] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[1]));
|
sst1CurrentBoard->tmuInit0[1]));
|
||||||
if(GETENV(("SSTV2_TREX1INIT1")) &&
|
envp = GETENV(("SSTV2_TREX1INIT1"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX1INIT1")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit1[1] = i;
|
sst1CurrentBoard->tmuInit1[1] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
||||||
if(GETENV(("SSTV2_PTF1_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PTF1_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PTF1_CLKDEL")), "%i", &tf1_clkdel) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf1_clkdel) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf1_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf1_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -581,24 +584,23 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT1=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT1=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit1[1]));
|
sst1CurrentBoard->tmuInit1[1]));
|
||||||
|
|
||||||
|
|
||||||
// set TREX2 init values
|
// set TREX2 init values
|
||||||
if(GETENV(("SSTV2_TREX2INIT0")) &&
|
envp = GETENV(("SSTV2_TREX2INIT0"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX2INIT0")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit0[2] = i;
|
sst1CurrentBoard->tmuInit0[2] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[2]));
|
sst1CurrentBoard->tmuInit0[2]));
|
||||||
if(GETENV(("SSTV2_TREX2INIT1")) &&
|
envp = GETENV(("SSTV2_TREX2INIT1"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX2INIT1")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit1[2] = i;
|
sst1CurrentBoard->tmuInit1[2] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
||||||
if(GETENV(("SSTV2_PTF2_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PTF2_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PTF2_CLKDEL")), "%i", &tf2_clkdel) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf2_clkdel) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf2_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf2_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -705,8 +707,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
// LFB writes stored in memory FIFO?
|
// LFB writes stored in memory FIFO?
|
||||||
if(GETENV(("SSTV2_MEMFIFO_LFB")))
|
envp = GETENV(("SSTV2_MEMFIFO_LFB"));
|
||||||
n = ATOI(GETENV(("SSTV2_MEMFIFO_LFB")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -716,8 +719,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Texture memory writes stored in memory FIFO?
|
// Texture memory writes stored in memory FIFO?
|
||||||
if(GETENV(("SSTV2_MEMFIFO_TEX")))
|
envp = GETENV(("SSTV2_MEMFIFO_TEX"));
|
||||||
n = ATOI(GETENV(("SSTV2_MEMFIFO_TEX")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -1104,9 +1108,11 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void)
|
|||||||
FxU32 vendorID = _3DFX_PCI_ID; // 3Dfx Vendor ID
|
FxU32 vendorID = _3DFX_PCI_ID; // 3Dfx Vendor ID
|
||||||
FxU32 deviceID; // 0x0002 - Find Voodoo2 boards ( 0xFFFF - Find any 3Dfx board)
|
FxU32 deviceID; // 0x0002 - Find Voodoo2 boards ( 0xFFFF - Find any 3Dfx board)
|
||||||
FxU32 j, n;
|
FxU32 j, n;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if( GETENV( ("SSTV2_DEVICEID") ) )
|
envp = GETENV(("SSTV2_DEVICEID"));
|
||||||
deviceID = ATOI( GETENV( "SSTV2_DEVICEID" ) );
|
if(envp)
|
||||||
|
deviceID = ATOI(envp);
|
||||||
else
|
else
|
||||||
deviceID = 0x0002;
|
deviceID = 0x0002;
|
||||||
|
|
||||||
@@ -1115,8 +1121,9 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void)
|
|||||||
if(pciFindCardMulti(vendorID, deviceID, &n, j))
|
if(pciFindCardMulti(vendorID, deviceID, &n, j))
|
||||||
boardsInSystemReally++;
|
boardsInSystemReally++;
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_BOARDS")))
|
envp = GETENV(("SSTV2_BOARDS"));
|
||||||
return(ATOI(GETENV(("SSTV2_BOARDS"))));
|
if(envp)
|
||||||
|
return ATOI(envp);
|
||||||
else
|
else
|
||||||
return(boardsInSystemReally);
|
return(boardsInSystemReally);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -690,7 +690,7 @@ FX_ENTRY FxBool FX_CALL sst1InitCmdFifo(FxU32 *sstbase, FxBool enable,
|
|||||||
INIT_PRINTF(("sst1InitCmdFifo(): sst1InitCmdFifoDirect() failed...\n"));
|
INIT_PRINTF(("sst1InitCmdFifo(): sst1InitCmdFifoDirect() failed...\n"));
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sst1CurrentBoard->sliSlaveVirtAddr) {
|
if(sst1CurrentBoard->sliSlaveVirtAddr) {
|
||||||
if(!sst1InitCmdFifoDirect(sst1CurrentBoard->sliSlaveVirtAddr, 0,
|
if(!sst1InitCmdFifoDirect(sst1CurrentBoard->sliSlaveVirtAddr, 0,
|
||||||
fifoStart, fifoSize,
|
fifoStart, fifoSize,
|
||||||
@@ -969,6 +969,7 @@ FX_EXPORT void FX_CSTYLE sst1InitPrintInitRegs(FxU32 *sstbase)
|
|||||||
*/
|
*/
|
||||||
FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
||||||
{
|
{
|
||||||
|
const char *envp;
|
||||||
FxU32 n, siProcess, nandOsc, norOsc;
|
FxU32 n, siProcess, nandOsc, norOsc;
|
||||||
FxU32 pciCntrLoad = 0xfff;
|
FxU32 pciCntrLoad = 0xfff;
|
||||||
FxU32 cntr;
|
FxU32 cntr;
|
||||||
@@ -977,8 +978,8 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
|||||||
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SSTV2_SIPROCESS_CNTR")) &&
|
envp = GETENV(("SSTV2_SIPROCESS_CNTR"));
|
||||||
(SSCANF(GETENV(("SSTV2_SIPROCESS_CNTR")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
pciCntrLoad = i;
|
pciCntrLoad = i;
|
||||||
INIT_PRINTF(("sst1InitMeasureSiProcess(): Using PCI Counter preload value of 0x%x...\n", pciCntrLoad));
|
INIT_PRINTF(("sst1InitMeasureSiProcess(): Using PCI Counter preload value of 0x%x...\n", pciCntrLoad));
|
||||||
}
|
}
|
||||||
@@ -990,20 +991,20 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
|||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NAND_SEL);
|
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NAND_SEL);
|
||||||
|
|
||||||
// Allow oscillator to run...
|
// Allow oscillator to run...
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NAND_SEL);
|
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NAND_SEL);
|
||||||
|
|
||||||
// Loop until PCI counter decrements to 0
|
// Loop until PCI counter decrements to 0
|
||||||
cntr = 0 ;
|
cntr = 0 ;
|
||||||
do {
|
do {
|
||||||
++cntr;
|
++cntr;
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
||||||
|
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
||||||
nandOsc = siProcess;
|
nandOsc = siProcess;
|
||||||
@@ -1019,20 +1020,20 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
|||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NOR_SEL);
|
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NOR_SEL);
|
||||||
|
|
||||||
// Allow oscillator to run...
|
// Allow oscillator to run...
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NOR_SEL);
|
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NOR_SEL);
|
||||||
|
|
||||||
// Loop until PCI counter decrements to 0
|
// Loop until PCI counter decrements to 0
|
||||||
cntr = 0 ;
|
cntr = 0 ;
|
||||||
do {
|
do {
|
||||||
++cntr;
|
++cntr;
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
||||||
|
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
||||||
norOsc = siProcess;
|
norOsc = siProcess;
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
float vidClkFreq;
|
float vidClkFreq;
|
||||||
#endif
|
#endif
|
||||||
|
const char *envp;
|
||||||
|
int envval;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
@@ -177,10 +179,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GETENV(("SSTV2_ALLOC_COLOR")))
|
envp = GETENV(("SSTV2_ALLOC_COLOR"));
|
||||||
nCol = ATOI(GETENV(("SSTV2_ALLOC_COLOR")));
|
if(envp)
|
||||||
if(GETENV(("SSTV2_ALLOC_AUX")))
|
nCol = ATOI(envp);
|
||||||
nAux = ATOI(GETENV(("SSTV2_ALLOC_AUX")));
|
envp = GETENV(("SSTV2_ALLOC_AUX"));
|
||||||
|
if(envp)
|
||||||
|
nAux = ATOI(envp);
|
||||||
|
|
||||||
// Disallow unsupported buffer combinations (from environment vars)...
|
// Disallow unsupported buffer combinations (from environment vars)...
|
||||||
if(nCol < 2 || nCol > 3 || nAux > 1)
|
if(nCol < 2 || nCol > 3 || nAux > 1)
|
||||||
@@ -193,9 +197,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
INIT_PRINTF(("sst1InitVideo(): Insufficient memory available for desired resolution.\n"));
|
INIT_PRINTF(("sst1InitVideo(): Insufficient memory available for desired resolution.\n"));
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_VIDEO_24BPP")))
|
envp = GETENV(("SSTV2_VIDEO_24BPP"));
|
||||||
sst1CurrentBoard->fbiVideo16BPP =
|
if(envp)
|
||||||
(ATOI(GETENV(("SSTV2_VIDEO_24BPP")))) ^ 0x1;
|
sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1;
|
||||||
else {
|
else {
|
||||||
sst1CurrentBoard->fbiVideo16BPP = 0;
|
sst1CurrentBoard->fbiVideo16BPP = 0;
|
||||||
|
|
||||||
@@ -220,30 +224,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET);
|
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET);
|
||||||
|
|
||||||
// Setup SST video timing registers
|
// Setup SST video timing registers
|
||||||
if(GETENV(("SSTV2_HSYNC")) &&
|
envp = GETENV(("SSTV2_HSYNC"));
|
||||||
(SSCANF(GETENV(("SSTV2_HSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->hSync, vtmp);
|
ISET(sst->hSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SSTV2_VSYNC")) &&
|
envp = GETENV(("SSTV2_VSYNC"));
|
||||||
(SSCANF(GETENV(("SSTV2_VSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->vSync, vtmp);
|
ISET(sst->vSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SSTV2_BACKPORCH")) &&
|
envp = GETENV(("SSTV2_BACKPORCH"));
|
||||||
(SSCANF(GETENV(("SSTV2_BACKPORCH")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
||||||
ISET(sst->backPorch, vtmp);
|
ISET(sst->backPorch, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->backPorch,
|
ISET(sst->backPorch,
|
||||||
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
||||||
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
||||||
if(GETENV(("SSTV2_DIMENSIONS")) &&
|
envp = GETENV(("SSTV2_DIMENSIONS"));
|
||||||
(SSCANF(GETENV(("SSTV2_DIMENSIONS")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
||||||
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
||||||
sstVideoRez->xDimension = vtmp & 0x3ff;
|
sstVideoRez->xDimension = vtmp & 0x3ff;
|
||||||
@@ -251,13 +255,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
ISET(sst->videoDimensions,
|
ISET(sst->videoDimensions,
|
||||||
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
||||||
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
||||||
if(GETENV(("SSTV2_MEMOFFSET")) &&
|
envp = GETENV(("SSTV2_MEMOFFSET"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMOFFSET")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
||||||
sstVideoRez->memOffset = vtmp;
|
sstVideoRez->memOffset = vtmp;
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_TILESINX")) &&
|
envp = GETENV(("SSTV2_TILESINX"));
|
||||||
(SSCANF(GETENV(("SSTV2_TILESINX")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
||||||
sstVideoRez->tilesInX = vtmp;
|
sstVideoRez->tilesInX = vtmp;
|
||||||
}
|
}
|
||||||
@@ -285,13 +289,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
// Setup video fifo
|
// Setup video fifo
|
||||||
// NOTE: Lower values for the video fifo threshold improve video fifo
|
// NOTE: Lower values for the video fifo threshold improve video fifo
|
||||||
// underflow problems
|
// underflow problems
|
||||||
if(GETENV(("SSTV2_VFIFO_THRESH"))) {
|
envp = GETENV(("SSTV2_VFIFO_THRESH"));
|
||||||
|
if(envp) {
|
||||||
|
envval = ATOI(GETENV(("SSTV2_VFIFO_THRESH")));
|
||||||
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
||||||
sstVideoRez->vFifoThreshold, ATOI(GETENV(("SSTV2_VFIFO_THRESH")))));
|
sstVideoRez->vFifoThreshold, envval));
|
||||||
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
||||||
|
(envval << SST_VIDEO_FIFO_THRESH_SHIFT));
|
||||||
((ATOI(GETENV(("SSTV2_VFIFO_THRESH"))))
|
|
||||||
<< SST_VIDEO_FIFO_THRESH_SHIFT));
|
|
||||||
} else {
|
} else {
|
||||||
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
||||||
|
|
||||||
@@ -318,16 +322,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
memFifoLwm = 23;
|
memFifoLwm = 23;
|
||||||
if(GETENV(("SSTV2_MEMFIFO_LWM")) &&
|
envp = GETENV(("SSTV2_MEMFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoLwm = vtmp;
|
memFifoLwm = vtmp;
|
||||||
memFifoHwm = 54;
|
memFifoHwm = 54;
|
||||||
if(GETENV(("SSTV2_MEMFIFO_HWM")) &&
|
envp = GETENV(("SSTV2_MEMFIFO_HWM"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMFIFO_HWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoHwm = vtmp;
|
memFifoHwm = vtmp;
|
||||||
pciFifoLwm = 13;
|
pciFifoLwm = 13;
|
||||||
if(GETENV(("SSTV2_PCIFIFO_LWM")) &&
|
envp = GETENV(("SSTV2_PCIFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SSTV2_PCIFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
pciFifoLwm = vtmp;
|
pciFifoLwm = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
||||||
pciFifoLwm, memFifoLwm, memFifoHwm));
|
pciFifoLwm, memFifoLwm, memFifoHwm));
|
||||||
@@ -368,8 +372,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
// Enable Memory Fifo...
|
// Enable Memory Fifo...
|
||||||
if(GETENV(("SSTV2_MEMFIFO")))
|
envp = GETENV(("SSTV2_MEMFIFO"));
|
||||||
n = ATOI(GETENV(("SSTV2_MEMFIFO")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
@@ -385,8 +390,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
memFifoEntries));
|
memFifoEntries));
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_MEMFIFO_ENTRIES")) &&
|
envp = GETENV(("SSTV2_MEMFIFO_ENTRIES"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMFIFO_ENTRIES")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoEntries = vtmp;
|
memFifoEntries = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
||||||
65536 - (memFifoEntries << 5)));
|
65536 - (memFifoEntries << 5)));
|
||||||
@@ -404,13 +409,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
vInClkDel = 1;
|
vInClkDel = 1;
|
||||||
if(GETENV(("SSTV2_VIN_CLKDEL")) &&
|
envp = GETENV(("SSTV2_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIN_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vInClkDel = vtmp;
|
vInClkDel = vtmp;
|
||||||
|
|
||||||
vOutClkDel = 0;
|
vOutClkDel = 0;
|
||||||
if(GETENV(("SSTV2_VOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_VOUT_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vOutClkDel = vtmp;
|
vOutClkDel = vtmp;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
||||||
@@ -475,8 +480,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
if(!GETENV(("SSTV2_VIDEO_FILTER_DISABLE"))) {
|
if(!GETENV(("SSTV2_VIDEO_FILTER_DISABLE"))) {
|
||||||
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
||||||
if(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")) &&
|
envp = GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")), "%i", &vtmp) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", vtmp));
|
||||||
ISET(sst->videoFilterRgbThreshold, vtmp);
|
ISET(sst->videoFilterRgbThreshold, vtmp);
|
||||||
} else
|
} else
|
||||||
@@ -557,8 +562,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
|
|
||||||
// Adjust Video Clock
|
// Adjust Video Clock
|
||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
if(GETENV(("SSTV2_VIDCLK2X")) &&
|
envp = GETENV(("SSTV2_VIDCLK2X"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIDCLK2X")), "%f", &vidClkFreq) == 1)) {
|
if(envp &&
|
||||||
|
(SSCANF(envp, "%f", &vidClkFreq) == 1)) {
|
||||||
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
} else {
|
} else {
|
||||||
@@ -606,8 +612,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
FxU32 clearColor = 0x0;
|
FxU32 clearColor = 0x0;
|
||||||
FxU32 pagesToFill;
|
FxU32 pagesToFill;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_VIDEO_CLEARCOLOR")) &&
|
envp = GETENV(("SSTV2_VIDEO_CLEARCOLOR"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIDEO_CLEARCOLOR")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
clearColor = vtmp;
|
clearColor = vtmp;
|
||||||
|
|
||||||
if(sst1CurrentBoard->fbiMemSize == 1)
|
if(sst1CurrentBoard->fbiMemSize == 1)
|
||||||
@@ -1017,10 +1023,12 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
{
|
{
|
||||||
GrScreenResolution_t screenRez = screenResolution;
|
GrScreenResolution_t screenRez = screenResolution;
|
||||||
GrScreenRefresh_t refreshRate = screenRefresh;
|
GrScreenRefresh_t refreshRate = screenRefresh;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
// Override Screen resolution with environment variables
|
// Override Screen resolution with environment variables
|
||||||
if(GETENV(("SSTV2_SCREENREZ"))) {
|
envp = GETENV(("SSTV2_SCREENREZ"));
|
||||||
FxU32 screenRezEnv = ATOI(GETENV(("SSTV2_SCREENREZ")));
|
if(envp) {
|
||||||
|
FxI32 screenRezEnv = ATOI(envp);
|
||||||
|
|
||||||
switch(screenRezEnv) {
|
switch(screenRezEnv) {
|
||||||
case 512256:
|
case 512256:
|
||||||
@@ -1051,8 +1059,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Override Screen resolution with environment variables
|
// Override Screen resolution with environment variables
|
||||||
if(GETENV(("SSTV2_SCREENREFRESH"))) {
|
envp = GETENV(("SSTV2_SCREENREFRESH"));
|
||||||
FxU32 refreshRateEnv = ATOI(GETENV(("SSTV2_SCREENREFRESH")));
|
if(envp) {
|
||||||
|
FxI32 refreshRateEnv = ATOI(envp);
|
||||||
|
|
||||||
switch(refreshRateEnv) {
|
switch(refreshRateEnv) {
|
||||||
case 75:
|
case 75:
|
||||||
@@ -1077,9 +1086,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_512x384):
|
case(GR_RESOLUTION_512x384):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_512x384"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_512x384") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_512x384") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_512X384_120);
|
return(&SST_VREZ_512X384_120);
|
||||||
@@ -1102,9 +1111,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_640x400):
|
case(GR_RESOLUTION_640x400):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_640x400"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_640x400") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x400") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_640X400_120);
|
return(&SST_VREZ_640X400_120);
|
||||||
@@ -1117,9 +1126,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_640x480):
|
case(GR_RESOLUTION_640x480):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_640x480"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_640x480") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x480") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_640X480_120);
|
return(&SST_VREZ_640X480_120);
|
||||||
@@ -1132,9 +1141,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_800x600):
|
case(GR_RESOLUTION_800x600):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_800x600"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_800x600") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_800x600") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_800X600_120);
|
return(&SST_VREZ_800X600_120);
|
||||||
@@ -1151,8 +1160,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_960x720):
|
case(GR_RESOLUTION_960x720):
|
||||||
if( GETENV( ("SSTV2_REFRESH_960x720") ) )
|
envp = GETENV(("SSTV2_REFRESH_960x720"));
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_960x720") ) ) );
|
if(envp)
|
||||||
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_85Hz)
|
if(refreshRate == GR_REFRESH_85Hz)
|
||||||
return(&SST_VREZ_960X720_85);
|
return(&SST_VREZ_960X720_85);
|
||||||
@@ -1163,9 +1173,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_1024x768):
|
case(GR_RESOLUTION_1024x768):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_1024x768"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_1024x768") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_1024x768") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_85Hz)
|
if(refreshRate == GR_REFRESH_85Hz)
|
||||||
return(&SST_VREZ_1024X768_85);
|
return(&SST_VREZ_1024X768_85);
|
||||||
@@ -1249,6 +1259,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase)
|
|||||||
FxU32 gammaArray[32];
|
FxU32 gammaArray[32];
|
||||||
FxU32 j, k;
|
FxU32 j, k;
|
||||||
FxU32 gammaCorrectConstant = 0x5c;
|
FxU32 gammaCorrectConstant = 0x5c;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
@@ -1264,8 +1275,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase)
|
|||||||
// return (FXTRUE);
|
// return (FXTRUE);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if(GETENV(("SSTV2_MDETECT_CONST")) &&
|
envp = GETENV(("SSTV2_MDETECT_CONST"));
|
||||||
(SSCANF(GETENV(("SSTV2_MDETECT_CONST")), "%i", &j) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &j) == 1)) {
|
||||||
gammaCorrectConstant = j;
|
gammaCorrectConstant = j;
|
||||||
INIT_PRINTF(("sst1InitMonitorDetect(): Using value 0x%x for constant gamma value...\n", gammaCorrectConstant));
|
INIT_PRINTF(("sst1InitMonitorDetect(): Using value 0x%x for constant gamma value...\n", gammaCorrectConstant));
|
||||||
}
|
}
|
||||||
@@ -1316,11 +1327,10 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Override with environment variable...
|
// Override with environment variable...
|
||||||
if(GETENV(("SSTV2_MDETECT")))
|
envp = GETENV(("SSTV2_MDETECT"));
|
||||||
sst1CurrentBoard->monitorDetected =
|
if(envp)
|
||||||
(ATOI(GETENV(("SSTV2_MDETECT")))) ? 1 : 0;
|
sst1CurrentBoard->monitorDetected = (ATOI(envp)) ? 1 : 0;
|
||||||
|
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
@@ -1335,6 +1345,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase)
|
|||||||
{
|
{
|
||||||
FxU32 tf0_clkdel, tf1_clkdel, tf2_clkdel, ft_clkdel;
|
FxU32 tf0_clkdel, tf1_clkdel, tf2_clkdel, ft_clkdel;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(sst1CurrentBoard->fbiBoardID == 0x3) {
|
if(sst1CurrentBoard->fbiBoardID == 0x3) {
|
||||||
@@ -1430,17 +1441,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase)
|
|||||||
setDelays:
|
setDelays:
|
||||||
|
|
||||||
// Override with environment variables
|
// Override with environment variables
|
||||||
if(GETENV(("SSTV2_FT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_FT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_FT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
ft_clkdel = i;
|
ft_clkdel = i;
|
||||||
if(GETENV(("SSTV2_TF0_CLKDEL")) &&
|
envp = GETENV(("SSTV2_TF0_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF0_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
tf0_clkdel = i;
|
tf0_clkdel = i;
|
||||||
if(GETENV(("SSTV2_TF1_CLKDEL")) &&
|
envp = GETENV(("SSTV2_TF1_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF1_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
tf1_clkdel = i;
|
tf1_clkdel = i;
|
||||||
if(GETENV(("SSTV2_TF2_CLKDEL")) &&
|
envp = GETENV(("SSTV2_TF2_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF2_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
tf2_clkdel = i;
|
tf2_clkdel = i;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitSetClkDelays(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clkdel));
|
INIT_PRINTF(("sst1InitSetClkDelays(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clkdel));
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ void
|
|||||||
_GlideInitEnvironment( void )
|
_GlideInitEnvironment( void )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if ( _GlideRoot.initialized ) /* only execute once */
|
if ( _GlideRoot.initialized ) /* only execute once */
|
||||||
return;
|
return;
|
||||||
@@ -383,43 +384,44 @@ _GlideInitEnvironment( void )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
_GlideRoot.CPUType = _cpu_detect_asm();
|
_GlideRoot.CPUType = _cpu_detect_asm();
|
||||||
|
envp = getenv("FX_CPU");
|
||||||
|
if (envp) {
|
||||||
|
_GlideRoot.CPUType = atoi(envp);
|
||||||
|
}
|
||||||
|
|
||||||
if (getenv("FX_CPU")) _GlideRoot.CPUType = atoi(getenv("FX_CPU"));
|
_GlideRoot.environment.triBoundsCheck = (getenv("FX_GLIDE_BOUNDS_CHECK") != NULL);
|
||||||
_GlideRoot.environment.triBoundsCheck =
|
|
||||||
getenv("FX_GLIDE_BOUNDS_CHECK") != NULL;
|
|
||||||
_GlideRoot.environment.swapInterval = -1;
|
_GlideRoot.environment.swapInterval = -1;
|
||||||
_GlideRoot.environment.swFifoLWM = -1;
|
_GlideRoot.environment.swFifoLWM = -1;
|
||||||
#ifdef GLIDE_SPLASH
|
#ifdef GLIDE_SPLASH
|
||||||
_GlideRoot.environment.noSplash =
|
_GlideRoot.environment.noSplash = (getenv("FX_GLIDE_NO_SPLASH") != NULL);
|
||||||
getenv("FX_GLIDE_NO_SPLASH") != NULL;
|
|
||||||
#else
|
#else
|
||||||
_GlideRoot.environment.noSplash = 1;
|
_GlideRoot.environment.noSplash = 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef GLIDE_PLUG
|
#ifdef GLIDE_PLUG
|
||||||
_GlideRoot.environment.shamelessPlug =
|
_GlideRoot.environment.shamelessPlug = (getenv("FX_GLIDE_SHAMELESS_PLUG") != NULL);
|
||||||
getenv("FX_GLIDE_SHAMELESS_PLUG") != NULL;
|
|
||||||
#else
|
#else
|
||||||
_GlideRoot.environment.shamelessPlug = 0;
|
_GlideRoot.environment.shamelessPlug = 0;
|
||||||
#endif
|
#endif
|
||||||
if (getenv("FX_GLIDE_LWM"))
|
envp = getenv("FX_GLIDE_LWM");
|
||||||
_GlideRoot.environment.swFifoLWM = atoi(getenv("FX_GLIDE_LWM"));
|
if (envp) {
|
||||||
if (getenv("FX_GLIDE_SWAPINTERVAL")) {
|
_GlideRoot.environment.swFifoLWM = atoi(envp);
|
||||||
_GlideRoot.environment.swapInterval =
|
}
|
||||||
atoi(getenv("FX_GLIDE_SWAPINTERVAL"));
|
|
||||||
|
envp = getenv("FX_GLIDE_SWAPINTERVAL");
|
||||||
|
if (envp) {
|
||||||
|
_GlideRoot.environment.swapInterval = atoi(envp);
|
||||||
if (_GlideRoot.environment.swapInterval < 0)
|
if (_GlideRoot.environment.swapInterval < 0)
|
||||||
_GlideRoot.environment.swapInterval = 0;
|
_GlideRoot.environment.swapInterval = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getenv("FX_GLIDE_IGNORE_REOPEN"))
|
_GlideRoot.environment.ignoreReopen = (getenv("FX_GLIDE_IGNORE_REOPEN") != NULL);
|
||||||
_GlideRoot.environment.ignoreReopen = FXTRUE;
|
_GlideRoot.environment.disableDitherSub = (getenv("FX_GLIDE_NO_DITHER_SUB") != NULL);
|
||||||
|
|
||||||
if (getenv("FX_GLIDE_NO_DITHER_SUB")) {
|
envp = getenv("FX_SNAPSHOT");
|
||||||
_GlideRoot.environment.disableDitherSub = FXTRUE;
|
if (envp) {
|
||||||
|
_GlideRoot.environment.snapshot = atoi(envp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getenv("FX_SNAPSHOT"))
|
|
||||||
_GlideRoot.environment.snapshot = atoi(getenv("FX_SNAPSHOT"));
|
|
||||||
|
|
||||||
GDBG_INFO((80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck));
|
GDBG_INFO((80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck));
|
||||||
GDBG_INFO((80," swapInterval: %d\n",_GlideRoot.environment.swapInterval));
|
GDBG_INFO((80," swapInterval: %d\n",_GlideRoot.environment.swapInterval));
|
||||||
GDBG_INFO((80," noSplash: %d\n",_GlideRoot.environment.noSplash));
|
GDBG_INFO((80," noSplash: %d\n",_GlideRoot.environment.noSplash));
|
||||||
@@ -461,8 +463,6 @@ _GlideInitEnvironment( void )
|
|||||||
} /* _GlideInitEnvironment */
|
} /* _GlideInitEnvironment */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(GLIDE_DEBUG)
|
#if defined(GLIDE_DEBUG)
|
||||||
|
|
||||||
/* GMT: tracing utilities */
|
/* GMT: tracing utilities */
|
||||||
|
|||||||
@@ -753,9 +753,11 @@ void initSliPciOwner( FxU32 *regbase, FxU32 owner ) {
|
|||||||
FxU32 initNumBoardsInSystem(void)
|
FxU32 initNumBoardsInSystem(void)
|
||||||
{
|
{
|
||||||
FxU32 numBoards, j, n;
|
FxU32 numBoards, j, n;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if(getenv(("SST_BOARDS"))) {
|
envp = getenv(("SST_BOARDS"));
|
||||||
numBoards = atoi(getenv(("SST_BOARDS")));
|
if(envp != NULL) {
|
||||||
|
numBoards = atoi(envp);
|
||||||
} else {
|
} else {
|
||||||
numBoards = 0;
|
numBoards = 0;
|
||||||
#if defined(SST1)
|
#if defined(SST1)
|
||||||
|
|||||||
@@ -602,9 +602,11 @@ Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu,
|
|||||||
FxU32 *TmuMemorySize)
|
FxU32 *TmuMemorySize)
|
||||||
{
|
{
|
||||||
FxU32 data;
|
FxU32 data;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if(myGetenv(("SST96_TMUMEM_SIZE"))) {
|
envp = myGetenv(("SST96_TMUMEM_SIZE"));
|
||||||
*TmuMemorySize = atoi(myGetenv(("SST96_TMUMEM_SIZE")));
|
if(envp) {
|
||||||
|
*TmuMemorySize = atoi(envp);
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
SET(sstPtr->trexInit0, 0x05441);
|
SET(sstPtr->trexInit0, 0x05441);
|
||||||
@@ -941,14 +943,17 @@ init96SetupRendering(InitRegisterDesc *regDesc, GrScreenResolution_t sRes)
|
|||||||
GDBG_INFO((80, "%s: Setting TMU FT & TF delays\n", FN_NAME));
|
GDBG_INFO((80, "%s: Setting TMU FT & TF delays\n", FN_NAME));
|
||||||
{
|
{
|
||||||
FxU32 trexinit0, trexinit1;
|
FxU32 trexinit0, trexinit1;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if( !myGetenv(("SST_TREX0INIT0")) ||
|
envp = myGetenv(("SST_TREX0INIT0"));
|
||||||
(sscanf(myGetenv(("SST_TREX0INIT0")), "%i", &trexinit0) != 1) ) {
|
if( !envp ||
|
||||||
|
(sscanf(envp, "%i", &trexinit0) != 1) ) {
|
||||||
trexinit0 = 0x05441; /* TREXINIT0 */
|
trexinit0 = 0x05441; /* TREXINIT0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !myGetenv(("SST_TREX0INIT1")) ||
|
envp = myGetenv(("SST_TREX0INIT1"));
|
||||||
(sscanf(myGetenv(("SST_TREX0INIT1")), "%i", &trexinit1) != 1) ) {
|
if( !envp ||
|
||||||
|
(sscanf(envp, "%i", &trexinit1) != 1) ) {
|
||||||
trexinit1 = 0x3643c; /* TREXINIT1 */
|
trexinit1 = 0x3643c; /* TREXINIT1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2072,6 +2077,7 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes,
|
|||||||
InitBufDesc_t *pTriple = NULL;
|
InitBufDesc_t *pTriple = NULL;
|
||||||
InitBufDesc_t *pAux = NULL;
|
InitBufDesc_t *pAux = NULL;
|
||||||
InitBufDesc_t *pFifo = NULL;
|
InitBufDesc_t *pFifo = NULL;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n",
|
GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n",
|
||||||
@@ -2120,10 +2126,11 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes,
|
|||||||
GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n",
|
GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n",
|
||||||
pFront, pBack, pTriple, pAux, pFifo));
|
pFront, pBack, pTriple, pAux, pFifo));
|
||||||
|
|
||||||
if (myGetenv("SST96_FORCEALIGN")) {
|
envp = myGetenv("SST96_FORCEALIGN");
|
||||||
|
if (envp) {
|
||||||
FxU32 F, B, T, A;
|
FxU32 F, B, T, A;
|
||||||
|
|
||||||
if (sscanf(myGetenv("SST96_FORCEALIGN"), "%x,%x,%x,%x", &F, &B, &T, &A) == 4)
|
if (sscanf(envp, "%x,%x,%x,%x", &F, &B, &T, &A) == 4)
|
||||||
{
|
{
|
||||||
GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n"));
|
GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n"));
|
||||||
pFront->bufOffset = F;
|
pFront->bufOffset = F;
|
||||||
|
|||||||
@@ -615,6 +615,7 @@ INITAT3DENTRY(initAT3DSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefre
|
|||||||
#if defined(__DOS32__)
|
#if defined(__DOS32__)
|
||||||
union REGS r, rOut;
|
union REGS r, rOut;
|
||||||
#endif
|
#endif
|
||||||
|
const char *envp;
|
||||||
FxBool
|
FxBool
|
||||||
fixVsync = FXFALSE,
|
fixVsync = FXFALSE,
|
||||||
rv = FXTRUE;
|
rv = FXTRUE;
|
||||||
@@ -734,18 +735,19 @@ INITAT3DENTRY(initAT3DSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
envp = myGetenv("INIT96_AT3D_VSYNC_END");
|
||||||
if (myGetenv("INIT96_AT3D_VSYNC_END")) {
|
if (envp) {
|
||||||
FxU16 vSyncEnd = 3;
|
FxU16 vSyncEnd = 3;
|
||||||
GDBG_INFO((80, "%s: Setting VSync End\n", FN_NAME));
|
GDBG_INFO((80, "%s: Setting VSync End\n", FN_NAME));
|
||||||
vSyncEnd = atoi(myGetenv("INIT96_AT3D_VSYNC_END"));
|
vSyncEnd = atoi(envp);
|
||||||
CRTC_SET(CC_VSYNC_END, vSyncEnd);
|
CRTC_SET(CC_VSYNC_END, vSyncEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myGetenv("INIT96_AT3D_VSYNC_START")) {
|
envp = myGetenv("INIT96_AT3D_VSYNC_START");
|
||||||
|
if (envp) {
|
||||||
FxU16 vSyncStart = 0;
|
FxU16 vSyncStart = 0;
|
||||||
GDBG_INFO((80, "%s: Setting VSync Start\n", FN_NAME));
|
GDBG_INFO((80, "%s: Setting VSync Start\n", FN_NAME));
|
||||||
vSyncStart = atoi(myGetenv("INIT96_AT3D_VSYNC_START"));
|
vSyncStart = atoi(envp);
|
||||||
CRTC_SET(CC_VSYNC_START, vSyncStart);
|
CRTC_SET(CC_VSYNC_START, vSyncStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -451,13 +451,15 @@ FxBool sst1InitDacDetectICS(FxU32 * sstbase)
|
|||||||
FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase)
|
FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase)
|
||||||
{
|
{
|
||||||
FxU32 clkFreq;
|
FxU32 clkFreq;
|
||||||
|
const char *e;
|
||||||
|
|
||||||
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SST_GRXCLK"))) {
|
e = GETENV(("SST_GRXCLK"));
|
||||||
|
if(e) {
|
||||||
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
||||||
clkFreq = ATOI(GETENV(("SST_GRXCLK")));
|
clkFreq = ATOI(e);
|
||||||
if(clkFreq < 16)
|
if(clkFreq < 16)
|
||||||
clkFreq = 16;
|
clkFreq = 16;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -64,24 +64,29 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGamma(FxU32 *sstbase, double gamma)
|
|||||||
gammaB = gamma;
|
gammaB = gamma;
|
||||||
|
|
||||||
if(calledBefore == FXFALSE) {
|
if(calledBefore == FXFALSE) {
|
||||||
|
const char *envp;
|
||||||
calledBefore = FXTRUE;
|
calledBefore = FXTRUE;
|
||||||
if(GETENV(("SST_RGAMMA"))) {
|
envp = GETENV(("SST_RGAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideR = FXTRUE;
|
overRideR = FXTRUE;
|
||||||
gammaR = (double) ATOF(GETENV(("SST_RGAMMA")));
|
gammaR = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_GGAMMA"))) {
|
envp = GETENV(("SST_GGAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideG = FXTRUE;
|
overRideG = FXTRUE;
|
||||||
gammaG = (double) ATOF(GETENV(("SST_GGAMMA")));
|
gammaG = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_BGAMMA"))) {
|
envp = GETENV(("SST_BGAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideB = FXTRUE;
|
overRideB = FXTRUE;
|
||||||
gammaB = (double) ATOF(GETENV(("SST_BGAMMA")));
|
gammaB = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_GAMMA"))) {
|
envp = GETENV(("SST_GAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideR = FXTRUE;
|
overRideR = FXTRUE;
|
||||||
overRideG = FXTRUE;
|
overRideG = FXTRUE;
|
||||||
overRideB = FXTRUE;
|
overRideB = FXTRUE;
|
||||||
gammaR = (double) ATOF(GETENV(("SST_GAMMA")));
|
gammaR = (double) ATOF(envp);
|
||||||
gammaG = gammaR;
|
gammaG = gammaR;
|
||||||
gammaB = gammaR;
|
gammaB = gammaR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ static char *setRange(char *buf, int val)
|
|||||||
return buf + pos; // and return rest of string
|
return buf + pos; // and return rest of string
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse(char *env)
|
static void parse(const char *env)
|
||||||
{
|
{
|
||||||
int level, pos;
|
int level, pos;
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ FX_EXPORT void FX_CSTYLE
|
|||||||
gdbg_init(void)
|
gdbg_init(void)
|
||||||
{
|
{
|
||||||
static int done=0; // only execute once
|
static int done=0; // only execute once
|
||||||
char *env;
|
const char *env;
|
||||||
|
|
||||||
if (done) return;
|
if (done) return;
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
int i, x=0, y=0;
|
int i, x=0, y=0;
|
||||||
FxU32 r_sum, g_sum, b_sum;
|
FxU32 r_sum, g_sum, b_sum;
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
/* set trex's (all 3) to output configuration bits */
|
/* set trex's (all 3) to output configuration bits */
|
||||||
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
||||||
@@ -187,8 +188,8 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SST_TMUCFG")) &&
|
envp = GETENV(("SST_TMUCFG"));
|
||||||
(SSCANF(GETENV(("SST_TMUCFG")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
info->tmuConfig = i;
|
info->tmuConfig = i;
|
||||||
|
|
||||||
/* reset trex's init registers */
|
/* reset trex's init registers */
|
||||||
@@ -241,11 +242,13 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
|||||||
{
|
{
|
||||||
FxU32 i,data;
|
FxU32 i,data;
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||||
|
|
||||||
if(GETENV(("SST_TMUMEM_SIZE"))) {
|
envp = GETENV(("SST_TMUMEM_SIZE"));
|
||||||
*TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
if(envp) {
|
||||||
|
*TmuMemorySize = ATOI(envp);
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,9 +355,10 @@ static int fbiMemSize(FxU32 *sstbase)
|
|||||||
FxU32 init1Save = IGET(sst->fbiInit1);
|
FxU32 init1Save = IGET(sst->fbiInit1);
|
||||||
FxU32 init2Save = IGET(sst->fbiInit2);
|
FxU32 init2Save = IGET(sst->fbiInit2);
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
const char *envp = GETENV(("SST_FBIMEM_SIZE"));
|
||||||
|
|
||||||
if(GETENV(("SST_FBIMEM_SIZE")))
|
if(envp)
|
||||||
return(ATOI(GETENV(("SST_FBIMEM_SIZE"))));
|
return ATOI(envp);
|
||||||
|
|
||||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||||
/* for rendering */
|
/* for rendering */
|
||||||
@@ -450,12 +454,13 @@ FX_EXPORT FxBool FX_CSTYLE
|
|||||||
sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||||
{
|
{
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
info->fbiMemSize = fbiMemSize(sstbase);
|
info->fbiMemSize = fbiMemSize(sstbase);
|
||||||
|
|
||||||
/* Detect board identification and memory speed */
|
/* Detect board identification and memory speed */
|
||||||
if(!GETENV(("SST_FBICFG")) ||
|
envp = GETENV(("SST_FBICFG"));
|
||||||
(SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig) != 1))
|
if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1))
|
||||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||||
SST_FBI_MEM_TYPE_SHIFT;
|
SST_FBI_MEM_TYPE_SHIFT;
|
||||||
|
|
||||||
@@ -502,14 +507,15 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
if(GETENV(("SST_NODEVICEINFO"))) {
|
if(GETENV(("SST_NODEVICEINFO"))) {
|
||||||
/* fill device info struct with sane values... */
|
/* fill device info struct with sane values... */
|
||||||
|
const char *envp;
|
||||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||||
|
|
||||||
if(!GETENV(("SST_FBICFG")) ||
|
envp = GETENV(("SST_FBICFG"));
|
||||||
(SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig) != 1))
|
if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1))
|
||||||
info->fbiConfig = 0x0;
|
info->fbiConfig = 0x0;
|
||||||
|
|
||||||
if(!GETENV(("SST_TMUCFG")) ||
|
envp = GETENV(("SST_TMUCFG"));
|
||||||
(SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig) != 1))
|
if(!envp || (SSCANF(envp, "%i", &info->tmuConfig) != 1))
|
||||||
info->tmuConfig = 0x0;
|
info->tmuConfig = 0x0;
|
||||||
|
|
||||||
info->numberTmus = 1;
|
info->numberTmus = 1;
|
||||||
@@ -520,13 +526,15 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
info->tmuRevision = info->tmuConfig & 0x7;
|
info->tmuRevision = info->tmuConfig & 0x7;
|
||||||
|
|
||||||
if(GETENV(("SST_FBIMEM_SIZE")))
|
envp = GETENV(("SST_FBIMEM_SIZE"));
|
||||||
info->fbiMemSize = ATOI(GETENV(("SST_FBIMEM_SIZE")));
|
if(envp)
|
||||||
|
info->fbiMemSize = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->fbiMemSize = 2;
|
info->fbiMemSize = 2;
|
||||||
|
|
||||||
if(GETENV(("SST_TMUMEM_SIZE")))
|
envp = GETENV(("SST_TMUMEM_SIZE"));
|
||||||
info->tmuMemSize[0] = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
if(envp)
|
||||||
|
info->tmuMemSize[0] = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->tmuMemSize[0] = 2;
|
info->tmuMemSize[0] = 2;
|
||||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...)
|
|||||||
static FxBool printIt = FXFALSE;
|
static FxBool printIt = FXFALSE;
|
||||||
|
|
||||||
if(firstPass == FXTRUE) {
|
if(firstPass == FXTRUE) {
|
||||||
|
const char *envf;
|
||||||
firstPass = FXFALSE;
|
firstPass = FXFALSE;
|
||||||
if (sst1InitMsgFile == NULL)
|
if (sst1InitMsgFile == NULL)
|
||||||
{
|
{
|
||||||
@@ -50,11 +51,12 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...)
|
|||||||
}
|
}
|
||||||
if(GETENV(("SST_INITDEBUG")))
|
if(GETENV(("SST_INITDEBUG")))
|
||||||
printIt = FXTRUE;
|
printIt = FXTRUE;
|
||||||
if(GETENV(("SST_INITDEBUG_FILE"))) {
|
envf = GETENV(("SST_INITDEBUG_FILE"));
|
||||||
if((sst1InitMsgFile = fopen(GETENV(("SST_INITDEBUG_FILE")), "w")))
|
if(envf) {
|
||||||
|
if((sst1InitMsgFile = fopen(envf, "w")) != NULL)
|
||||||
printIt = FXTRUE;
|
printIt = FXTRUE;
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", GETENV(("SST_INITDEBUG_FILE")));
|
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", envf);
|
||||||
printIt = FXFALSE;
|
printIt = FXFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
FxU32 masterPVOutClkDel, slavePVOutClkDel;
|
FxU32 masterPVOutClkDel, slavePVOutClkDel;
|
||||||
FxU32 pciFifoLwm, memFifoLwm;
|
FxU32 pciFifoLwm, memFifoLwm;
|
||||||
FxU32 clkFreqMaster;
|
FxU32 clkFreqMaster;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Check to make sure master and slave are installed properly */
|
/* Check to make sure master and slave are installed properly */
|
||||||
@@ -141,14 +142,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
slaveVInClkDel = 2;
|
slaveVInClkDel = 2;
|
||||||
slaveVOutClkDel = 0;
|
slaveVOutClkDel = 0;
|
||||||
slavePVOutClkDel = 3;
|
slavePVOutClkDel = 3;
|
||||||
if(GETENV(("SST_SLIS_VOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIS_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVOutClkDel = i;
|
slaveVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIS_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIS_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slavePVOutClkDel = i;
|
slavePVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIS_VIN_CLKDEL")) &&
|
envp = GETENV(("SST_SLIS_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVInClkDel = i;
|
slaveVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
||||||
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
||||||
@@ -265,14 +266,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
masterVInClkDel = 2;
|
masterVInClkDel = 2;
|
||||||
masterVOutClkDel = 0;
|
masterVOutClkDel = 0;
|
||||||
masterPVOutClkDel = 3;
|
masterPVOutClkDel = 3;
|
||||||
if(GETENV(("SST_SLIM_VOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIM_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVOutClkDel = i;
|
masterVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIM_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIM_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterPVOutClkDel = i;
|
masterPVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIM_VIN_CLKDEL")) &&
|
envp = GETENV(("SST_SLIM_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVInClkDel = i;
|
masterVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
||||||
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
||||||
@@ -374,8 +375,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
/* Clear Screen */
|
/* Clear Screen */
|
||||||
FxU32 clearColor = 0x0;
|
FxU32 clearColor = 0x0;
|
||||||
|
|
||||||
if(GETENV(("SST_VIDEO_CLEARCOLOR")) &&
|
envp = GETENV(("SST_VIDEO_CLEARCOLOR"));
|
||||||
(SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
clearColor = i;
|
clearColor = i;
|
||||||
ISET(sstMaster->c1, clearColor);
|
ISET(sstMaster->c1, clearColor);
|
||||||
ISET(sstMaster->c0, clearColor);
|
ISET(sstMaster->c0, clearColor);
|
||||||
@@ -531,9 +532,11 @@ FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase)
|
|||||||
volatile Sstregs *sst;
|
volatile Sstregs *sst;
|
||||||
|
|
||||||
if(firstTime) {
|
if(firstTime) {
|
||||||
|
const char *envp;
|
||||||
firstTime = 0;
|
firstTime = 0;
|
||||||
if(GETENV(("SST_SLIDETECT")))
|
envp = GETENV(("SST_SLIDETECT"));
|
||||||
sliDetected = ATOI(GETENV(("SST_SLIDETECT")));
|
if(envp)
|
||||||
|
sliDetected = ATOI(envp);
|
||||||
else {
|
else {
|
||||||
PCICFG_RD(PCI_REVISION_ID, fbiRev);
|
PCICFG_RD(PCI_REVISION_ID, fbiRev);
|
||||||
sst = (Sstregs *) sstbase;
|
sst = (Sstregs *) sstbase;
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
FxU32 ft_clk_del, tf0_clk_del, tf1_clk_del, tf2_clk_del;
|
FxU32 ft_clk_del, tf0_clk_del, tf1_clk_del, tf2_clk_del;
|
||||||
sst1ClkTimingStruct sstGrxClk;
|
sst1ClkTimingStruct sstGrxClk;
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
@@ -319,8 +320,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
|
|
||||||
/* Adjust Fbi-to-Trex clock delay value */
|
/* Adjust Fbi-to-Trex clock delay value */
|
||||||
/* Adjust Trex-to-Fbi FIFO */
|
/* Adjust Trex-to-Fbi FIFO */
|
||||||
if(!GETENV(("SST_TF_FIFO_THRESH")) ||
|
envp = GETENV(("SST_TF_FIFO_THRESH"));
|
||||||
(SSCANF(GETENV(("SST_TF_FIFO_THRESH")), "%i", &tf_fifo_thresh) != 1))
|
if(!envp || (SSCANF(envp, "%i", &tf_fifo_thresh) != 1))
|
||||||
tf_fifo_thresh = 0x8;
|
tf_fifo_thresh = 0x8;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
||||||
tf_fifo_thresh));
|
tf_fifo_thresh));
|
||||||
@@ -331,8 +332,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
else
|
else
|
||||||
/* .6 micron */
|
/* .6 micron */
|
||||||
ft_clk_del = 0xa; /* Okay for 16 MHz startup... */
|
ft_clk_del = 0xa; /* Okay for 16 MHz startup... */
|
||||||
if(GETENV(("SST_PFT_CLK_DEL")) &&
|
envp = GETENV(("SST_PFT_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
ft_clk_del = i;
|
ft_clk_del = i;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del));
|
INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del));
|
||||||
ISET(sst->fbiInit3,
|
ISET(sst->fbiInit3,
|
||||||
@@ -391,23 +392,21 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set TREX0 init values */
|
/* set TREX0 init values */
|
||||||
if(GETENV(("SST_TREX0INIT0")) &&
|
envp = GETENV(("SST_TREX0INIT0"));
|
||||||
(SSCANF(GETENV(("SST_TREX0INIT0")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[0]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit0[0]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[0]));
|
sst1CurrentBoard->tmuInit0[0]));
|
||||||
if(GETENV(("SST_TREX0INIT1")) &&
|
envp = GETENV(("SST_TREX0INIT1"));
|
||||||
(SSCANF(GETENV(("SST_TREX0INIT1")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[0]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit1[0]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
||||||
if(GETENV(("SST_PTF0_CLK_DEL")) &&
|
envp = GETENV(("SST_PTF0_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PTF0_CLK_DEL")), "%i", &tf0_clk_del) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf0_clk_del) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf0_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf0_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -421,22 +420,20 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* set TREX1 init values */
|
/* set TREX1 init values */
|
||||||
if(GETENV(("SST_TREX1INIT0")) &&
|
envp = GETENV(("SST_TREX1INIT0"));
|
||||||
(SSCANF(GETENV(("SST_TREX1INIT0")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[1]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit0[1]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[1]));
|
sst1CurrentBoard->tmuInit0[1]));
|
||||||
if(GETENV(("SST_TREX1INIT1")) &&
|
envp = GETENV(("SST_TREX1INIT1"));
|
||||||
(SSCANF(GETENV(("SST_TREX1INIT1")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[1]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit1[1]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
||||||
if(GETENV(("SST_PTF1_CLK_DEL")) &&
|
envp = GETENV(("SST_PTF1_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PTF1_CLK_DEL")), "%i", &tf1_clk_del) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf1_clk_del) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf1_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf1_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -450,22 +447,20 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* set TREX2 init values */
|
/* set TREX2 init values */
|
||||||
if(GETENV(("SST_TREX2INIT0")) &&
|
envp = GETENV(("SST_TREX2INIT0"));
|
||||||
(SSCANF(GETENV(("SST_TREX2INIT0")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[2]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit0[2]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[2]));
|
sst1CurrentBoard->tmuInit0[2]));
|
||||||
if(GETENV(("SST_TREX2INIT1")) &&
|
envp = GETENV(("SST_TREX2INIT1"));
|
||||||
(SSCANF(GETENV(("SST_TREX2INIT1")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[2]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit1[2]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
||||||
if(GETENV(("SST_PTF2_CLK_DEL")) &&
|
envp = GETENV(("SST_PTF2_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PTF2_CLK_DEL")), "%i", &tf2_clk_del) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf2_clk_del) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf2_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf2_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -523,8 +518,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
if(GETENV(("SST_FASTMEM")))
|
envp = GETENV(("SST_FASTMEM"));
|
||||||
n = ATOI(GETENV(("SST_FASTMEM")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
@@ -562,8 +558,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* LFB writes stored in memory FIFO? */
|
/* LFB writes stored in memory FIFO? */
|
||||||
if(GETENV(("SST_MEMFIFO_LFB")))
|
envp = GETENV(("SST_MEMFIFO_LFB"));
|
||||||
n = ATOI(GETENV(("SST_MEMFIFO_LFB")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -573,8 +570,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Texture memory writes stored in memory FIFO? */
|
/* Texture memory writes stored in memory FIFO? */
|
||||||
if(GETENV(("SST_MEMFIFO_TEX")))
|
envp = GETENV(("SST_MEMFIFO_TEX"));
|
||||||
n = ATOI(GETENV(("SST_MEMFIFO_TEX")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -692,13 +690,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase)
|
|||||||
if(sst1InitShutdownSli(sstbase) == FXFALSE)
|
if(sst1InitShutdownSli(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __DOS32__
|
#ifdef __DOS32__
|
||||||
/*
|
/*
|
||||||
* HACK alert. -MS
|
* HACK alert. -MS
|
||||||
*
|
*
|
||||||
* There's a pciClose(), but nobody calls it. This is needed by the
|
* There's a pciClose(), but nobody calls it. This is needed by the
|
||||||
* DOS DPMI services to close fxmemmap.vxd.
|
* DOS DPMI services to close fxmemmap.vxd.
|
||||||
*
|
*
|
||||||
* We need to move this to the "appropriate" place, wherever that may be.
|
* We need to move this to the "appropriate" place, wherever that may be.
|
||||||
*/
|
*/
|
||||||
pciClose();
|
pciClose();
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
float vidClkFreq;
|
float vidClkFreq;
|
||||||
#endif
|
#endif
|
||||||
|
const char *envp;
|
||||||
|
int envval;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
@@ -163,32 +165,34 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Override settings with environment variables */
|
/* Override settings with environment variables */
|
||||||
if(GETENV(("SST_SCREENREZ"))) {
|
envp = GETENV(("SST_SCREENREZ"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) {
|
if(envp) {
|
||||||
|
envval = ATOI(envp);
|
||||||
|
if(envval == 640) {
|
||||||
sst1MonitorRez = 640;
|
sst1MonitorRez = 640;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 640;
|
sst1CurrentBoard->fbiVideoWidth = 640;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 480;
|
sst1CurrentBoard->fbiVideoHeight = 480;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) {
|
} else if(envval == 640400) {
|
||||||
sst1MonitorRez = 640400;
|
sst1MonitorRez = 640400;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 640;
|
sst1CurrentBoard->fbiVideoWidth = 640;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 400;
|
sst1CurrentBoard->fbiVideoHeight = 400;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) {
|
} else if(envval == 800) {
|
||||||
sst1MonitorRez = 800;
|
sst1MonitorRez = 800;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 800;
|
sst1CurrentBoard->fbiVideoWidth = 800;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 600;
|
sst1CurrentBoard->fbiVideoHeight = 600;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) {
|
} else if(envval == 512256) {
|
||||||
sst1MonitorRez = 512256;
|
sst1MonitorRez = 512256;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 512;
|
sst1CurrentBoard->fbiVideoWidth = 512;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 256;
|
sst1CurrentBoard->fbiVideoHeight = 256;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) {
|
} else if(envval == 512) {
|
||||||
sst1MonitorRez = 512;
|
sst1MonitorRez = 512;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 512;
|
sst1CurrentBoard->fbiVideoWidth = 512;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 384;
|
sst1CurrentBoard->fbiVideoHeight = 384;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) {
|
} else if(envval == 856) {
|
||||||
sst1MonitorRez = 856;
|
sst1MonitorRez = 856;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 856;
|
sst1CurrentBoard->fbiVideoWidth = 856;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 480;
|
sst1CurrentBoard->fbiVideoHeight = 480;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) {
|
} else if(envval == 960) {
|
||||||
sst1MonitorRez = 960;
|
sst1MonitorRez = 960;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 960;
|
sst1CurrentBoard->fbiVideoWidth = 960;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 720;
|
sst1CurrentBoard->fbiVideoHeight = 720;
|
||||||
@@ -198,16 +202,18 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1CurrentBoard->fbiVideoHeight = 480;
|
sst1CurrentBoard->fbiVideoHeight = 480;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_SCREENREFRESH"))) {
|
envp = GETENV(("SST_SCREENREFRESH"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60)
|
if(envp) {
|
||||||
|
envval = ATOI(envp);
|
||||||
|
if(envval == 60)
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72)
|
else if(envval == 72)
|
||||||
sst1MonitorRefresh = 72;
|
sst1MonitorRefresh = 72;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75)
|
else if(envval == 75)
|
||||||
sst1MonitorRefresh = 75;
|
sst1MonitorRefresh = 75;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85)
|
else if(envval == 85)
|
||||||
sst1MonitorRefresh = 85;
|
sst1MonitorRefresh = 85;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120)
|
else if(envval == 120)
|
||||||
sst1MonitorRefresh = 120;
|
sst1MonitorRefresh = 120;
|
||||||
else
|
else
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
@@ -303,9 +309,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1CurrentBoard->fbiVideoRefresh = sst1MonitorRefresh;
|
sst1CurrentBoard->fbiVideoRefresh = sst1MonitorRefresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GETENV(("SST_VIDEO_24BPP")))
|
envp = GETENV(("SST_VIDEO_24BPP"));
|
||||||
sst1CurrentBoard->fbiVideo16BPP =
|
if(envp)
|
||||||
(ATOI(GETENV(("SST_VIDEO_24BPP")))) ^ 0x1;
|
sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1;
|
||||||
else {
|
else {
|
||||||
sst1CurrentBoard->fbiVideo16BPP = 0;
|
sst1CurrentBoard->fbiVideo16BPP = 0;
|
||||||
|
|
||||||
@@ -357,30 +363,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup SST video timing registers */
|
/* Setup SST video timing registers */
|
||||||
if(GETENV(("SST_HSYNC")) &&
|
envp = GETENV(("SST_HSYNC"));
|
||||||
(SSCANF(GETENV(("SST_HSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->hSync, vtmp);
|
ISET(sst->hSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SST_VSYNC")) &&
|
envp = GETENV(("SST_VSYNC"));
|
||||||
(SSCANF(GETENV(("SST_VSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->vSync, vtmp);
|
ISET(sst->vSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SST_BACKPORCH")) &&
|
envp = GETENV(("SST_BACKPORCH"));
|
||||||
(SSCANF(GETENV(("SST_BACKPORCH")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
||||||
ISET(sst->backPorch, vtmp);
|
ISET(sst->backPorch, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->backPorch,
|
ISET(sst->backPorch,
|
||||||
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
||||||
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
||||||
if(GETENV(("SST_DIMENSIONS")) &&
|
envp = GETENV(("SST_DIMENSIONS"));
|
||||||
(SSCANF(GETENV(("SST_DIMENSIONS")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
||||||
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
||||||
sstVideoRez->xDimension = vtmp & 0x3ff;
|
sstVideoRez->xDimension = vtmp & 0x3ff;
|
||||||
@@ -388,13 +394,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
ISET(sst->videoDimensions,
|
ISET(sst->videoDimensions,
|
||||||
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
||||||
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
||||||
if(GETENV(("SST_MEMOFFSET")) &&
|
envp = GETENV(("SST_MEMOFFSET"));
|
||||||
(SSCANF(GETENV(("SST_MEMOFFSET")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
||||||
sstVideoRez->memOffset = vtmp;
|
sstVideoRez->memOffset = vtmp;
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_TILESINX")) &&
|
envp = GETENV(("SST_TILESINX"));
|
||||||
(SSCANF(GETENV(("SST_TILESINX")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
||||||
sstVideoRez->tilesInX_Over2 = vtmp;
|
sstVideoRez->tilesInX_Over2 = vtmp;
|
||||||
}
|
}
|
||||||
@@ -418,12 +424,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
/* Setup video fifo */
|
/* Setup video fifo */
|
||||||
/* NOTE: Lower values for the video fifo threshold improve video fifo */
|
/* NOTE: Lower values for the video fifo threshold improve video fifo */
|
||||||
/* underflow problems */
|
/* underflow problems */
|
||||||
if(GETENV(("SST_VFIFO_THRESH"))) {
|
envp = GETENV(("SST_VFIFO_THRESH"));
|
||||||
|
if(envp) {
|
||||||
|
envval = ATOI(envp);
|
||||||
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
||||||
sstVideoRez->vFifoThreshold, ATOI(GETENV(("SST_VFIFO_THRESH")))));
|
sstVideoRez->vFifoThreshold, envval));
|
||||||
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
||||||
((ATOI(GETENV(("SST_VFIFO_THRESH"))))
|
(envval << SST_VIDEO_FIFO_THRESH_SHIFT));
|
||||||
<< SST_VIDEO_FIFO_THRESH_SHIFT));
|
|
||||||
} else {
|
} else {
|
||||||
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
||||||
|
|
||||||
@@ -448,16 +455,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
memFifoLwm = 23;
|
memFifoLwm = 23;
|
||||||
if(GETENV(("SST_MEMFIFO_LWM")) &&
|
envp = GETENV(("SST_MEMFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SST_MEMFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoLwm = vtmp;
|
memFifoLwm = vtmp;
|
||||||
memFifoHwm = 54;
|
memFifoHwm = 54;
|
||||||
if(GETENV(("SST_MEMFIFO_HWM")) &&
|
envp = GETENV(("SST_MEMFIFO_HWM"));
|
||||||
(SSCANF(GETENV(("SST_MEMFIFO_HWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoHwm = vtmp;
|
memFifoHwm = vtmp;
|
||||||
pciFifoLwm = 13;
|
pciFifoLwm = 13;
|
||||||
if(GETENV(("SST_PCIFIFO_LWM")) &&
|
envp = GETENV(("SST_PCIFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SST_PCIFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
pciFifoLwm = vtmp;
|
pciFifoLwm = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
||||||
pciFifoLwm, memFifoLwm, memFifoHwm));
|
pciFifoLwm, memFifoLwm, memFifoHwm));
|
||||||
@@ -502,8 +509,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* Enable Memory Fifo... */
|
/* Enable Memory Fifo... */
|
||||||
if(GETENV(("SST_MEMFIFO")))
|
envp = GETENV(("SST_MEMFIFO"));
|
||||||
n = ATOI(GETENV(("SST_MEMFIFO")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
@@ -519,8 +527,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
memFifoEntries = sstVideoRez->memFifoEntries_2MB;
|
memFifoEntries = sstVideoRez->memFifoEntries_2MB;
|
||||||
else
|
else
|
||||||
memFifoEntries = sstVideoRez->memFifoEntries_4MB;
|
memFifoEntries = sstVideoRez->memFifoEntries_4MB;
|
||||||
if(GETENV(("SST_MEMFIFO_ENTRIES")) &&
|
envp = GETENV(("SST_MEMFIFO_ENTRIES"));
|
||||||
(SSCANF(GETENV(("SST_MEMFIFO_ENTRIES")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoEntries = vtmp;
|
memFifoEntries = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
||||||
0xffff - (memFifoEntries << 5)));
|
0xffff - (memFifoEntries << 5)));
|
||||||
@@ -545,16 +553,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
vInClkDel = 2;
|
vInClkDel = 2;
|
||||||
if(sst1CurrentBoard->fbiRevision == 2)
|
if(sst1CurrentBoard->fbiRevision == 2)
|
||||||
vInClkDel = 0;
|
vInClkDel = 0;
|
||||||
if(GETENV(("SST_VIN_CLKDEL")) &&
|
envp = GETENV(("SST_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_VIN_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vInClkDel = vtmp;
|
vInClkDel = vtmp;
|
||||||
|
|
||||||
if(sst1CurrentBoard->fbiRevision == 2)
|
if(sst1CurrentBoard->fbiRevision == 2)
|
||||||
vOutClkDel = 2;
|
vOutClkDel = 2;
|
||||||
else
|
else
|
||||||
vOutClkDel = 0;
|
vOutClkDel = 0;
|
||||||
if(GETENV(("SST_VOUT_CLKDEL")) &&
|
envp = GETENV(("SST_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_VOUT_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vOutClkDel = vtmp;
|
vOutClkDel = vtmp;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
||||||
@@ -588,8 +596,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
if(!GETENV(("SST_VIDEO_FILTER_DISABLE"))) {
|
if(!GETENV(("SST_VIDEO_FILTER_DISABLE"))) {
|
||||||
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
||||||
if(GETENV(("SST_VIDEO_FILTER_THRESHOLD")) &&
|
envp = GETENV(("SST_VIDEO_FILTER_THRESHOLD"));
|
||||||
(SSCANF(GETENV(("SST_VIDEO_FILTER_THRESHOLD")), "%i", &n) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &n) == 1)) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n));
|
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n));
|
||||||
ISET(sst->videoFilterRgbThreshold, n);
|
ISET(sst->videoFilterRgbThreshold, n);
|
||||||
} else
|
} else
|
||||||
@@ -656,17 +664,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Override with environment variables */
|
/* Override with environment variables */
|
||||||
if(GETENV(("SST_FT_CLK_DEL")) &&
|
envp = GETENV(("SST_FT_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_FT_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
ft_clk_del = vtmp;
|
ft_clk_del = vtmp;
|
||||||
if(GETENV(("SST_TF0_CLK_DEL")) &&
|
envp = GETENV(("SST_TF0_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_TF0_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
tf0_clk_del = vtmp;
|
tf0_clk_del = vtmp;
|
||||||
if(GETENV(("SST_TF1_CLK_DEL")) &&
|
envp = GETENV(("SST_TF1_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_TF1_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
tf1_clk_del = vtmp;
|
tf1_clk_del = vtmp;
|
||||||
if(GETENV(("SST_TF2_CLK_DEL")) &&
|
envp = GETENV(("SST_TF2_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_TF2_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
tf2_clk_del = vtmp;
|
tf2_clk_del = vtmp;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitVideo(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clk_del));
|
INIT_PRINTF(("sst1InitVideo(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clk_del));
|
||||||
@@ -708,8 +716,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
|
|
||||||
/* Adjust Video Clock */
|
/* Adjust Video Clock */
|
||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
if(GETENV(("SST_VIDCLK2X")) &&
|
envp = GETENV(("SST_VIDCLK2X"));
|
||||||
(SSCANF(GETENV(("SST_VIDCLK2X")), "%f", &vidClkFreq) == 1) ) {
|
if(envp && (SSCANF(envp, "%f", &vidClkFreq) == 1) ) {
|
||||||
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
} else {
|
} else {
|
||||||
@@ -750,8 +758,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
/* Clear Screen */
|
/* Clear Screen */
|
||||||
FxU32 clearColor = 0x0;
|
FxU32 clearColor = 0x0;
|
||||||
|
|
||||||
if(GETENV(("SST_VIDEO_CLEARCOLOR")) &&
|
envp = GETENV(("SST_VIDEO_CLEARCOLOR"));
|
||||||
(SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
clearColor = vtmp;
|
clearColor = vtmp;
|
||||||
ISET(sst->c1, clearColor);
|
ISET(sst->c1, clearColor);
|
||||||
ISET(sst->c0, clearColor);
|
ISET(sst->c0, clearColor);
|
||||||
@@ -796,6 +804,8 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre
|
|||||||
sst1VideoTimingStruct *sstVideoRez = NULL;
|
sst1VideoTimingStruct *sstVideoRez = NULL;
|
||||||
FxU32 sst1MonitorRefresh;
|
FxU32 sst1MonitorRefresh;
|
||||||
FxU32 sst1MonitorRez;
|
FxU32 sst1MonitorRez;
|
||||||
|
const char *envp;
|
||||||
|
int envval;
|
||||||
|
|
||||||
switch(screenResolution) {
|
switch(screenResolution) {
|
||||||
case(GR_RESOLUTION_512x256):
|
case(GR_RESOLUTION_512x256):
|
||||||
@@ -866,35 +876,39 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Override settings with environment variables */
|
/* Override settings with environment variables */
|
||||||
if(GETENV(("SST_SCREENREZ"))) {
|
envp = GETENV(("SST_SCREENREZ"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) {
|
if(envp) {
|
||||||
|
envval = ATOI(GETENV(("SST_SCREENREZ")));
|
||||||
|
if(envval == 640) {
|
||||||
sst1MonitorRez = 640;
|
sst1MonitorRez = 640;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) {
|
} else if(envval == 640400) {
|
||||||
sst1MonitorRez = 640400;
|
sst1MonitorRez = 640400;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) {
|
} else if(envval == 800) {
|
||||||
sst1MonitorRez = 800;
|
sst1MonitorRez = 800;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) {
|
} else if(envval == 512256) {
|
||||||
sst1MonitorRez = 512256;
|
sst1MonitorRez = 512256;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) {
|
} else if(envval == 512) {
|
||||||
sst1MonitorRez = 512;
|
sst1MonitorRez = 512;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) {
|
} else if(envval == 856) {
|
||||||
sst1MonitorRez = 856;
|
sst1MonitorRez = 856;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) {
|
} else if(envval == 960) {
|
||||||
sst1MonitorRez = 960;
|
sst1MonitorRez = 960;
|
||||||
} else {
|
} else {
|
||||||
sst1MonitorRez = 640;
|
sst1MonitorRez = 640;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_SCREENREFRESH"))) {
|
envp = GETENV(("SST_SCREENREFRESH"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60)
|
if(envp) {
|
||||||
|
envval = ATOI(GETENV(("SST_SCREENREFRESH")));
|
||||||
|
if(envval == 60)
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72)
|
else if(envval == 72)
|
||||||
sst1MonitorRefresh = 72;
|
sst1MonitorRefresh = 72;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75)
|
else if(envval == 75)
|
||||||
sst1MonitorRefresh = 75;
|
sst1MonitorRefresh = 75;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85)
|
else if(envval == 85)
|
||||||
sst1MonitorRefresh = 85;
|
sst1MonitorRefresh = 85;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120)
|
else if(envval == 120)
|
||||||
sst1MonitorRefresh = 120;
|
sst1MonitorRefresh = 120;
|
||||||
else
|
else
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
|
|||||||
@@ -474,13 +474,15 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase)
|
|||||||
{
|
{
|
||||||
FxU32 clkFreq;
|
FxU32 clkFreq;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *e;
|
||||||
|
|
||||||
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SSTV2_GRXCLK"))) {
|
e = GETENV(("SSTV2_GRXCLK"));
|
||||||
|
if(e) {
|
||||||
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
||||||
clkFreq = ATOI(GETENV(("SSTV2_GRXCLK")));
|
clkFreq = ATOI(e);
|
||||||
if(clkFreq < 16)
|
if(clkFreq < 16)
|
||||||
clkFreq = 16;
|
clkFreq = 16;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -92,19 +92,23 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase,
|
|||||||
|
|
||||||
/* Get the user set definitions (cp or environment) */
|
/* Get the user set definitions (cp or environment) */
|
||||||
if(!calledBefore) {
|
if(!calledBefore) {
|
||||||
|
const char *envp;
|
||||||
calledBefore = FXTRUE;
|
calledBefore = FXTRUE;
|
||||||
|
envp = GETENV(("SSTV2_RGAMMA"));
|
||||||
if(GETENV(("SSTV2_RGAMMA"))) {
|
if(envp) {
|
||||||
userGammaR = (double) ATOF(GETENV(("SSTV2_RGAMMA")));
|
userGammaR = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_GGAMMA"))) {
|
envp = GETENV(("SSTV2_GGAMMA"));
|
||||||
userGammaG = (double) ATOF(GETENV(("SSTV2_GGAMMA")));
|
if(envp) {
|
||||||
|
userGammaG = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_BGAMMA"))) {
|
envp = GETENV(("SSTV2_BGAMMA"));
|
||||||
userGammaB = (double) ATOF(GETENV(("SSTV2_BGAMMA")));
|
if(envp) {
|
||||||
|
userGammaB = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_GAMMA"))) {
|
envp = GETENV(("SSTV2_GAMMA"));
|
||||||
userGammaR = (double) ATOF(GETENV(("SSTV2_GAMMA")));
|
if(envp) {
|
||||||
|
userGammaR = (double) ATOF(envp);
|
||||||
userGammaG = userGammaR;
|
userGammaG = userGammaR;
|
||||||
userGammaB = userGammaR;
|
userGammaB = userGammaR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ FX_EXPORT void FX_CSTYLE
|
|||||||
gdbg_init(void)
|
gdbg_init(void)
|
||||||
{
|
{
|
||||||
static int done=0; // only execute once
|
static int done=0; // only execute once
|
||||||
char *env;
|
const char *env;
|
||||||
|
|
||||||
if (done) return;
|
if (done) return;
|
||||||
|
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
FxU32 r_sum, g_sum, b_sum;
|
FxU32 r_sum, g_sum, b_sum;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
FxU32 tmuRevision;
|
FxU32 tmuRevision;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
/* set trex's (all 3) to output configuration bits */
|
/* set trex's (all 3) to output configuration bits */
|
||||||
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
||||||
@@ -233,10 +234,11 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]);
|
ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1]);
|
||||||
ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]);
|
ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]);
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMUCFG")))
|
envp = GETENV(("SSTV2_TMUCFG"));
|
||||||
|
if(envp)
|
||||||
{
|
{
|
||||||
FxU32 u;
|
FxU32 u;
|
||||||
if (SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1)
|
if (SSCANF(envp, "%u", &u) == 1)
|
||||||
info->tmuConfig = u;
|
info->tmuConfig = u;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,11 +289,13 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
|||||||
{
|
{
|
||||||
FxU32 i,data;
|
FxU32 i,data;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
|
envp = GETENV(("SSTV2_TMU_MEMSIZE"));
|
||||||
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
if(envp) {
|
||||||
|
*TmuMemorySize = ATOI(envp);
|
||||||
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
|
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
|
||||||
* second RAS so that apps which may incorrectly store data in the
|
* second RAS so that apps which may incorrectly store data in the
|
||||||
* upper 2 Mbytes will not function properly... */
|
* upper 2 Mbytes will not function properly... */
|
||||||
@@ -344,6 +348,7 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
|||||||
FX_EXPORT FxBool FX_CSTYLE
|
FX_EXPORT FxBool FX_CSTYLE
|
||||||
sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||||
{
|
{
|
||||||
|
const char *envp;
|
||||||
FxU32 trev;
|
FxU32 trev;
|
||||||
|
|
||||||
if(initSumTables(sstbase) == FXFALSE)
|
if(initSumTables(sstbase) == FXFALSE)
|
||||||
@@ -388,8 +393,9 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
if (GETENV(("SSTV2_NUM_TMUS")))
|
envp = GETENV(("SSTV2_NUM_TMUS"));
|
||||||
info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
|
if (envp)
|
||||||
|
info->numberTmus = ATOI(envp);
|
||||||
|
|
||||||
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
@@ -415,9 +421,10 @@ static int fbiMemSize(FxU32 *sstbase)
|
|||||||
FxU32 init1Save = IGET(sst->fbiInit1);
|
FxU32 init1Save = IGET(sst->fbiInit1);
|
||||||
FxU32 init2Save = IGET(sst->fbiInit2);
|
FxU32 init2Save = IGET(sst->fbiInit2);
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
const char *envp = GETENV(("SSTV2_FBI_MEMSIZE"));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
if(envp)
|
||||||
return(ATOI(GETENV(("SSTV2_FBI_MEMSIZE"))));
|
return ATOI(envp);
|
||||||
|
|
||||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||||
/* for rendering */
|
/* for rendering */
|
||||||
@@ -510,12 +517,13 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
{
|
{
|
||||||
FxU32 u;
|
FxU32 u;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
info->fbiMemSize = fbiMemSize(sstbase);
|
info->fbiMemSize = fbiMemSize(sstbase);
|
||||||
|
|
||||||
/* Detect board identification and memory speed */
|
/* Detect board identification and memory speed */
|
||||||
if(GETENV(("SSTV2_FBICFG")) &&
|
envp = GETENV(("SSTV2_FBICFG"));
|
||||||
(SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1))
|
if(envp && (SSCANF(envp, "%u", &u) == 1))
|
||||||
info->fbiConfig = u;
|
info->fbiConfig = u;
|
||||||
else
|
else
|
||||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||||
@@ -567,16 +575,17 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
if(GETENV(("SSTV2_NODEVICEINFO"))) {
|
if(GETENV(("SSTV2_NODEVICEINFO"))) {
|
||||||
/* fill device info struct with sane values... */
|
/* fill device info struct with sane values... */
|
||||||
|
const char *envp;
|
||||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_FBICFG")) &&
|
envp = GETENV(("SSTV2_FBICFG"));
|
||||||
(SSCANF(GETENV(("SSTV2_FBICFG")), "%u", &u) == 1))
|
if(envp && (SSCANF(envp, "%u", &u) == 1))
|
||||||
info->fbiConfig = u;
|
info->fbiConfig = u;
|
||||||
else
|
else
|
||||||
info->fbiConfig = 0x0;
|
info->fbiConfig = 0x0;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMUCFG")) &&
|
envp = GETENV(("SSTV2_TMUCFG"));
|
||||||
(SSCANF(GETENV(("SSTV2_TMUCFG")), "%u", &u) == 1))
|
if(envp && (SSCANF(envp, "%u", &u) == 1))
|
||||||
info->tmuConfig = u;
|
info->tmuConfig = u;
|
||||||
else
|
else
|
||||||
info->tmuConfig = 0x0;
|
info->tmuConfig = 0x0;
|
||||||
@@ -589,13 +598,15 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
info->tmuRevision = info->tmuConfig & 0x7;
|
info->tmuRevision = info->tmuConfig & 0x7;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_FBI_MEMSIZE")))
|
envp = GETENV(("SSTV2_FBI_MEMSIZE"));
|
||||||
info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
|
if(envp)
|
||||||
|
info->fbiMemSize = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->fbiMemSize = 2;
|
info->fbiMemSize = 2;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_TMU_MEMSIZE")))
|
envp = GETENV(("SSTV2_TMU_MEMSIZE"));
|
||||||
info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
|
if(envp)
|
||||||
|
info->tmuMemSize[0] = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->tmuMemSize[0] = 2;
|
info->tmuMemSize[0] = 2;
|
||||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||||
|
|||||||
@@ -49,15 +49,17 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...)
|
|||||||
static FxBool printIt = FXFALSE;
|
static FxBool printIt = FXFALSE;
|
||||||
|
|
||||||
if(firstPass == FXTRUE) {
|
if(firstPass == FXTRUE) {
|
||||||
|
const char *envf;
|
||||||
sst1InitMsgFile = stdout;
|
sst1InitMsgFile = stdout;
|
||||||
firstPass = FXFALSE;
|
firstPass = FXFALSE;
|
||||||
if(GETENV(("SSTV2_INITDEBUG")) || GDBG_GET_DEBUGLEVEL(5))
|
if(GETENV(("SSTV2_INITDEBUG")) || GDBG_GET_DEBUGLEVEL(5))
|
||||||
printIt = FXTRUE;
|
printIt = FXTRUE;
|
||||||
if(GETENV(("SSTV2_INITDEBUG_FILE"))) {
|
envf = GETENV(("SSTV2_INITDEBUG_FILE"));
|
||||||
printIt = ((sst1InitMsgFile = fopen(GETENV(("SSTV2_INITDEBUG_FILE")), "w")) != NULL);
|
if(envf) {
|
||||||
|
printIt = ((sst1InitMsgFile = fopen(envf, "w")) != NULL);
|
||||||
if (!printIt) {
|
if (!printIt) {
|
||||||
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n",
|
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n",
|
||||||
GETENV(("SSTV2_INITDEBUG_FILE")));
|
envf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
FxU32 videoWindowActive = 0x1;
|
FxU32 videoWindowActive = 0x1;
|
||||||
FxU32 videoWindowActiveDrag = 0xf;
|
FxU32 videoWindowActiveDrag = 0xf;
|
||||||
sst1DeviceInfoStruct *sst1M, *sst1S;
|
sst1DeviceInfoStruct *sst1M, *sst1S;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(sst1InitCheckBoard(sstbase1) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase1) == FXFALSE)
|
||||||
@@ -107,8 +108,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
initIdleEnabled = 1;
|
initIdleEnabled = 1;
|
||||||
|
|
||||||
// User override of swap algorithm...
|
// User override of swap algorithm...
|
||||||
if(GETENV(("SSTV2_SLISWAP"))) {
|
envp = GETENV(("SSTV2_SLISWAP"));
|
||||||
FxU32 swapAlg = ATOI(GETENV(("SSTV2_SLISWAP")));
|
if(envp) {
|
||||||
|
FxU32 swapAlg = ATOI(envp);
|
||||||
|
|
||||||
if(swapAlg == 1) {
|
if(swapAlg == 1) {
|
||||||
INIT_PRINTF(("sst1InitSli(): Using dac_data[0] for swapping(%d, %d)...\n", videoWindowActive, videoWindowActiveDrag));
|
INIT_PRINTF(("sst1InitSli(): Using dac_data[0] for swapping(%d, %d)...\n", videoWindowActive, videoWindowActiveDrag));
|
||||||
@@ -238,14 +240,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
slaveVOutClkDel = 0;
|
slaveVOutClkDel = 0;
|
||||||
slavePVOutClkDel = 0;
|
slavePVOutClkDel = 0;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_SLIS_VOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIS_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIS_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVOutClkDel = i;
|
slaveVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIS_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIS_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slavePVOutClkDel = i;
|
slavePVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIS_VIN_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIS_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIS_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVInClkDel = i;
|
slaveVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
||||||
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
||||||
@@ -390,14 +392,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
masterVInClkDel = 3;
|
masterVInClkDel = 3;
|
||||||
masterVOutClkDel = 2;
|
masterVOutClkDel = 2;
|
||||||
masterPVOutClkDel = 0;
|
masterPVOutClkDel = 0;
|
||||||
if(GETENV(("SSTV2_SLIM_VOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIM_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIM_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVOutClkDel = i;
|
masterVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIM_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIM_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterPVOutClkDel = i;
|
masterPVOutClkDel = i;
|
||||||
if(GETENV(("SSTV2_SLIM_VIN_CLKDEL")) &&
|
envp = GETENV(("SSTV2_SLIM_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_SLIM_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVInClkDel = i;
|
masterVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
||||||
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
||||||
@@ -708,9 +710,11 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdownSli(FxU32 *sstbase)
|
|||||||
FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase)
|
FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase)
|
||||||
{
|
{
|
||||||
FxU32 sliDetected;
|
FxU32 sliDetected;
|
||||||
|
const char * envp;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_SLIDETECT")))
|
envp = GETENV(("SSTV2_SLIDETECT"));
|
||||||
sliDetected = ATOI(GETENV(("SSTV2_SLIDETECT")));
|
if(envp)
|
||||||
|
sliDetected = ATOI(envp);
|
||||||
else
|
else
|
||||||
sliDetected = sst1InitSliPaired(sstbase);
|
sliDetected = sst1InitSliPaired(sstbase);
|
||||||
|
|
||||||
|
|||||||
@@ -198,10 +198,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
|||||||
FxU32 *sstbase;
|
FxU32 *sstbase;
|
||||||
FxU32 j, n;
|
FxU32 j, n;
|
||||||
FxU32 sstv2_noremap = 0;
|
FxU32 sstv2_noremap = 0;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if( GETENV( ("SSTV2_DEVICEID") ) &&
|
envp = GETENV(("SSTV2_DEVICEID"));
|
||||||
(SSCANF(GETENV(("SSTV2_DEVICEID")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
deviceID = i;
|
deviceID = i;
|
||||||
else
|
else
|
||||||
deviceID = 0x0002;
|
deviceID = 0x0002;
|
||||||
@@ -228,8 +229,8 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
|||||||
// Find "voodoo2.ini" file if it exists...
|
// Find "voodoo2.ini" file if it exists...
|
||||||
sst1InitUseVoodooFile = sst1InitVoodooFile();
|
sst1InitUseVoodooFile = sst1InitVoodooFile();
|
||||||
|
|
||||||
if( GETENV( ("SSTV2_NOREMAP") ) &&
|
envp = GETENV(("SSTV2_NOREMAP"));
|
||||||
(SSCANF(GETENV(("SSTV2_NOREMAP")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
sstv2_noremap = i;
|
sstv2_noremap = i;
|
||||||
else
|
else
|
||||||
sstv2_noremap = 0;
|
sstv2_noremap = 0;
|
||||||
@@ -392,10 +393,11 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
|||||||
sst1BoardInfo[BoardNumber].vgaPassthruEnable = 0x0;
|
sst1BoardInfo[BoardNumber].vgaPassthruEnable = 0x0;
|
||||||
sst1BoardInfo[BoardNumber].fbiVideo16BPP = 0;
|
sst1BoardInfo[BoardNumber].fbiVideo16BPP = 0;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_VGA_PASS"))) {
|
envp = GETENV(("SSTV2_VGA_PASS"));
|
||||||
INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n",
|
if(envp) {
|
||||||
ATOI(GETENV(("SSTV2_VGA_PASS")))));
|
i = ATOI(envp);
|
||||||
if(ATOI(GETENV(("SSTV2_VGA_PASS")))) {
|
INIT_PRINTF(("sst1InitMapBoard(): Using SST_VGA_PASS=%d\n", i));
|
||||||
|
if(i) {
|
||||||
sst1BoardInfo[BoardNumber].vgaPassthruEnable = SST_EN_VGA_PASSTHRU;
|
sst1BoardInfo[BoardNumber].vgaPassthruEnable = SST_EN_VGA_PASSTHRU;
|
||||||
sst1BoardInfo[BoardNumber].vgaPassthruDisable = 0x0;
|
sst1BoardInfo[BoardNumber].vgaPassthruDisable = 0x0;
|
||||||
} else {
|
} else {
|
||||||
@@ -422,6 +424,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
FxU32 ft_clkdel, tf0_clkdel, tf1_clkdel, tf2_clkdel;
|
FxU32 ft_clkdel, tf0_clkdel, tf1_clkdel, tf2_clkdel;
|
||||||
sst1ClkTimingStruct sstGrxClk;
|
sst1ClkTimingStruct sstGrxClk;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
@@ -457,16 +460,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitReturnStatus(sstbase);
|
sst1InitReturnStatus(sstbase);
|
||||||
|
|
||||||
// Adjust Trex-to-Fbi FIFO
|
// Adjust Trex-to-Fbi FIFO
|
||||||
if(GETENV(("SSTV2_TF_FIFO_THRESH")) &&
|
envp = GETENV(("SSTV2_TF_FIFO_THRESH"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF_FIFO_THRESH")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
tf_fifo_thresh = i;
|
tf_fifo_thresh = i;
|
||||||
else
|
else
|
||||||
tf_fifo_thresh = 0x8;
|
tf_fifo_thresh = 0x8;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
||||||
tf_fifo_thresh));
|
tf_fifo_thresh));
|
||||||
|
|
||||||
if(GETENV(("SSTV2_PFT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PFT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PFT_CLKDEL")), "%i", &i) == 1) )
|
if(envp && (SSCANF(envp, "%i", &i) == 1) )
|
||||||
ft_clkdel = i;
|
ft_clkdel = i;
|
||||||
else
|
else
|
||||||
ft_clkdel = 0x8; // Okay for 16 MHz startup...
|
ft_clkdel = 0x8; // Okay for 16 MHz startup...
|
||||||
@@ -532,8 +535,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set TREX0 init values
|
// set TREX0 init values
|
||||||
if(GETENV(("SSTV2_TREX0INIT0")) &&
|
envp = GETENV(("SSTV2_TREX0INIT0"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX0INIT0")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit0[0] = i;
|
sst1CurrentBoard->tmuInit0[0] = i;
|
||||||
} else
|
} else
|
||||||
@@ -541,15 +544,15 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[0]));
|
sst1CurrentBoard->tmuInit0[0]));
|
||||||
if(GETENV(("SSTV2_TREX0INIT1")) &&
|
envp = GETENV(("SSTV2_TREX0INIT1"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX0INIT1")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit1[0] = i;
|
sst1CurrentBoard->tmuInit1[0] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_PTF0_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PTF0_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PTF0_CLKDEL")), "%i", &tf0_clkdel) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &tf0_clkdel) == 1)) {
|
||||||
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf0_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf0_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -558,22 +561,22 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1CurrentBoard->tmuInit1[0]));
|
sst1CurrentBoard->tmuInit1[0]));
|
||||||
|
|
||||||
// set TREX1 init values
|
// set TREX1 init values
|
||||||
if(GETENV(("SSTV2_TREX1INIT0")) &&
|
envp = GETENV(("SSTV2_TREX1INIT0"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX1INIT0")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit0[1] = i;
|
sst1CurrentBoard->tmuInit0[1] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[1]));
|
sst1CurrentBoard->tmuInit0[1]));
|
||||||
if(GETENV(("SSTV2_TREX1INIT1")) &&
|
envp = GETENV(("SSTV2_TREX1INIT1"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX1INIT1")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit1[1] = i;
|
sst1CurrentBoard->tmuInit1[1] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
||||||
if(GETENV(("SSTV2_PTF1_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PTF1_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PTF1_CLKDEL")), "%i", &tf1_clkdel) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf1_clkdel) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf1_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf1_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -581,24 +584,23 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT1=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT1=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit1[1]));
|
sst1CurrentBoard->tmuInit1[1]));
|
||||||
|
|
||||||
|
|
||||||
// set TREX2 init values
|
// set TREX2 init values
|
||||||
if(GETENV(("SSTV2_TREX2INIT0")) &&
|
envp = GETENV(("SSTV2_TREX2INIT0"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX2INIT0")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit0[2] = i;
|
sst1CurrentBoard->tmuInit0[2] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[2]));
|
sst1CurrentBoard->tmuInit0[2]));
|
||||||
if(GETENV(("SSTV2_TREX2INIT1")) &&
|
envp = GETENV(("SSTV2_TREX2INIT1"));
|
||||||
(SSCANF(GETENV(("SSTV2_TREX2INIT1")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
||||||
sst1CurrentBoard->tmuInit1[2] = i;
|
sst1CurrentBoard->tmuInit1[2] = i;
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
||||||
if(GETENV(("SSTV2_PTF2_CLKDEL")) &&
|
envp = GETENV(("SSTV2_PTF2_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_PTF2_CLKDEL")), "%i", &tf2_clkdel) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf2_clkdel) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf2_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf2_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -705,8 +707,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
// LFB writes stored in memory FIFO?
|
// LFB writes stored in memory FIFO?
|
||||||
if(GETENV(("SSTV2_MEMFIFO_LFB")))
|
envp = GETENV(("SSTV2_MEMFIFO_LFB"));
|
||||||
n = ATOI(GETENV(("SSTV2_MEMFIFO_LFB")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -716,8 +719,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Texture memory writes stored in memory FIFO?
|
// Texture memory writes stored in memory FIFO?
|
||||||
if(GETENV(("SSTV2_MEMFIFO_TEX")))
|
envp = GETENV(("SSTV2_MEMFIFO_TEX"));
|
||||||
n = ATOI(GETENV(("SSTV2_MEMFIFO_TEX")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -1104,9 +1108,11 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void)
|
|||||||
FxU32 vendorID = _3DFX_PCI_ID; // 3Dfx Vendor ID
|
FxU32 vendorID = _3DFX_PCI_ID; // 3Dfx Vendor ID
|
||||||
FxU32 deviceID; // 0x0002 - Find Voodoo2 boards ( 0xFFFF - Find any 3Dfx board)
|
FxU32 deviceID; // 0x0002 - Find Voodoo2 boards ( 0xFFFF - Find any 3Dfx board)
|
||||||
FxU32 j, n;
|
FxU32 j, n;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if( GETENV( ("SSTV2_DEVICEID") ) )
|
envp = GETENV(("SSTV2_DEVICEID"));
|
||||||
deviceID = ATOI( GETENV( "SSTV2_DEVICEID" ) );
|
if(envp)
|
||||||
|
deviceID = ATOI(envp);
|
||||||
else
|
else
|
||||||
deviceID = 0x0002;
|
deviceID = 0x0002;
|
||||||
|
|
||||||
@@ -1115,8 +1121,9 @@ FX_ENTRY FxU32 FX_CSTYLE sst1InitNumBoardsInSystem(void)
|
|||||||
if(pciFindCardMulti(vendorID, deviceID, &n, j))
|
if(pciFindCardMulti(vendorID, deviceID, &n, j))
|
||||||
boardsInSystemReally++;
|
boardsInSystemReally++;
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_BOARDS")))
|
envp = GETENV(("SSTV2_BOARDS"));
|
||||||
return(ATOI(GETENV(("SSTV2_BOARDS"))));
|
if(envp)
|
||||||
|
return ATOI(envp);
|
||||||
else
|
else
|
||||||
return(boardsInSystemReally);
|
return(boardsInSystemReally);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -690,7 +690,7 @@ FX_ENTRY FxBool FX_CALL sst1InitCmdFifo(FxU32 *sstbase, FxBool enable,
|
|||||||
INIT_PRINTF(("sst1InitCmdFifo(): sst1InitCmdFifoDirect() failed...\n"));
|
INIT_PRINTF(("sst1InitCmdFifo(): sst1InitCmdFifoDirect() failed...\n"));
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sst1CurrentBoard->sliSlaveVirtAddr) {
|
if(sst1CurrentBoard->sliSlaveVirtAddr) {
|
||||||
if(!sst1InitCmdFifoDirect(sst1CurrentBoard->sliSlaveVirtAddr, 0,
|
if(!sst1InitCmdFifoDirect(sst1CurrentBoard->sliSlaveVirtAddr, 0,
|
||||||
fifoStart, fifoSize,
|
fifoStart, fifoSize,
|
||||||
@@ -969,6 +969,7 @@ FX_EXPORT void FX_CSTYLE sst1InitPrintInitRegs(FxU32 *sstbase)
|
|||||||
*/
|
*/
|
||||||
FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
||||||
{
|
{
|
||||||
|
const char *envp;
|
||||||
FxU32 n, siProcess, nandOsc, norOsc;
|
FxU32 n, siProcess, nandOsc, norOsc;
|
||||||
FxU32 pciCntrLoad = 0xfff;
|
FxU32 pciCntrLoad = 0xfff;
|
||||||
FxU32 cntr;
|
FxU32 cntr;
|
||||||
@@ -977,8 +978,8 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
|||||||
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SSTV2_SIPROCESS_CNTR")) &&
|
envp = GETENV(("SSTV2_SIPROCESS_CNTR"));
|
||||||
(SSCANF(GETENV(("SSTV2_SIPROCESS_CNTR")), "%i", &i) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &i) == 1) ) {
|
||||||
pciCntrLoad = i;
|
pciCntrLoad = i;
|
||||||
INIT_PRINTF(("sst1InitMeasureSiProcess(): Using PCI Counter preload value of 0x%x...\n", pciCntrLoad));
|
INIT_PRINTF(("sst1InitMeasureSiProcess(): Using PCI Counter preload value of 0x%x...\n", pciCntrLoad));
|
||||||
}
|
}
|
||||||
@@ -990,20 +991,20 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
|||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NAND_SEL);
|
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NAND_SEL);
|
||||||
|
|
||||||
// Allow oscillator to run...
|
// Allow oscillator to run...
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NAND_SEL);
|
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NAND_SEL);
|
||||||
|
|
||||||
// Loop until PCI counter decrements to 0
|
// Loop until PCI counter decrements to 0
|
||||||
cntr = 0 ;
|
cntr = 0 ;
|
||||||
do {
|
do {
|
||||||
++cntr;
|
++cntr;
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
||||||
|
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
||||||
nandOsc = siProcess;
|
nandOsc = siProcess;
|
||||||
@@ -1019,20 +1020,20 @@ FX_EXPORT FxU32 FX_CSTYLE sst1InitMeasureSiProcess(FxU32 *sstbase, FxU32 which)
|
|||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NOR_SEL);
|
SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NOR_SEL);
|
||||||
|
|
||||||
// Allow oscillator to run...
|
// Allow oscillator to run...
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
PCICFG_WR(SST1_PCI_SIPROCESS,
|
PCICFG_WR(SST1_PCI_SIPROCESS,
|
||||||
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
(pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
|
||||||
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NOR_SEL);
|
SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NOR_SEL);
|
||||||
|
|
||||||
// Loop until PCI counter decrements to 0
|
// Loop until PCI counter decrements to 0
|
||||||
cntr = 0 ;
|
cntr = 0 ;
|
||||||
do {
|
do {
|
||||||
++cntr;
|
++cntr;
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
} while(siProcess & SST_SIPROCESS_PCI_CNTR);
|
||||||
|
|
||||||
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
|
||||||
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
siProcess &= SST_SIPROCESS_OSC_CNTR;
|
||||||
norOsc = siProcess;
|
norOsc = siProcess;
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
float vidClkFreq;
|
float vidClkFreq;
|
||||||
#endif
|
#endif
|
||||||
|
const char *envp;
|
||||||
|
int envval;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
@@ -177,10 +179,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GETENV(("SSTV2_ALLOC_COLOR")))
|
envp = GETENV(("SSTV2_ALLOC_COLOR"));
|
||||||
nCol = ATOI(GETENV(("SSTV2_ALLOC_COLOR")));
|
if(envp)
|
||||||
if(GETENV(("SSTV2_ALLOC_AUX")))
|
nCol = ATOI(envp);
|
||||||
nAux = ATOI(GETENV(("SSTV2_ALLOC_AUX")));
|
envp = GETENV(("SSTV2_ALLOC_AUX"));
|
||||||
|
if(envp)
|
||||||
|
nAux = ATOI(envp);
|
||||||
|
|
||||||
// Disallow unsupported buffer combinations (from environment vars)...
|
// Disallow unsupported buffer combinations (from environment vars)...
|
||||||
if(nCol < 2 || nCol > 3 || nAux > 1)
|
if(nCol < 2 || nCol > 3 || nAux > 1)
|
||||||
@@ -193,9 +197,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
INIT_PRINTF(("sst1InitVideo(): Insufficient memory available for desired resolution.\n"));
|
INIT_PRINTF(("sst1InitVideo(): Insufficient memory available for desired resolution.\n"));
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_VIDEO_24BPP")))
|
envp = GETENV(("SSTV2_VIDEO_24BPP"));
|
||||||
sst1CurrentBoard->fbiVideo16BPP =
|
if(envp)
|
||||||
(ATOI(GETENV(("SSTV2_VIDEO_24BPP")))) ^ 0x1;
|
sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1;
|
||||||
else {
|
else {
|
||||||
sst1CurrentBoard->fbiVideo16BPP = 0;
|
sst1CurrentBoard->fbiVideo16BPP = 0;
|
||||||
|
|
||||||
@@ -220,30 +224,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET);
|
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET);
|
||||||
|
|
||||||
// Setup SST video timing registers
|
// Setup SST video timing registers
|
||||||
if(GETENV(("SSTV2_HSYNC")) &&
|
envp = GETENV(("SSTV2_HSYNC"));
|
||||||
(SSCANF(GETENV(("SSTV2_HSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->hSync, vtmp);
|
ISET(sst->hSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SSTV2_VSYNC")) &&
|
envp = GETENV(("SSTV2_VSYNC"));
|
||||||
(SSCANF(GETENV(("SSTV2_VSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->vSync, vtmp);
|
ISET(sst->vSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SSTV2_BACKPORCH")) &&
|
envp = GETENV(("SSTV2_BACKPORCH"));
|
||||||
(SSCANF(GETENV(("SSTV2_BACKPORCH")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
||||||
ISET(sst->backPorch, vtmp);
|
ISET(sst->backPorch, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->backPorch,
|
ISET(sst->backPorch,
|
||||||
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
||||||
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
||||||
if(GETENV(("SSTV2_DIMENSIONS")) &&
|
envp = GETENV(("SSTV2_DIMENSIONS"));
|
||||||
(SSCANF(GETENV(("SSTV2_DIMENSIONS")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
||||||
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
||||||
sstVideoRez->xDimension = vtmp & 0x3ff;
|
sstVideoRez->xDimension = vtmp & 0x3ff;
|
||||||
@@ -251,13 +255,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
ISET(sst->videoDimensions,
|
ISET(sst->videoDimensions,
|
||||||
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
||||||
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
||||||
if(GETENV(("SSTV2_MEMOFFSET")) &&
|
envp = GETENV(("SSTV2_MEMOFFSET"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMOFFSET")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
||||||
sstVideoRez->memOffset = vtmp;
|
sstVideoRez->memOffset = vtmp;
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_TILESINX")) &&
|
envp = GETENV(("SSTV2_TILESINX"));
|
||||||
(SSCANF(GETENV(("SSTV2_TILESINX")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
||||||
sstVideoRez->tilesInX = vtmp;
|
sstVideoRez->tilesInX = vtmp;
|
||||||
}
|
}
|
||||||
@@ -285,13 +289,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
// Setup video fifo
|
// Setup video fifo
|
||||||
// NOTE: Lower values for the video fifo threshold improve video fifo
|
// NOTE: Lower values for the video fifo threshold improve video fifo
|
||||||
// underflow problems
|
// underflow problems
|
||||||
if(GETENV(("SSTV2_VFIFO_THRESH"))) {
|
envp = GETENV(("SSTV2_VFIFO_THRESH"));
|
||||||
|
if(envp) {
|
||||||
|
envval = ATOI(GETENV(("SSTV2_VFIFO_THRESH")));
|
||||||
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
||||||
sstVideoRez->vFifoThreshold, ATOI(GETENV(("SSTV2_VFIFO_THRESH")))));
|
sstVideoRez->vFifoThreshold, envval));
|
||||||
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
||||||
|
(envval << SST_VIDEO_FIFO_THRESH_SHIFT));
|
||||||
((ATOI(GETENV(("SSTV2_VFIFO_THRESH"))))
|
|
||||||
<< SST_VIDEO_FIFO_THRESH_SHIFT));
|
|
||||||
} else {
|
} else {
|
||||||
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
||||||
|
|
||||||
@@ -318,16 +322,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
memFifoLwm = 23;
|
memFifoLwm = 23;
|
||||||
if(GETENV(("SSTV2_MEMFIFO_LWM")) &&
|
envp = GETENV(("SSTV2_MEMFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoLwm = vtmp;
|
memFifoLwm = vtmp;
|
||||||
memFifoHwm = 54;
|
memFifoHwm = 54;
|
||||||
if(GETENV(("SSTV2_MEMFIFO_HWM")) &&
|
envp = GETENV(("SSTV2_MEMFIFO_HWM"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMFIFO_HWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoHwm = vtmp;
|
memFifoHwm = vtmp;
|
||||||
pciFifoLwm = 13;
|
pciFifoLwm = 13;
|
||||||
if(GETENV(("SSTV2_PCIFIFO_LWM")) &&
|
envp = GETENV(("SSTV2_PCIFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SSTV2_PCIFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
pciFifoLwm = vtmp;
|
pciFifoLwm = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
||||||
pciFifoLwm, memFifoLwm, memFifoHwm));
|
pciFifoLwm, memFifoLwm, memFifoHwm));
|
||||||
@@ -368,8 +372,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
// Enable Memory Fifo...
|
// Enable Memory Fifo...
|
||||||
if(GETENV(("SSTV2_MEMFIFO")))
|
envp = GETENV(("SSTV2_MEMFIFO"));
|
||||||
n = ATOI(GETENV(("SSTV2_MEMFIFO")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
@@ -385,8 +390,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
memFifoEntries));
|
memFifoEntries));
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
if(GETENV(("SSTV2_MEMFIFO_ENTRIES")) &&
|
envp = GETENV(("SSTV2_MEMFIFO_ENTRIES"));
|
||||||
(SSCANF(GETENV(("SSTV2_MEMFIFO_ENTRIES")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoEntries = vtmp;
|
memFifoEntries = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
||||||
65536 - (memFifoEntries << 5)));
|
65536 - (memFifoEntries << 5)));
|
||||||
@@ -404,13 +409,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
vInClkDel = 1;
|
vInClkDel = 1;
|
||||||
if(GETENV(("SSTV2_VIN_CLKDEL")) &&
|
envp = GETENV(("SSTV2_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIN_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vInClkDel = vtmp;
|
vInClkDel = vtmp;
|
||||||
|
|
||||||
vOutClkDel = 0;
|
vOutClkDel = 0;
|
||||||
if(GETENV(("SSTV2_VOUT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_VOUT_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vOutClkDel = vtmp;
|
vOutClkDel = vtmp;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
||||||
@@ -475,8 +480,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
if(!GETENV(("SSTV2_VIDEO_FILTER_DISABLE"))) {
|
if(!GETENV(("SSTV2_VIDEO_FILTER_DISABLE"))) {
|
||||||
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
||||||
if(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")) &&
|
envp = GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIDEO_FILTER_THRESHOLD")), "%i", &vtmp) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1)) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", vtmp));
|
||||||
ISET(sst->videoFilterRgbThreshold, vtmp);
|
ISET(sst->videoFilterRgbThreshold, vtmp);
|
||||||
} else
|
} else
|
||||||
@@ -557,8 +562,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
|
|
||||||
// Adjust Video Clock
|
// Adjust Video Clock
|
||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
if(GETENV(("SSTV2_VIDCLK2X")) &&
|
envp = GETENV(("SSTV2_VIDCLK2X"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIDCLK2X")), "%f", &vidClkFreq) == 1)) {
|
if(envp &&
|
||||||
|
(SSCANF(envp, "%f", &vidClkFreq) == 1)) {
|
||||||
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
} else {
|
} else {
|
||||||
@@ -606,8 +612,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBuffers(FxU32 *sstbase,
|
|||||||
FxU32 clearColor = 0x0;
|
FxU32 clearColor = 0x0;
|
||||||
FxU32 pagesToFill;
|
FxU32 pagesToFill;
|
||||||
|
|
||||||
if(GETENV(("SSTV2_VIDEO_CLEARCOLOR")) &&
|
envp = GETENV(("SSTV2_VIDEO_CLEARCOLOR"));
|
||||||
(SSCANF(GETENV(("SSTV2_VIDEO_CLEARCOLOR")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
clearColor = vtmp;
|
clearColor = vtmp;
|
||||||
|
|
||||||
if(sst1CurrentBoard->fbiMemSize == 1)
|
if(sst1CurrentBoard->fbiMemSize == 1)
|
||||||
@@ -1017,10 +1023,12 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
{
|
{
|
||||||
GrScreenResolution_t screenRez = screenResolution;
|
GrScreenResolution_t screenRez = screenResolution;
|
||||||
GrScreenRefresh_t refreshRate = screenRefresh;
|
GrScreenRefresh_t refreshRate = screenRefresh;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
// Override Screen resolution with environment variables
|
// Override Screen resolution with environment variables
|
||||||
if(GETENV(("SSTV2_SCREENREZ"))) {
|
envp = GETENV(("SSTV2_SCREENREZ"));
|
||||||
FxU32 screenRezEnv = ATOI(GETENV(("SSTV2_SCREENREZ")));
|
if(envp) {
|
||||||
|
FxI32 screenRezEnv = ATOI(envp);
|
||||||
|
|
||||||
switch(screenRezEnv) {
|
switch(screenRezEnv) {
|
||||||
case 512256:
|
case 512256:
|
||||||
@@ -1051,8 +1059,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Override Screen resolution with environment variables
|
// Override Screen resolution with environment variables
|
||||||
if(GETENV(("SSTV2_SCREENREFRESH"))) {
|
envp = GETENV(("SSTV2_SCREENREFRESH"));
|
||||||
FxU32 refreshRateEnv = ATOI(GETENV(("SSTV2_SCREENREFRESH")));
|
if(envp) {
|
||||||
|
FxI32 refreshRateEnv = ATOI(envp);
|
||||||
|
|
||||||
switch(refreshRateEnv) {
|
switch(refreshRateEnv) {
|
||||||
case 75:
|
case 75:
|
||||||
@@ -1077,9 +1086,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_512x384):
|
case(GR_RESOLUTION_512x384):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_512x384"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_512x384") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_512x384") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_512X384_120);
|
return(&SST_VREZ_512X384_120);
|
||||||
@@ -1102,9 +1111,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_640x400):
|
case(GR_RESOLUTION_640x400):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_640x400"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_640x400") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x400") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_640X400_120);
|
return(&SST_VREZ_640X400_120);
|
||||||
@@ -1117,9 +1126,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_640x480):
|
case(GR_RESOLUTION_640x480):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_640x480"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_640x480") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x480") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_640X480_120);
|
return(&SST_VREZ_640X480_120);
|
||||||
@@ -1132,9 +1141,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_800x600):
|
case(GR_RESOLUTION_800x600):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_800x600"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_800x600") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_800x600") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_120Hz)
|
if(refreshRate == GR_REFRESH_120Hz)
|
||||||
return(&SST_VREZ_800X600_120);
|
return(&SST_VREZ_800X600_120);
|
||||||
@@ -1151,8 +1160,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_960x720):
|
case(GR_RESOLUTION_960x720):
|
||||||
if( GETENV( ("SSTV2_REFRESH_960x720") ) )
|
envp = GETENV(("SSTV2_REFRESH_960x720"));
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_960x720") ) ) );
|
if(envp)
|
||||||
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_85Hz)
|
if(refreshRate == GR_REFRESH_85Hz)
|
||||||
return(&SST_VREZ_960X720_85);
|
return(&SST_VREZ_960X720_85);
|
||||||
@@ -1163,9 +1173,9 @@ sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case(GR_RESOLUTION_1024x768):
|
case(GR_RESOLUTION_1024x768):
|
||||||
|
envp = GETENV(("SSTV2_REFRESH_1024x768"));
|
||||||
if( GETENV( ("SSTV2_REFRESH_1024x768") ) )
|
if(envp)
|
||||||
refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_1024x768") ) ) );
|
refreshRate = sst1InitConvertRefreshRate( ATOI(envp) );
|
||||||
|
|
||||||
if(refreshRate == GR_REFRESH_85Hz)
|
if(refreshRate == GR_REFRESH_85Hz)
|
||||||
return(&SST_VREZ_1024X768_85);
|
return(&SST_VREZ_1024X768_85);
|
||||||
@@ -1249,6 +1259,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase)
|
|||||||
FxU32 gammaArray[32];
|
FxU32 gammaArray[32];
|
||||||
FxU32 j, k;
|
FxU32 j, k;
|
||||||
FxU32 gammaCorrectConstant = 0x5c;
|
FxU32 gammaCorrectConstant = 0x5c;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
@@ -1264,8 +1275,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase)
|
|||||||
// return (FXTRUE);
|
// return (FXTRUE);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if(GETENV(("SSTV2_MDETECT_CONST")) &&
|
envp = GETENV(("SSTV2_MDETECT_CONST"));
|
||||||
(SSCANF(GETENV(("SSTV2_MDETECT_CONST")), "%i", &j) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &j) == 1)) {
|
||||||
gammaCorrectConstant = j;
|
gammaCorrectConstant = j;
|
||||||
INIT_PRINTF(("sst1InitMonitorDetect(): Using value 0x%x for constant gamma value...\n", gammaCorrectConstant));
|
INIT_PRINTF(("sst1InitMonitorDetect(): Using value 0x%x for constant gamma value...\n", gammaCorrectConstant));
|
||||||
}
|
}
|
||||||
@@ -1316,11 +1327,10 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitMonitorDetect(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Override with environment variable...
|
// Override with environment variable...
|
||||||
if(GETENV(("SSTV2_MDETECT")))
|
envp = GETENV(("SSTV2_MDETECT"));
|
||||||
sst1CurrentBoard->monitorDetected =
|
if(envp)
|
||||||
(ATOI(GETENV(("SSTV2_MDETECT")))) ? 1 : 0;
|
sst1CurrentBoard->monitorDetected = (ATOI(envp)) ? 1 : 0;
|
||||||
|
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
@@ -1335,6 +1345,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase)
|
|||||||
{
|
{
|
||||||
FxU32 tf0_clkdel, tf1_clkdel, tf2_clkdel, ft_clkdel;
|
FxU32 tf0_clkdel, tf1_clkdel, tf2_clkdel, ft_clkdel;
|
||||||
SstRegs *sst = (SstRegs *) sstbase;
|
SstRegs *sst = (SstRegs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(sst1CurrentBoard->fbiBoardID == 0x3) {
|
if(sst1CurrentBoard->fbiBoardID == 0x3) {
|
||||||
@@ -1430,17 +1441,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSetClkDelays(FxU32 *sstbase)
|
|||||||
setDelays:
|
setDelays:
|
||||||
|
|
||||||
// Override with environment variables
|
// Override with environment variables
|
||||||
if(GETENV(("SSTV2_FT_CLKDEL")) &&
|
envp = GETENV(("SSTV2_FT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_FT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
ft_clkdel = i;
|
ft_clkdel = i;
|
||||||
if(GETENV(("SSTV2_TF0_CLKDEL")) &&
|
envp = GETENV(("SSTV2_TF0_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF0_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
tf0_clkdel = i;
|
tf0_clkdel = i;
|
||||||
if(GETENV(("SSTV2_TF1_CLKDEL")) &&
|
envp = GETENV(("SSTV2_TF1_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF1_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
tf1_clkdel = i;
|
tf1_clkdel = i;
|
||||||
if(GETENV(("SSTV2_TF2_CLKDEL")) &&
|
envp = GETENV(("SSTV2_TF2_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SSTV2_TF2_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
tf2_clkdel = i;
|
tf2_clkdel = i;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitSetClkDelays(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clkdel));
|
INIT_PRINTF(("sst1InitSetClkDelays(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clkdel));
|
||||||
|
|||||||
@@ -398,6 +398,7 @@ void
|
|||||||
_GlideInitEnvironment( void )
|
_GlideInitEnvironment( void )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if ( _GlideRoot.initialized ) /* only execute once */
|
if ( _GlideRoot.initialized ) /* only execute once */
|
||||||
return;
|
return;
|
||||||
@@ -429,7 +430,10 @@ _GlideInitEnvironment( void )
|
|||||||
|
|
||||||
#if GL_X86
|
#if GL_X86
|
||||||
_GlideRoot.CPUType = _cpu_detect_asm();
|
_GlideRoot.CPUType = _cpu_detect_asm();
|
||||||
if (getenv("FX_CPU")) _GlideRoot.CPUType = atoi(getenv("FX_CPU"));
|
envp = getenv("FX_CPU");
|
||||||
|
if (envp) {
|
||||||
|
_GlideRoot.CPUType = atoi(envp);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_GlideRoot.environment.swapInterval = -1;
|
_GlideRoot.environment.swapInterval = -1;
|
||||||
@@ -458,14 +462,22 @@ _GlideInitEnvironment( void )
|
|||||||
_GlideRoot.environment.swapPendingCount = 6;
|
_GlideRoot.environment.swapPendingCount = 6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (getenv("FX_SNAPSHOT")) _GlideRoot.environment.snapshot = atoi(getenv("FX_SNAPSHOT"));
|
envp = getenv("FX_SNAPSHOT");
|
||||||
if (getenv("FX_GLIDE_LWM")) _GlideRoot.environment.swFifoLWM = atoi(getenv("FX_GLIDE_LWM"));
|
if (envp) {
|
||||||
|
_GlideRoot.environment.snapshot = atoi(envp);
|
||||||
if (getenv("FX_GLIDE_SWAPINTERVAL")) {
|
|
||||||
_GlideRoot.environment.swapInterval = atoi(getenv("FX_GLIDE_SWAPINTERVAL"));
|
|
||||||
if (_GlideRoot.environment.swapInterval < 0) _GlideRoot.environment.swapInterval = 0;
|
|
||||||
}
|
}
|
||||||
|
envp = getenv("FX_GLIDE_LWM");
|
||||||
|
if (envp) {
|
||||||
|
_GlideRoot.environment.swFifoLWM = atoi(envp);
|
||||||
|
}
|
||||||
|
|
||||||
|
envp = getenv("FX_GLIDE_SWAPINTERVAL");
|
||||||
|
if (envp) {
|
||||||
|
_GlideRoot.environment.swapInterval = atoi(envp);
|
||||||
|
if (_GlideRoot.environment.swapInterval < 0)
|
||||||
|
_GlideRoot.environment.swapInterval = 0;
|
||||||
|
}
|
||||||
|
|
||||||
GDBG_INFO((80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck));
|
GDBG_INFO((80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck));
|
||||||
GDBG_INFO((80," swapInterval: %d\n",_GlideRoot.environment.swapInterval));
|
GDBG_INFO((80," swapInterval: %d\n",_GlideRoot.environment.swapInterval));
|
||||||
GDBG_INFO((80," noSplash: %d\n",_GlideRoot.environment.noSplash));
|
GDBG_INFO((80," noSplash: %d\n",_GlideRoot.environment.noSplash));
|
||||||
@@ -513,8 +525,6 @@ _GlideInitEnvironment( void )
|
|||||||
} /* _GlideInitEnvironment */
|
} /* _GlideInitEnvironment */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_SST_SIM)
|
#if defined(GLIDE_DEBUG) && !(GLIDE_PLATFORM & GLIDE_SST_SIM)
|
||||||
|
|
||||||
/* GMT: tracing utilities */
|
/* GMT: tracing utilities */
|
||||||
|
|||||||
@@ -753,9 +753,11 @@ void initSliPciOwner( FxU32 *regbase, FxU32 owner ) {
|
|||||||
FxU32 initNumBoardsInSystem(void)
|
FxU32 initNumBoardsInSystem(void)
|
||||||
{
|
{
|
||||||
FxU32 numBoards, j, n;
|
FxU32 numBoards, j, n;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if(getenv(("SST_BOARDS"))) {
|
envp = getenv(("SST_BOARDS"));
|
||||||
numBoards = atoi(getenv(("SST_BOARDS")));
|
if(envp != NULL) {
|
||||||
|
numBoards = atoi(envp);
|
||||||
} else {
|
} else {
|
||||||
numBoards = 0;
|
numBoards = 0;
|
||||||
#if defined(SST1)
|
#if defined(SST1)
|
||||||
|
|||||||
@@ -602,9 +602,11 @@ Init96GetTmuMemory(FxU32 *sstbase, VG96Info *info, FxU32 tmu,
|
|||||||
FxU32 *TmuMemorySize)
|
FxU32 *TmuMemorySize)
|
||||||
{
|
{
|
||||||
FxU32 data;
|
FxU32 data;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if(myGetenv(("SST96_TMUMEM_SIZE"))) {
|
envp = myGetenv(("SST96_TMUMEM_SIZE"));
|
||||||
*TmuMemorySize = atoi(myGetenv(("SST96_TMUMEM_SIZE")));
|
if(envp) {
|
||||||
|
*TmuMemorySize = atoi(envp);
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
SET(sstPtr->trexInit0, 0x05441);
|
SET(sstPtr->trexInit0, 0x05441);
|
||||||
@@ -941,14 +943,17 @@ init96SetupRendering(InitRegisterDesc *regDesc, GrScreenResolution_t sRes)
|
|||||||
GDBG_INFO((80, "%s: Setting TMU FT & TF delays\n", FN_NAME));
|
GDBG_INFO((80, "%s: Setting TMU FT & TF delays\n", FN_NAME));
|
||||||
{
|
{
|
||||||
FxU32 trexinit0, trexinit1;
|
FxU32 trexinit0, trexinit1;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
if( !myGetenv(("SST_TREX0INIT0")) ||
|
envp = myGetenv(("SST_TREX0INIT0"));
|
||||||
(sscanf(myGetenv(("SST_TREX0INIT0")), "%i", &trexinit0) != 1) ) {
|
if( !envp ||
|
||||||
|
(sscanf(envp, "%i", &trexinit0) != 1) ) {
|
||||||
trexinit0 = 0x05441; /* TREXINIT0 */
|
trexinit0 = 0x05441; /* TREXINIT0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !myGetenv(("SST_TREX0INIT1")) ||
|
envp = myGetenv(("SST_TREX0INIT1"));
|
||||||
(sscanf(myGetenv(("SST_TREX0INIT1")), "%i", &trexinit1) != 1) ) {
|
if( !envp ||
|
||||||
|
(sscanf(envp, "%i", &trexinit1) != 1) ) {
|
||||||
trexinit1 = 0x3643c; /* TREXINIT1 */
|
trexinit1 = 0x3643c; /* TREXINIT1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2074,6 +2079,7 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes,
|
|||||||
InitBufDesc_t *pTriple = NULL;
|
InitBufDesc_t *pTriple = NULL;
|
||||||
InitBufDesc_t *pAux = NULL;
|
InitBufDesc_t *pAux = NULL;
|
||||||
InitBufDesc_t *pFifo = NULL;
|
InitBufDesc_t *pFifo = NULL;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n",
|
GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n",
|
||||||
@@ -2122,10 +2128,11 @@ init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes,
|
|||||||
GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n",
|
GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n",
|
||||||
pFront, pBack, pTriple, pAux, pFifo));
|
pFront, pBack, pTriple, pAux, pFifo));
|
||||||
|
|
||||||
if (myGetenv("SST96_FORCEALIGN")) {
|
envp = myGetenv("SST96_FORCEALIGN");
|
||||||
|
if (envp) {
|
||||||
FxU32 F, B, T, A;
|
FxU32 F, B, T, A;
|
||||||
|
|
||||||
if (sscanf(myGetenv("SST96_FORCEALIGN"), "%x,%x,%x,%x", &F, &B, &T, &A) == 4)
|
if (sscanf(envp, "%x,%x,%x,%x", &F, &B, &T, &A) == 4)
|
||||||
{
|
{
|
||||||
GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n"));
|
GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n"));
|
||||||
pFront->bufOffset = F;
|
pFront->bufOffset = F;
|
||||||
|
|||||||
@@ -615,6 +615,7 @@ INITAT3DENTRY(initAT3DSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefre
|
|||||||
#if defined(__DOS32__)
|
#if defined(__DOS32__)
|
||||||
union REGS r, rOut;
|
union REGS r, rOut;
|
||||||
#endif
|
#endif
|
||||||
|
const char *envp;
|
||||||
FxBool
|
FxBool
|
||||||
fixVsync = FXFALSE,
|
fixVsync = FXFALSE,
|
||||||
rv = FXTRUE;
|
rv = FXTRUE;
|
||||||
@@ -734,18 +735,19 @@ INITAT3DENTRY(initAT3DSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
envp = myGetenv("INIT96_AT3D_VSYNC_END");
|
||||||
if (myGetenv("INIT96_AT3D_VSYNC_END")) {
|
if (envp) {
|
||||||
FxU16 vSyncEnd = 3;
|
FxU16 vSyncEnd = 3;
|
||||||
GDBG_INFO((80, "%s: Setting VSync End\n", FN_NAME));
|
GDBG_INFO((80, "%s: Setting VSync End\n", FN_NAME));
|
||||||
vSyncEnd = atoi(myGetenv("INIT96_AT3D_VSYNC_END"));
|
vSyncEnd = atoi(envp);
|
||||||
CRTC_SET(CC_VSYNC_END, vSyncEnd);
|
CRTC_SET(CC_VSYNC_END, vSyncEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myGetenv("INIT96_AT3D_VSYNC_START")) {
|
envp = myGetenv("INIT96_AT3D_VSYNC_START");
|
||||||
|
if (envp) {
|
||||||
FxU16 vSyncStart = 0;
|
FxU16 vSyncStart = 0;
|
||||||
GDBG_INFO((80, "%s: Setting VSync Start\n", FN_NAME));
|
GDBG_INFO((80, "%s: Setting VSync Start\n", FN_NAME));
|
||||||
vSyncStart = atoi(myGetenv("INIT96_AT3D_VSYNC_START"));
|
vSyncStart = atoi(envp);
|
||||||
CRTC_SET(CC_VSYNC_START, vSyncStart);
|
CRTC_SET(CC_VSYNC_START, vSyncStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -451,13 +451,15 @@ FxBool sst1InitDacDetectICS(FxU32 * sstbase)
|
|||||||
FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase)
|
FX_EXPORT FxBool FX_CSTYLE sst1InitCalcGrxClk(FxU32 *sstbase)
|
||||||
{
|
{
|
||||||
FxU32 clkFreq;
|
FxU32 clkFreq;
|
||||||
|
const char *e;
|
||||||
|
|
||||||
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
if(sst1InitCheckBoard(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SST_GRXCLK"))) {
|
e = GETENV(("SST_GRXCLK"));
|
||||||
|
if(e) {
|
||||||
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
INIT_PRINTF(("sst1InitCalcGrxClk(): Overriding default clk frequency with SST_GRXCLK\n"));
|
||||||
clkFreq = ATOI(GETENV(("SST_GRXCLK")));
|
clkFreq = ATOI(e);
|
||||||
if(clkFreq < 16)
|
if(clkFreq < 16)
|
||||||
clkFreq = 16;
|
clkFreq = 16;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -64,24 +64,29 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGamma(FxU32 *sstbase, double gamma)
|
|||||||
gammaB = gamma;
|
gammaB = gamma;
|
||||||
|
|
||||||
if(calledBefore == FXFALSE) {
|
if(calledBefore == FXFALSE) {
|
||||||
|
const char *envp;
|
||||||
calledBefore = FXTRUE;
|
calledBefore = FXTRUE;
|
||||||
if(GETENV(("SST_RGAMMA"))) {
|
envp = GETENV(("SST_RGAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideR = FXTRUE;
|
overRideR = FXTRUE;
|
||||||
gammaR = (double) ATOF(GETENV(("SST_RGAMMA")));
|
gammaR = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_GGAMMA"))) {
|
envp = GETENV(("SST_GGAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideG = FXTRUE;
|
overRideG = FXTRUE;
|
||||||
gammaG = (double) ATOF(GETENV(("SST_GGAMMA")));
|
gammaG = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_BGAMMA"))) {
|
envp = GETENV(("SST_BGAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideB = FXTRUE;
|
overRideB = FXTRUE;
|
||||||
gammaB = (double) ATOF(GETENV(("SST_BGAMMA")));
|
gammaB = (double) ATOF(envp);
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_GAMMA"))) {
|
envp = GETENV(("SST_GAMMA"));
|
||||||
|
if(envp) {
|
||||||
overRideR = FXTRUE;
|
overRideR = FXTRUE;
|
||||||
overRideG = FXTRUE;
|
overRideG = FXTRUE;
|
||||||
overRideB = FXTRUE;
|
overRideB = FXTRUE;
|
||||||
gammaR = (double) ATOF(GETENV(("SST_GAMMA")));
|
gammaR = (double) ATOF(envp);
|
||||||
gammaG = gammaR;
|
gammaG = gammaR;
|
||||||
gammaB = gammaR;
|
gammaB = gammaR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ static char *setRange(char *buf, int val)
|
|||||||
return buf + pos; // and return rest of string
|
return buf + pos; // and return rest of string
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse(char *env)
|
static void parse(const char *env)
|
||||||
{
|
{
|
||||||
int level, pos;
|
int level, pos;
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ FX_EXPORT void FX_CSTYLE
|
|||||||
gdbg_init(void)
|
gdbg_init(void)
|
||||||
{
|
{
|
||||||
static int done=0; // only execute once
|
static int done=0; // only execute once
|
||||||
char *env;
|
const char *env;
|
||||||
|
|
||||||
if (done) return;
|
if (done) return;
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
int i, x=0, y=0;
|
int i, x=0, y=0;
|
||||||
FxU32 r_sum, g_sum, b_sum;
|
FxU32 r_sum, g_sum, b_sum;
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
/* set trex's (all 3) to output configuration bits */
|
/* set trex's (all 3) to output configuration bits */
|
||||||
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18));
|
||||||
@@ -187,8 +188,8 @@ getTmuConfigData(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
|
|
||||||
if(GETENV(("SST_TMUCFG")) &&
|
envp = GETENV(("SST_TMUCFG"));
|
||||||
(SSCANF(GETENV(("SST_TMUCFG")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
info->tmuConfig = i;
|
info->tmuConfig = i;
|
||||||
|
|
||||||
/* reset trex's init registers */
|
/* reset trex's init registers */
|
||||||
@@ -241,11 +242,13 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
|
|||||||
{
|
{
|
||||||
FxU32 i,data;
|
FxU32 i,data;
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
|
||||||
|
|
||||||
if(GETENV(("SST_TMUMEM_SIZE"))) {
|
envp = GETENV(("SST_TMUMEM_SIZE"));
|
||||||
*TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
if(envp) {
|
||||||
|
*TmuMemorySize = ATOI(envp);
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,9 +355,10 @@ static int fbiMemSize(FxU32 *sstbase)
|
|||||||
FxU32 init1Save = IGET(sst->fbiInit1);
|
FxU32 init1Save = IGET(sst->fbiInit1);
|
||||||
FxU32 init2Save = IGET(sst->fbiInit2);
|
FxU32 init2Save = IGET(sst->fbiInit2);
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
const char *envp = GETENV(("SST_FBIMEM_SIZE"));
|
||||||
|
|
||||||
if(GETENV(("SST_FBIMEM_SIZE")))
|
if(envp)
|
||||||
return(ATOI(GETENV(("SST_FBIMEM_SIZE"))));
|
return ATOI(envp);
|
||||||
|
|
||||||
/* Enable dram refresh, disable memory fifo, and setup memory */
|
/* Enable dram refresh, disable memory fifo, and setup memory */
|
||||||
/* for rendering */
|
/* for rendering */
|
||||||
@@ -450,12 +454,13 @@ FX_EXPORT FxBool FX_CSTYLE
|
|||||||
sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
||||||
{
|
{
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
|
|
||||||
info->fbiMemSize = fbiMemSize(sstbase);
|
info->fbiMemSize = fbiMemSize(sstbase);
|
||||||
|
|
||||||
/* Detect board identification and memory speed */
|
/* Detect board identification and memory speed */
|
||||||
if(!GETENV(("SST_FBICFG")) ||
|
envp = GETENV(("SST_FBICFG"));
|
||||||
(SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig) != 1))
|
if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1))
|
||||||
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
|
||||||
SST_FBI_MEM_TYPE_SHIFT;
|
SST_FBI_MEM_TYPE_SHIFT;
|
||||||
|
|
||||||
@@ -502,14 +507,15 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
if(GETENV(("SST_NODEVICEINFO"))) {
|
if(GETENV(("SST_NODEVICEINFO"))) {
|
||||||
/* fill device info struct with sane values... */
|
/* fill device info struct with sane values... */
|
||||||
|
const char *envp;
|
||||||
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
|
||||||
|
|
||||||
if(!GETENV(("SST_FBICFG")) ||
|
envp = GETENV(("SST_FBICFG"));
|
||||||
(SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig) != 1))
|
if(!envp || (SSCANF(envp, "%i", &info->fbiConfig) != 1))
|
||||||
info->fbiConfig = 0x0;
|
info->fbiConfig = 0x0;
|
||||||
|
|
||||||
if(!GETENV(("SST_TMUCFG")) ||
|
envp = GETENV(("SST_TMUCFG"));
|
||||||
(SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig) != 1))
|
if(!envp || (SSCANF(envp, "%i", &info->tmuConfig) != 1))
|
||||||
info->tmuConfig = 0x0;
|
info->tmuConfig = 0x0;
|
||||||
|
|
||||||
info->numberTmus = 1;
|
info->numberTmus = 1;
|
||||||
@@ -520,13 +526,15 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
info->tmuRevision = info->tmuConfig & 0x7;
|
info->tmuRevision = info->tmuConfig & 0x7;
|
||||||
|
|
||||||
if(GETENV(("SST_FBIMEM_SIZE")))
|
envp = GETENV(("SST_FBIMEM_SIZE"));
|
||||||
info->fbiMemSize = ATOI(GETENV(("SST_FBIMEM_SIZE")));
|
if(envp)
|
||||||
|
info->fbiMemSize = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->fbiMemSize = 2;
|
info->fbiMemSize = 2;
|
||||||
|
|
||||||
if(GETENV(("SST_TMUMEM_SIZE")))
|
envp = GETENV(("SST_TMUMEM_SIZE"));
|
||||||
info->tmuMemSize[0] = ATOI(GETENV(("SST_TMUMEM_SIZE")));
|
if(envp)
|
||||||
|
info->tmuMemSize[0] = ATOI(envp);
|
||||||
else
|
else
|
||||||
info->tmuMemSize[0] = 2;
|
info->tmuMemSize[0] = 2;
|
||||||
info->tmuMemSize[1] = info->tmuMemSize[0];
|
info->tmuMemSize[1] = info->tmuMemSize[0];
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...)
|
|||||||
static FxBool printIt = FXFALSE;
|
static FxBool printIt = FXFALSE;
|
||||||
|
|
||||||
if(firstPass == FXTRUE) {
|
if(firstPass == FXTRUE) {
|
||||||
|
const char *envf;
|
||||||
firstPass = FXFALSE;
|
firstPass = FXFALSE;
|
||||||
if (sst1InitMsgFile == NULL)
|
if (sst1InitMsgFile == NULL)
|
||||||
{
|
{
|
||||||
@@ -50,11 +51,12 @@ FX_ENTRY void FX_CALL sst1InitPrintf(const char *format, ...)
|
|||||||
}
|
}
|
||||||
if(GETENV(("SST_INITDEBUG")))
|
if(GETENV(("SST_INITDEBUG")))
|
||||||
printIt = FXTRUE;
|
printIt = FXTRUE;
|
||||||
if(GETENV(("SST_INITDEBUG_FILE"))) {
|
envf = GETENV(("SST_INITDEBUG_FILE"));
|
||||||
if((sst1InitMsgFile = fopen(GETENV(("SST_INITDEBUG_FILE")), "w")))
|
if(envf) {
|
||||||
|
if((sst1InitMsgFile = fopen(envf, "w")) != NULL)
|
||||||
printIt = FXTRUE;
|
printIt = FXTRUE;
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", GETENV(("SST_INITDEBUG_FILE")));
|
fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", envf);
|
||||||
printIt = FXFALSE;
|
printIt = FXFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
FxU32 masterPVOutClkDel, slavePVOutClkDel;
|
FxU32 masterPVOutClkDel, slavePVOutClkDel;
|
||||||
FxU32 pciFifoLwm, memFifoLwm;
|
FxU32 pciFifoLwm, memFifoLwm;
|
||||||
FxU32 clkFreqMaster;
|
FxU32 clkFreqMaster;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Check to make sure master and slave are installed properly */
|
/* Check to make sure master and slave are installed properly */
|
||||||
@@ -141,14 +142,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
slaveVInClkDel = 2;
|
slaveVInClkDel = 2;
|
||||||
slaveVOutClkDel = 0;
|
slaveVOutClkDel = 0;
|
||||||
slavePVOutClkDel = 3;
|
slavePVOutClkDel = 3;
|
||||||
if(GETENV(("SST_SLIS_VOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIS_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVOutClkDel = i;
|
slaveVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIS_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIS_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slavePVOutClkDel = i;
|
slavePVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIS_VIN_CLKDEL")) &&
|
envp = GETENV(("SST_SLIS_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
slaveVInClkDel = i;
|
slaveVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
|
||||||
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
|
||||||
@@ -265,14 +266,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
masterVInClkDel = 2;
|
masterVInClkDel = 2;
|
||||||
masterVOutClkDel = 0;
|
masterVOutClkDel = 0;
|
||||||
masterPVOutClkDel = 3;
|
masterPVOutClkDel = 3;
|
||||||
if(GETENV(("SST_SLIM_VOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIM_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVOutClkDel = i;
|
masterVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIM_PVOUT_CLKDEL")) &&
|
envp = GETENV(("SST_SLIM_PVOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterPVOutClkDel = i;
|
masterPVOutClkDel = i;
|
||||||
if(GETENV(("SST_SLIM_VIN_CLKDEL")) &&
|
envp = GETENV(("SST_SLIM_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
masterVInClkDel = i;
|
masterVInClkDel = i;
|
||||||
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
|
||||||
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
|
||||||
@@ -374,8 +375,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
/* Clear Screen */
|
/* Clear Screen */
|
||||||
FxU32 clearColor = 0x0;
|
FxU32 clearColor = 0x0;
|
||||||
|
|
||||||
if(GETENV(("SST_VIDEO_CLEARCOLOR")) &&
|
envp = GETENV(("SST_VIDEO_CLEARCOLOR"));
|
||||||
(SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
clearColor = i;
|
clearColor = i;
|
||||||
ISET(sstMaster->c1, clearColor);
|
ISET(sstMaster->c1, clearColor);
|
||||||
ISET(sstMaster->c0, clearColor);
|
ISET(sstMaster->c0, clearColor);
|
||||||
@@ -531,9 +532,11 @@ FX_ENTRY FxU32 FX_CALL sst1InitSliDetect(FxU32 *sstbase)
|
|||||||
volatile Sstregs *sst;
|
volatile Sstregs *sst;
|
||||||
|
|
||||||
if(firstTime) {
|
if(firstTime) {
|
||||||
|
const char *envp;
|
||||||
firstTime = 0;
|
firstTime = 0;
|
||||||
if(GETENV(("SST_SLIDETECT")))
|
envp = GETENV(("SST_SLIDETECT"));
|
||||||
sliDetected = ATOI(GETENV(("SST_SLIDETECT")));
|
if(envp)
|
||||||
|
sliDetected = ATOI(envp);
|
||||||
else {
|
else {
|
||||||
PCICFG_RD(PCI_REVISION_ID, fbiRev);
|
PCICFG_RD(PCI_REVISION_ID, fbiRev);
|
||||||
sst = (Sstregs *) sstbase;
|
sst = (Sstregs *) sstbase;
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
FxU32 ft_clk_del, tf0_clk_del, tf1_clk_del, tf2_clk_del;
|
FxU32 ft_clk_del, tf0_clk_del, tf1_clk_del, tf2_clk_del;
|
||||||
sst1ClkTimingStruct sstGrxClk;
|
sst1ClkTimingStruct sstGrxClk;
|
||||||
volatile Sstregs *sst = (Sstregs *) sstbase;
|
volatile Sstregs *sst = (Sstregs *) sstbase;
|
||||||
|
const char *envp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
@@ -319,8 +320,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
|
|
||||||
/* Adjust Fbi-to-Trex clock delay value */
|
/* Adjust Fbi-to-Trex clock delay value */
|
||||||
/* Adjust Trex-to-Fbi FIFO */
|
/* Adjust Trex-to-Fbi FIFO */
|
||||||
if(!GETENV(("SST_TF_FIFO_THRESH")) ||
|
envp = GETENV(("SST_TF_FIFO_THRESH"));
|
||||||
(SSCANF(GETENV(("SST_TF_FIFO_THRESH")), "%i", &tf_fifo_thresh) != 1))
|
if(!envp || (SSCANF(envp, "%i", &tf_fifo_thresh) != 1))
|
||||||
tf_fifo_thresh = 0x8;
|
tf_fifo_thresh = 0x8;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
INIT_PRINTF(("sst1InitRegisters(): Setting TREX-to-FBI FIFO THRESHOLD to 0x%x...\n",
|
||||||
tf_fifo_thresh));
|
tf_fifo_thresh));
|
||||||
@@ -331,8 +332,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
else
|
else
|
||||||
/* .6 micron */
|
/* .6 micron */
|
||||||
ft_clk_del = 0xa; /* Okay for 16 MHz startup... */
|
ft_clk_del = 0xa; /* Okay for 16 MHz startup... */
|
||||||
if(GETENV(("SST_PFT_CLK_DEL")) &&
|
envp = GETENV(("SST_PFT_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%i", &i) == 1))
|
if(envp && (SSCANF(envp, "%i", &i) == 1))
|
||||||
ft_clk_del = i;
|
ft_clk_del = i;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del));
|
INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del));
|
||||||
ISET(sst->fbiInit3,
|
ISET(sst->fbiInit3,
|
||||||
@@ -391,23 +392,21 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set TREX0 init values */
|
/* set TREX0 init values */
|
||||||
if(GETENV(("SST_TREX0INIT0")) &&
|
envp = GETENV(("SST_TREX0INIT0"));
|
||||||
(SSCANF(GETENV(("SST_TREX0INIT0")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[0]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit0[0]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT0 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[0] = SST_TREX0INIT0_DEFAULT;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX0INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[0]));
|
sst1CurrentBoard->tmuInit0[0]));
|
||||||
if(GETENV(("SST_TREX0INIT1")) &&
|
envp = GETENV(("SST_TREX0INIT1"));
|
||||||
(SSCANF(GETENV(("SST_TREX0INIT1")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[0]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit1[0]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX0INIT1 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[0] = SST_TREX0INIT1_DEFAULT;
|
||||||
if(GETENV(("SST_PTF0_CLK_DEL")) &&
|
envp = GETENV(("SST_PTF0_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PTF0_CLK_DEL")), "%i", &tf0_clk_del) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf0_clk_del) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
sst1CurrentBoard->tmuInit1[0] = (sst1CurrentBoard->tmuInit1[0] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf0_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf0_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -421,22 +420,20 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* set TREX1 init values */
|
/* set TREX1 init values */
|
||||||
if(GETENV(("SST_TREX1INIT0")) &&
|
envp = GETENV(("SST_TREX1INIT0"));
|
||||||
(SSCANF(GETENV(("SST_TREX1INIT0")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[1]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit0[1]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT0 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[1] = SST_TREX1INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX1INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[1]));
|
sst1CurrentBoard->tmuInit0[1]));
|
||||||
if(GETENV(("SST_TREX1INIT1")) &&
|
envp = GETENV(("SST_TREX1INIT1"));
|
||||||
(SSCANF(GETENV(("SST_TREX1INIT1")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[1]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit1[1]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX1INIT1 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[1] = SST_TREX1INIT1_DEFAULT;
|
||||||
if(GETENV(("SST_PTF1_CLK_DEL")) &&
|
envp = GETENV(("SST_PTF1_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PTF1_CLK_DEL")), "%i", &tf1_clk_del) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf1_clk_del) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
sst1CurrentBoard->tmuInit1[1] = (sst1CurrentBoard->tmuInit1[1] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf1_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf1_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -450,22 +447,20 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* set TREX2 init values */
|
/* set TREX2 init values */
|
||||||
if(GETENV(("SST_TREX2INIT0")) &&
|
envp = GETENV(("SST_TREX2INIT0"));
|
||||||
(SSCANF(GETENV(("SST_TREX2INIT0")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit0[2]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit0[2]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT0 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
sst1CurrentBoard->tmuInit0[2] = SST_TREX2INIT0_DEFAULT;
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT0=0x%x\n",
|
||||||
sst1CurrentBoard->tmuInit0[2]));
|
sst1CurrentBoard->tmuInit0[2]));
|
||||||
if(GETENV(("SST_TREX2INIT1")) &&
|
envp = GETENV(("SST_TREX2INIT1"));
|
||||||
(SSCANF(GETENV(("SST_TREX2INIT1")), "%i",
|
if(envp && (SSCANF(envp, "%i", &sst1CurrentBoard->tmuInit1[2]) == 1) ) {
|
||||||
&sst1CurrentBoard->tmuInit1[2]) == 1) ) {
|
|
||||||
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
INIT_PRINTF(("sst1InitRegisters(): Using SST_TREX2INIT1 environment variable\n"));
|
||||||
} else
|
} else
|
||||||
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
sst1CurrentBoard->tmuInit1[2] = SST_TREX2INIT1_DEFAULT;
|
||||||
if(GETENV(("SST_PTF2_CLK_DEL")) &&
|
envp = GETENV(("SST_PTF2_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_PTF2_CLK_DEL")), "%i", &tf2_clk_del) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &tf2_clk_del) == 1) ) {
|
||||||
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
sst1CurrentBoard->tmuInit1[2] = (sst1CurrentBoard->tmuInit1[2] &
|
||||||
~SST_TEX_TF_CLK_DEL_ADJ) |
|
~SST_TEX_TF_CLK_DEL_ADJ) |
|
||||||
(tf2_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
(tf2_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
|
||||||
@@ -523,8 +518,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
|
||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
if(GETENV(("SST_FASTMEM")))
|
envp = GETENV(("SST_FASTMEM"));
|
||||||
n = ATOI(GETENV(("SST_FASTMEM")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
@@ -562,8 +558,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* LFB writes stored in memory FIFO? */
|
/* LFB writes stored in memory FIFO? */
|
||||||
if(GETENV(("SST_MEMFIFO_LFB")))
|
envp = GETENV(("SST_MEMFIFO_LFB"));
|
||||||
n = ATOI(GETENV(("SST_MEMFIFO_LFB")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -573,8 +570,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Texture memory writes stored in memory FIFO? */
|
/* Texture memory writes stored in memory FIFO? */
|
||||||
if(GETENV(("SST_MEMFIFO_TEX")))
|
envp = GETENV(("SST_MEMFIFO_TEX"));
|
||||||
n = ATOI(GETENV(("SST_MEMFIFO_TEX")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
if(n) {
|
if(n) {
|
||||||
@@ -692,13 +690,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitShutdown(FxU32 *sstbase)
|
|||||||
if(sst1InitShutdownSli(sstbase) == FXFALSE)
|
if(sst1InitShutdownSli(sstbase) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __DOS32__
|
#ifdef __DOS32__
|
||||||
/*
|
/*
|
||||||
* HACK alert. -MS
|
* HACK alert. -MS
|
||||||
*
|
*
|
||||||
* There's a pciClose(), but nobody calls it. This is needed by the
|
* There's a pciClose(), but nobody calls it. This is needed by the
|
||||||
* DOS DPMI services to close fxmemmap.vxd.
|
* DOS DPMI services to close fxmemmap.vxd.
|
||||||
*
|
*
|
||||||
* We need to move this to the "appropriate" place, wherever that may be.
|
* We need to move this to the "appropriate" place, wherever that may be.
|
||||||
*/
|
*/
|
||||||
/*pciClose(); [dBorca] not just yet! We still need PCI to shutdown */
|
/*pciClose(); [dBorca] not just yet! We still need PCI to shutdown */
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
float vidClkFreq;
|
float vidClkFreq;
|
||||||
#endif
|
#endif
|
||||||
|
const char *envp;
|
||||||
|
int envval;
|
||||||
|
|
||||||
if(!sst)
|
if(!sst)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
@@ -163,32 +165,34 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Override settings with environment variables */
|
/* Override settings with environment variables */
|
||||||
if(GETENV(("SST_SCREENREZ"))) {
|
envp = GETENV(("SST_SCREENREZ"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) {
|
if(envp) {
|
||||||
|
envval = ATOI(envp);
|
||||||
|
if(envval == 640) {
|
||||||
sst1MonitorRez = 640;
|
sst1MonitorRez = 640;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 640;
|
sst1CurrentBoard->fbiVideoWidth = 640;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 480;
|
sst1CurrentBoard->fbiVideoHeight = 480;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) {
|
} else if(envval == 640400) {
|
||||||
sst1MonitorRez = 640400;
|
sst1MonitorRez = 640400;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 640;
|
sst1CurrentBoard->fbiVideoWidth = 640;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 400;
|
sst1CurrentBoard->fbiVideoHeight = 400;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) {
|
} else if(envval == 800) {
|
||||||
sst1MonitorRez = 800;
|
sst1MonitorRez = 800;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 800;
|
sst1CurrentBoard->fbiVideoWidth = 800;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 600;
|
sst1CurrentBoard->fbiVideoHeight = 600;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) {
|
} else if(envval == 512256) {
|
||||||
sst1MonitorRez = 512256;
|
sst1MonitorRez = 512256;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 512;
|
sst1CurrentBoard->fbiVideoWidth = 512;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 256;
|
sst1CurrentBoard->fbiVideoHeight = 256;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) {
|
} else if(envval == 512) {
|
||||||
sst1MonitorRez = 512;
|
sst1MonitorRez = 512;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 512;
|
sst1CurrentBoard->fbiVideoWidth = 512;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 384;
|
sst1CurrentBoard->fbiVideoHeight = 384;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) {
|
} else if(envval == 856) {
|
||||||
sst1MonitorRez = 856;
|
sst1MonitorRez = 856;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 856;
|
sst1CurrentBoard->fbiVideoWidth = 856;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 480;
|
sst1CurrentBoard->fbiVideoHeight = 480;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) {
|
} else if(envval == 960) {
|
||||||
sst1MonitorRez = 960;
|
sst1MonitorRez = 960;
|
||||||
sst1CurrentBoard->fbiVideoWidth = 960;
|
sst1CurrentBoard->fbiVideoWidth = 960;
|
||||||
sst1CurrentBoard->fbiVideoHeight = 720;
|
sst1CurrentBoard->fbiVideoHeight = 720;
|
||||||
@@ -198,16 +202,18 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1CurrentBoard->fbiVideoHeight = 480;
|
sst1CurrentBoard->fbiVideoHeight = 480;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_SCREENREFRESH"))) {
|
envp = GETENV(("SST_SCREENREFRESH"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60)
|
if(envp) {
|
||||||
|
envval = ATOI(envp);
|
||||||
|
if(envval == 60)
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72)
|
else if(envval == 72)
|
||||||
sst1MonitorRefresh = 72;
|
sst1MonitorRefresh = 72;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75)
|
else if(envval == 75)
|
||||||
sst1MonitorRefresh = 75;
|
sst1MonitorRefresh = 75;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85)
|
else if(envval == 85)
|
||||||
sst1MonitorRefresh = 85;
|
sst1MonitorRefresh = 85;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120)
|
else if(envval == 120)
|
||||||
sst1MonitorRefresh = 120;
|
sst1MonitorRefresh = 120;
|
||||||
else
|
else
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
@@ -303,9 +309,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1CurrentBoard->fbiVideoRefresh = sst1MonitorRefresh;
|
sst1CurrentBoard->fbiVideoRefresh = sst1MonitorRefresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GETENV(("SST_VIDEO_24BPP")))
|
envp = GETENV(("SST_VIDEO_24BPP"));
|
||||||
sst1CurrentBoard->fbiVideo16BPP =
|
if(envp)
|
||||||
(ATOI(GETENV(("SST_VIDEO_24BPP")))) ^ 0x1;
|
sst1CurrentBoard->fbiVideo16BPP = (ATOI(envp)) ^ 0x1;
|
||||||
else {
|
else {
|
||||||
sst1CurrentBoard->fbiVideo16BPP = 0;
|
sst1CurrentBoard->fbiVideo16BPP = 0;
|
||||||
|
|
||||||
@@ -357,30 +363,30 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup SST video timing registers */
|
/* Setup SST video timing registers */
|
||||||
if(GETENV(("SST_HSYNC")) &&
|
envp = GETENV(("SST_HSYNC"));
|
||||||
(SSCANF(GETENV(("SST_HSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_HSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->hSync, vtmp);
|
ISET(sst->hSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
ISET(sst->hSync, ((sstVideoRez->hSyncOff << SST_VIDEO_HSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
(sstVideoRez->hSyncOn << SST_VIDEO_HSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SST_VSYNC")) &&
|
envp = GETENV(("SST_VSYNC"));
|
||||||
(SSCANF(GETENV(("SST_VSYNC")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_VSYNC=0x%x\n", vtmp));
|
||||||
ISET(sst->vSync, vtmp);
|
ISET(sst->vSync, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
ISET(sst->vSync, ((sstVideoRez->vSyncOff << SST_VIDEO_VSYNC_OFF_SHIFT) |
|
||||||
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
(sstVideoRez->vSyncOn << SST_VIDEO_VSYNC_ON_SHIFT)));
|
||||||
if(GETENV(("SST_BACKPORCH")) &&
|
envp = GETENV(("SST_BACKPORCH"));
|
||||||
(SSCANF(GETENV(("SST_BACKPORCH")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_BACKPORCH=0x%x\n", vtmp));
|
||||||
ISET(sst->backPorch, vtmp);
|
ISET(sst->backPorch, vtmp);
|
||||||
} else
|
} else
|
||||||
ISET(sst->backPorch,
|
ISET(sst->backPorch,
|
||||||
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
((sstVideoRez->vBackPorch << SST_VIDEO_VBACKPORCH_SHIFT) |
|
||||||
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
(sstVideoRez->hBackPorch << SST_VIDEO_HBACKPORCH_SHIFT)));
|
||||||
if(GETENV(("SST_DIMENSIONS")) &&
|
envp = GETENV(("SST_DIMENSIONS"));
|
||||||
(SSCANF(GETENV(("SST_DIMENSIONS")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using SST_DIMENSIONS=0x%x\n", vtmp));
|
||||||
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
sstVideoRez->yDimension = (vtmp >> SST_VIDEO_YDIM_SHIFT) & 0x3ff;
|
||||||
sstVideoRez->xDimension = vtmp & 0x3ff;
|
sstVideoRez->xDimension = vtmp & 0x3ff;
|
||||||
@@ -388,13 +394,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
ISET(sst->videoDimensions,
|
ISET(sst->videoDimensions,
|
||||||
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
((sstVideoRez->yDimension << SST_VIDEO_YDIM_SHIFT) |
|
||||||
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
((sstVideoRez->xDimension-1) << SST_VIDEO_XDIM_SHIFT)));
|
||||||
if(GETENV(("SST_MEMOFFSET")) &&
|
envp = GETENV(("SST_MEMOFFSET"));
|
||||||
(SSCANF(GETENV(("SST_MEMOFFSET")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video memOffset=0x%x\n", vtmp));
|
||||||
sstVideoRez->memOffset = vtmp;
|
sstVideoRez->memOffset = vtmp;
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_TILESINX")) &&
|
envp = GETENV(("SST_TILESINX"));
|
||||||
(SSCANF(GETENV(("SST_TILESINX")), "%i", &vtmp) == 1) ) {
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) ) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
INIT_PRINTF(("sst1InitVideo(): Using video tilesInX=0x%x\n", vtmp));
|
||||||
sstVideoRez->tilesInX_Over2 = vtmp;
|
sstVideoRez->tilesInX_Over2 = vtmp;
|
||||||
}
|
}
|
||||||
@@ -418,12 +424,13 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
/* Setup video fifo */
|
/* Setup video fifo */
|
||||||
/* NOTE: Lower values for the video fifo threshold improve video fifo */
|
/* NOTE: Lower values for the video fifo threshold improve video fifo */
|
||||||
/* underflow problems */
|
/* underflow problems */
|
||||||
if(GETENV(("SST_VFIFO_THRESH"))) {
|
envp = GETENV(("SST_VFIFO_THRESH"));
|
||||||
|
if(envp) {
|
||||||
|
envval = ATOI(envp);
|
||||||
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
INIT_PRINTF(("sst1InitVideo(): Overriding Default Video Fifo Threshold %d and Storing %d\n",
|
||||||
sstVideoRez->vFifoThreshold, ATOI(GETENV(("SST_VFIFO_THRESH")))));
|
sstVideoRez->vFifoThreshold, envval));
|
||||||
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
ISET(sst->fbiInit3, (IGET(sst->fbiInit3) & ~SST_VIDEO_FIFO_THRESH) |
|
||||||
((ATOI(GETENV(("SST_VFIFO_THRESH"))))
|
(envval << SST_VIDEO_FIFO_THRESH_SHIFT));
|
||||||
<< SST_VIDEO_FIFO_THRESH_SHIFT));
|
|
||||||
} else {
|
} else {
|
||||||
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
FxU32 vFifoThresholdVal = sstVideoRez->vFifoThreshold;
|
||||||
|
|
||||||
@@ -448,16 +455,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
memFifoLwm = 23;
|
memFifoLwm = 23;
|
||||||
if(GETENV(("SST_MEMFIFO_LWM")) &&
|
envp = GETENV(("SST_MEMFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SST_MEMFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoLwm = vtmp;
|
memFifoLwm = vtmp;
|
||||||
memFifoHwm = 54;
|
memFifoHwm = 54;
|
||||||
if(GETENV(("SST_MEMFIFO_HWM")) &&
|
envp = GETENV(("SST_MEMFIFO_HWM"));
|
||||||
(SSCANF(GETENV(("SST_MEMFIFO_HWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoHwm = vtmp;
|
memFifoHwm = vtmp;
|
||||||
pciFifoLwm = 13;
|
pciFifoLwm = 13;
|
||||||
if(GETENV(("SST_PCIFIFO_LWM")) &&
|
envp = GETENV(("SST_PCIFIFO_LWM"));
|
||||||
(SSCANF(GETENV(("SST_PCIFIFO_LWM")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
pciFifoLwm = vtmp;
|
pciFifoLwm = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
INIT_PRINTF(("sst1InitVideo(): pciFifoLwm:%d memFifoLwm:%d memFifoHwm:%d\n",
|
||||||
pciFifoLwm, memFifoLwm, memFifoHwm));
|
pciFifoLwm, memFifoLwm, memFifoHwm));
|
||||||
@@ -502,8 +509,9 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
|
|
||||||
/* Enable Memory Fifo... */
|
/* Enable Memory Fifo... */
|
||||||
if(GETENV(("SST_MEMFIFO")))
|
envp = GETENV(("SST_MEMFIFO"));
|
||||||
n = ATOI(GETENV(("SST_MEMFIFO")));
|
if(envp)
|
||||||
|
n = ATOI(envp);
|
||||||
else
|
else
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
@@ -519,8 +527,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
memFifoEntries = sstVideoRez->memFifoEntries_2MB;
|
memFifoEntries = sstVideoRez->memFifoEntries_2MB;
|
||||||
else
|
else
|
||||||
memFifoEntries = sstVideoRez->memFifoEntries_4MB;
|
memFifoEntries = sstVideoRez->memFifoEntries_4MB;
|
||||||
if(GETENV(("SST_MEMFIFO_ENTRIES")) &&
|
envp = GETENV(("SST_MEMFIFO_ENTRIES"));
|
||||||
(SSCANF(GETENV(("SST_MEMFIFO_ENTRIES")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
memFifoEntries = vtmp;
|
memFifoEntries = vtmp;
|
||||||
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
INIT_PRINTF(("sst1InitVideo(): Enabling Memory FIFO (Entries=%d)...\n",
|
||||||
0xffff - (memFifoEntries << 5)));
|
0xffff - (memFifoEntries << 5)));
|
||||||
@@ -545,16 +553,16 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
vInClkDel = 2;
|
vInClkDel = 2;
|
||||||
if(sst1CurrentBoard->fbiRevision == 2)
|
if(sst1CurrentBoard->fbiRevision == 2)
|
||||||
vInClkDel = 0;
|
vInClkDel = 0;
|
||||||
if(GETENV(("SST_VIN_CLKDEL")) &&
|
envp = GETENV(("SST_VIN_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_VIN_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vInClkDel = vtmp;
|
vInClkDel = vtmp;
|
||||||
|
|
||||||
if(sst1CurrentBoard->fbiRevision == 2)
|
if(sst1CurrentBoard->fbiRevision == 2)
|
||||||
vOutClkDel = 2;
|
vOutClkDel = 2;
|
||||||
else
|
else
|
||||||
vOutClkDel = 0;
|
vOutClkDel = 0;
|
||||||
if(GETENV(("SST_VOUT_CLKDEL")) &&
|
envp = GETENV(("SST_VOUT_CLKDEL"));
|
||||||
(SSCANF(GETENV(("SST_VOUT_CLKDEL")), "%i", &vtmp) == 1))
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1))
|
||||||
vOutClkDel = vtmp;
|
vOutClkDel = vtmp;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
INIT_PRINTF(("sst1InitVideo(): vInClkDel=0x%x vOutClkDel=0x%x\n",
|
||||||
@@ -588,8 +596,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
sst1InitIdleFBINoNOP(sstbase);
|
sst1InitIdleFBINoNOP(sstbase);
|
||||||
if(!GETENV(("SST_VIDEO_FILTER_DISABLE"))) {
|
if(!GETENV(("SST_VIDEO_FILTER_DISABLE"))) {
|
||||||
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_FILTER_EN);
|
||||||
if(GETENV(("SST_VIDEO_FILTER_THRESHOLD")) &&
|
envp = GETENV(("SST_VIDEO_FILTER_THRESHOLD"));
|
||||||
(SSCANF(GETENV(("SST_VIDEO_FILTER_THRESHOLD")), "%i", &n) == 1)) {
|
if(envp && (SSCANF(envp, "%i", &n) == 1)) {
|
||||||
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n));
|
INIT_PRINTF(("sst1InitVideo(): Setting Video Filtering Treshold to 0x%x...\n", n));
|
||||||
ISET(sst->videoFilterRgbThreshold, n);
|
ISET(sst->videoFilterRgbThreshold, n);
|
||||||
} else
|
} else
|
||||||
@@ -656,17 +664,17 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Override with environment variables */
|
/* Override with environment variables */
|
||||||
if(GETENV(("SST_FT_CLK_DEL")) &&
|
envp = GETENV(("SST_FT_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_FT_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
ft_clk_del = vtmp;
|
ft_clk_del = vtmp;
|
||||||
if(GETENV(("SST_TF0_CLK_DEL")) &&
|
envp = GETENV(("SST_TF0_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_TF0_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
tf0_clk_del = vtmp;
|
tf0_clk_del = vtmp;
|
||||||
if(GETENV(("SST_TF1_CLK_DEL")) &&
|
envp = GETENV(("SST_TF1_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_TF1_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
tf1_clk_del = vtmp;
|
tf1_clk_del = vtmp;
|
||||||
if(GETENV(("SST_TF2_CLK_DEL")) &&
|
envp = GETENV(("SST_TF2_CLK_DEL"));
|
||||||
(SSCANF(GETENV(("SST_TF2_CLK_DEL")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
tf2_clk_del = vtmp;
|
tf2_clk_del = vtmp;
|
||||||
|
|
||||||
INIT_PRINTF(("sst1InitVideo(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clk_del));
|
INIT_PRINTF(("sst1InitVideo(): Setting FBI-to-TREX clock delay to 0x%x...\n", ft_clk_del));
|
||||||
@@ -708,8 +716,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
|
|
||||||
/* Adjust Video Clock */
|
/* Adjust Video Clock */
|
||||||
#ifndef DIRECTX
|
#ifndef DIRECTX
|
||||||
if(GETENV(("SST_VIDCLK2X")) &&
|
envp = GETENV(("SST_VIDCLK2X"));
|
||||||
(SSCANF(GETENV(("SST_VIDCLK2X")), "%f", &vidClkFreq) == 1) ) {
|
if(envp && (SSCANF(envp, "%f", &vidClkFreq) == 1) ) {
|
||||||
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
if(sst1InitSetVidClk(sstbase, vidClkFreq) == FXFALSE)
|
||||||
return(FXFALSE);
|
return(FXFALSE);
|
||||||
} else {
|
} else {
|
||||||
@@ -750,8 +758,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitVideo(FxU32 *sstbase,
|
|||||||
/* Clear Screen */
|
/* Clear Screen */
|
||||||
FxU32 clearColor = 0x0;
|
FxU32 clearColor = 0x0;
|
||||||
|
|
||||||
if(GETENV(("SST_VIDEO_CLEARCOLOR")) &&
|
envp = GETENV(("SST_VIDEO_CLEARCOLOR"));
|
||||||
(SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &vtmp) == 1) )
|
if(envp && (SSCANF(envp, "%i", &vtmp) == 1) )
|
||||||
clearColor = vtmp;
|
clearColor = vtmp;
|
||||||
ISET(sst->c1, clearColor);
|
ISET(sst->c1, clearColor);
|
||||||
ISET(sst->c0, clearColor);
|
ISET(sst->c0, clearColor);
|
||||||
@@ -796,6 +804,8 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre
|
|||||||
sst1VideoTimingStruct *sstVideoRez = NULL;
|
sst1VideoTimingStruct *sstVideoRez = NULL;
|
||||||
FxU32 sst1MonitorRefresh;
|
FxU32 sst1MonitorRefresh;
|
||||||
FxU32 sst1MonitorRez;
|
FxU32 sst1MonitorRez;
|
||||||
|
const char *envp;
|
||||||
|
int envval;
|
||||||
|
|
||||||
switch(screenResolution) {
|
switch(screenResolution) {
|
||||||
case(GR_RESOLUTION_512x256):
|
case(GR_RESOLUTION_512x256):
|
||||||
@@ -866,35 +876,39 @@ FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScre
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Override settings with environment variables */
|
/* Override settings with environment variables */
|
||||||
if(GETENV(("SST_SCREENREZ"))) {
|
envp = GETENV(("SST_SCREENREZ"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREZ"))) == 640) {
|
if(envp) {
|
||||||
|
envval = ATOI(GETENV(("SST_SCREENREZ")));
|
||||||
|
if(envval == 640) {
|
||||||
sst1MonitorRez = 640;
|
sst1MonitorRez = 640;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 640400) {
|
} else if(envval == 640400) {
|
||||||
sst1MonitorRez = 640400;
|
sst1MonitorRez = 640400;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 800) {
|
} else if(envval == 800) {
|
||||||
sst1MonitorRez = 800;
|
sst1MonitorRez = 800;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512256) {
|
} else if(envval == 512256) {
|
||||||
sst1MonitorRez = 512256;
|
sst1MonitorRez = 512256;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 512) {
|
} else if(envval == 512) {
|
||||||
sst1MonitorRez = 512;
|
sst1MonitorRez = 512;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 856) {
|
} else if(envval == 856) {
|
||||||
sst1MonitorRez = 856;
|
sst1MonitorRez = 856;
|
||||||
} else if(ATOI(GETENV(("SST_SCREENREZ"))) == 960) {
|
} else if(envval == 960) {
|
||||||
sst1MonitorRez = 960;
|
sst1MonitorRez = 960;
|
||||||
} else {
|
} else {
|
||||||
sst1MonitorRez = 640;
|
sst1MonitorRez = 640;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GETENV(("SST_SCREENREFRESH"))) {
|
envp = GETENV(("SST_SCREENREFRESH"));
|
||||||
if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 60)
|
if(envp) {
|
||||||
|
envval = ATOI(GETENV(("SST_SCREENREFRESH")));
|
||||||
|
if(envval == 60)
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 72)
|
else if(envval == 72)
|
||||||
sst1MonitorRefresh = 72;
|
sst1MonitorRefresh = 72;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 75)
|
else if(envval == 75)
|
||||||
sst1MonitorRefresh = 75;
|
sst1MonitorRefresh = 75;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 85)
|
else if(envval == 85)
|
||||||
sst1MonitorRefresh = 85;
|
sst1MonitorRefresh = 85;
|
||||||
else if(ATOI(GETENV(("SST_SCREENREFRESH"))) == 120)
|
else if(envval == 120)
|
||||||
sst1MonitorRefresh = 120;
|
sst1MonitorRefresh = 120;
|
||||||
else
|
else
|
||||||
sst1MonitorRefresh = 60;
|
sst1MonitorRefresh = 60;
|
||||||
|
|||||||
Reference in New Issue
Block a user