summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Winischhofer <thomas@winischhofer.net>2005-07-15 15:35:18 +0000
committerThomas Winischhofer <thomas@winischhofer.net>2005-07-15 15:35:18 +0000
commit73fbbff220d196e173c8da4b81bbe1bf3bf0dccb (patch)
tree14242982048131e8d72b9752450f91673d1a10b7
parente1915b0015c10bfdbf72aa6f1ccbe25a92a628a6 (diff)
SiS driver: Minor fixesXORG-6_8_99_15
-rw-r--r--src/init.c4
-rw-r--r--src/init301.c39
-rw-r--r--src/init301.h2
-rw-r--r--src/sis.h2
-rw-r--r--src/sis_dac.h2
5 files changed, 22 insertions, 27 deletions
diff --git a/src/init.c b/src/init.c
index 277c46e..ff208fb 100644
--- a/src/init.c
+++ b/src/init.c
@@ -1493,6 +1493,8 @@ SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
unsigned short modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex);
unsigned short memorysize = ((modeflag & MemoryInfoFlag) >> MemorySizeShift) + 1;
+ if(!AdapterMemSize) return TRUE;
+
if(AdapterMemSize < memorysize) return FALSE;
return TRUE;
}
@@ -1578,6 +1580,8 @@ SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
unsigned short SISIOMEMTYPE *pBuffer;
int i;
+ if(!memaddr || !memsize) return;
+
if(SiS_Pr->SiS_ModeType >= ModeEGA) {
if(ModeNo > 0x13) {
SiS_SetMemory(memaddr, memsize, 0);
diff --git a/src/init301.c b/src/init301.c
index 8bd51b6..61a2683 100644
--- a/src/init301.c
+++ b/src/init301.c
@@ -443,9 +443,9 @@ SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr)
/*********************************************/
void
-SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned short delaytime)
+SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime)
{
- unsigned short i, j;
+ unsigned int i, j;
for(i = 0; i < delaytime; i++) {
j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
@@ -456,16 +456,7 @@ SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned short delaytime)
static void
SiS_GenericDelay(struct SiS_Private *SiS_Pr, unsigned short delay)
{
- unsigned short temp, flag;
-
- flag = SiS_GetRegByte(0x61) & 0x10;
-
- while(delay) {
- temp = SiS_GetRegByte(0x61) & 0x10;
- if(temp == flag) continue;
- flag = temp;
- delay--;
- }
+ SiS_DDC2Delay(SiS_Pr, delay * 36);
}
#endif
@@ -474,7 +465,7 @@ static void
SiS_LongDelay(struct SiS_Private *SiS_Pr, unsigned short delay)
{
while(delay--) {
- SiS_GenericDelay(SiS_Pr,0x19df);
+ SiS_GenericDelay(SiS_Pr, 6623);
}
}
#endif
@@ -484,7 +475,7 @@ static void
SiS_ShortDelay(struct SiS_Private *SiS_Pr, unsigned short delay)
{
while(delay--) {
- SiS_GenericDelay(SiS_Pr,0x42);
+ SiS_GenericDelay(SiS_Pr, 66);
}
}
#endif
@@ -4423,7 +4414,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
SiS_PanelDelayLoop(SiS_Pr, 3, 2);
if(SiS_Pr->SiS_VBType & VB_SISEMI) {
- SiS_GenericDelay(SiS_Pr, 0x4500);
+ SiS_GenericDelay(SiS_Pr, 17664);
}
}
}
@@ -4492,7 +4483,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
#ifdef SET_EMI
if(SiS_Pr->SiS_VBType & VB_SISEMI) {
SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
- SiS_GenericDelay(SiS_Pr, 0x800);
+ SiS_GenericDelay(SiS_Pr, 2048);
}
#endif
SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c);
@@ -4609,7 +4600,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) {
SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */
- SiS_GenericDelay(SiS_Pr, 0x800);
+ SiS_GenericDelay(SiS_Pr, 2048);
}
SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31);
SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32);
@@ -4630,7 +4621,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
SiS_WaitVBRetrace(SiS_Pr);
SiS_WaitVBRetrace(SiS_Pr);
if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
- SiS_GenericDelay(SiS_Pr, 0x500);
+ SiS_GenericDelay(SiS_Pr, 1280);
}
SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); /* Enable */
}
@@ -4647,7 +4638,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
}
SiS_WaitVBRetrace(SiS_Pr);
if(SiS_Pr->SiS_VBType & VB_SISEMI) {
- SiS_GenericDelay(SiS_Pr, 0x800);
+ SiS_GenericDelay(SiS_Pr, 2048);
SiS_WaitVBRetrace(SiS_Pr);
}
SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
@@ -8379,7 +8370,7 @@ SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr)
if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) {
if(SiS_Pr->ChipType == SIS_740) {
SiS_LongDelay(SiS_Pr, 1);
- SiS_GenericDelay(SiS_Pr, 0x16ff);
+ SiS_GenericDelay(SiS_Pr, 5887);
SiS_SetCH701x(SiS_Pr,0x76,0xac);
SiS_SetCH701x(SiS_Pr,0x66,0x00);
} else {
@@ -8488,7 +8479,7 @@ SiS_ChrontelDoSomething3(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
SiS_SetCH701x(SiS_Pr,0x66,0x45); /* Panel power on */
SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on */
SiS_LongDelay(SiS_Pr, 1);
- SiS_GenericDelay(SiS_Pr, 0x16ff);
+ SiS_GenericDelay(SiS_Pr, 5887);
} else { /* 650 */
@@ -8505,13 +8496,13 @@ SiS_ChrontelDoSomething3(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
SiS_SetCH701x(SiS_Pr,0x66,temp);
if(ModeNo > 0x13) {
if(SiS_WeHaveBacklightCtrl(SiS_Pr)) {
- SiS_GenericDelay(SiS_Pr, 0x3ff);
+ SiS_GenericDelay(SiS_Pr, 1023);
} else {
- SiS_GenericDelay(SiS_Pr, 0x2ff);
+ SiS_GenericDelay(SiS_Pr, 767);
}
} else {
if(!temp1)
- SiS_GenericDelay(SiS_Pr, 0x2ff);
+ SiS_GenericDelay(SiS_Pr, 767);
}
temp = SiS_GetCH701x(SiS_Pr,0x76);
temp |= 0x03;
diff --git a/src/init301.h b/src/init301.h
index 1b5ae81..d729f4e 100644
--- a/src/init301.h
+++ b/src/init301.h
@@ -412,7 +412,7 @@ static BOOLEAN SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *
void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo);
#endif
-void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned short delaytime);
+void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime);
unsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr);
unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine,
unsigned short adaptnum, unsigned short DDCdatatype,
diff --git a/src/sis.h b/src/sis.h
index 258b420..3e127eb 100644
--- a/src/sis.h
+++ b/src/sis.h
@@ -37,7 +37,7 @@
#define SISDRIVERVERSIONYEAR 5
#define SISDRIVERVERSIONMONTH 7
-#define SISDRIVERVERSIONDAY 12
+#define SISDRIVERVERSIONDAY 15
#define SISDRIVERREVISION 1
#define SISDRIVERIVERSION ((SISDRIVERVERSIONYEAR << 16) | \
diff --git a/src/sis_dac.h b/src/sis_dac.h
index 48e228c..765e575 100644
--- a/src/sis_dac.h
+++ b/src/sis_dac.h
@@ -64,7 +64,7 @@ extern void SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsig
extern unsigned short SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg);
extern void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val);
extern void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char orval, unsigned char andval);
-extern void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned short delaytime);
+extern void SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime);
extern unsigned short SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr);
extern unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine,
unsigned short adaptnum, unsigned short DDCdatatype, unsigned char *buffer,