aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sis
diff options
context:
space:
mode:
authorRichard Knutsson <ricknu-0@student.ltu.se>2007-02-12 03:55:06 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:42 -0500
commitc30660ead2dd6ced47ac6ad4c099fb9305263ffb (patch)
treeb85e8c6db87e0627924568ac6ad2b5d71965bcfb /drivers/video/sis
parent3aebbd8f92ef1aa3048800b4991db60403b85964 (diff)
[PATCH] drivers/video/sis: Convert to generic boolean
Convert: FALSE -> false TRUE -> true BOOLEAN -> bool Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Cc: Thomas Hellstrom <thomas@tungstengraphics.com> Cc: James Simmons <jsimmons@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/sis')
-rw-r--r--drivers/video/sis/init.c140
-rw-r--r--drivers/video/sis/init.h36
-rw-r--r--drivers/video/sis/init301.c260
-rw-r--r--drivers/video/sis/init301.h14
-rw-r--r--drivers/video/sis/initextlfb.c18
-rw-r--r--drivers/video/sis/sis.h2
-rw-r--r--drivers/video/sis/sis_main.c214
-rw-r--r--drivers/video/sis/sis_main.h112
-rw-r--r--drivers/video/sis/vgatypes.h12
-rw-r--r--drivers/video/sis/vstruct.h44
10 files changed, 420 insertions, 432 deletions
diff --git a/drivers/video/sis/init.c b/drivers/video/sis/init.c
index 2ab3868efde3..c311ad3c3687 100644
--- a/drivers/video/sis/init.c
+++ b/drivers/video/sis/init.c
@@ -317,23 +317,23 @@ InitTo310Pointer(struct SiS_Private *SiS_Pr)
317} 317}
318#endif 318#endif
319 319
320BOOLEAN 320bool
321SiSInitPtr(struct SiS_Private *SiS_Pr) 321SiSInitPtr(struct SiS_Private *SiS_Pr)
322{ 322{
323 if(SiS_Pr->ChipType < SIS_315H) { 323 if(SiS_Pr->ChipType < SIS_315H) {
324#ifdef SIS300 324#ifdef SIS300
325 InitTo300Pointer(SiS_Pr); 325 InitTo300Pointer(SiS_Pr);
326#else 326#else
327 return FALSE; 327 return false;
328#endif 328#endif
329 } else { 329 } else {
330#ifdef SIS315H 330#ifdef SIS315H
331 InitTo310Pointer(SiS_Pr); 331 InitTo310Pointer(SiS_Pr);
332#else 332#else
333 return FALSE; 333 return false;
334#endif 334#endif
335 } 335 }
336 return TRUE; 336 return true;
337} 337}
338 338
339/*********************************************/ 339/*********************************************/
@@ -345,7 +345,7 @@ static
345#endif 345#endif
346unsigned short 346unsigned short
347SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 347SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
348 int Depth, BOOLEAN FSTN, int LCDwidth, int LCDheight) 348 int Depth, bool FSTN, int LCDwidth, int LCDheight)
349{ 349{
350 unsigned short ModeIndex = 0; 350 unsigned short ModeIndex = 0;
351 351
@@ -483,7 +483,7 @@ SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
483 483
484unsigned short 484unsigned short
485SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 485SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
486 int Depth, BOOLEAN FSTN, unsigned short CustomT, int LCDwidth, int LCDheight, 486 int Depth, bool FSTN, unsigned short CustomT, int LCDwidth, int LCDheight,
487 unsigned int VBFlags2) 487 unsigned int VBFlags2)
488{ 488{
489 unsigned short ModeIndex = 0; 489 unsigned short ModeIndex = 0;
@@ -873,7 +873,7 @@ SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDispl
873 break; 873 break;
874 } 874 }
875 875
876 return SiS_GetModeID(VGAEngine, 0, HDisplay, VDisplay, Depth, FALSE, 0, 0); 876 return SiS_GetModeID(VGAEngine, 0, HDisplay, VDisplay, Depth, false, 0, 0);
877} 877}
878 878
879 879
@@ -1020,12 +1020,12 @@ SiS_GetSysFlags(struct SiS_Private *SiS_Pr)
1020 1020
1021 /* 661 and newer: NEVER write non-zero to SR11[7:4] */ 1021 /* 661 and newer: NEVER write non-zero to SR11[7:4] */
1022 /* (SR11 is used for DDC and in enable/disablebridge) */ 1022 /* (SR11 is used for DDC and in enable/disablebridge) */
1023 SiS_Pr->SiS_SensibleSR11 = FALSE; 1023 SiS_Pr->SiS_SensibleSR11 = false;
1024 SiS_Pr->SiS_MyCR63 = 0x63; 1024 SiS_Pr->SiS_MyCR63 = 0x63;
1025 if(SiS_Pr->ChipType >= SIS_330) { 1025 if(SiS_Pr->ChipType >= SIS_330) {
1026 SiS_Pr->SiS_MyCR63 = 0x53; 1026 SiS_Pr->SiS_MyCR63 = 0x53;
1027 if(SiS_Pr->ChipType >= SIS_661) { 1027 if(SiS_Pr->ChipType >= SIS_661) {
1028 SiS_Pr->SiS_SensibleSR11 = TRUE; 1028 SiS_Pr->SiS_SensibleSR11 = true;
1029 } 1029 }
1030 } 1030 }
1031 1031
@@ -1253,7 +1253,7 @@ SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1253/* HELPER: Determine ROM usage */ 1253/* HELPER: Determine ROM usage */
1254/*********************************************/ 1254/*********************************************/
1255 1255
1256BOOLEAN 1256bool
1257SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr) 1257SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr)
1258{ 1258{
1259 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 1259 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
@@ -1261,16 +1261,16 @@ SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr)
1261 1261
1262 if(SiS_Pr->ChipType >= XGI_20) { 1262 if(SiS_Pr->ChipType >= XGI_20) {
1263 /* XGI ROMs don't qualify */ 1263 /* XGI ROMs don't qualify */
1264 return FALSE; 1264 return false;
1265 } else if(SiS_Pr->ChipType >= SIS_761) { 1265 } else if(SiS_Pr->ChipType >= SIS_761) {
1266 /* I very much assume 761, 340 and newer will use new layout */ 1266 /* I very much assume 761, 340 and newer will use new layout */
1267 return TRUE; 1267 return true;
1268 } else if(SiS_Pr->ChipType >= SIS_661) { 1268 } else if(SiS_Pr->ChipType >= SIS_661) {
1269 if((ROMAddr[0x1a] == 'N') && 1269 if((ROMAddr[0x1a] == 'N') &&
1270 (ROMAddr[0x1b] == 'e') && 1270 (ROMAddr[0x1b] == 'e') &&
1271 (ROMAddr[0x1c] == 'w') && 1271 (ROMAddr[0x1c] == 'w') &&
1272 (ROMAddr[0x1d] == 'V')) { 1272 (ROMAddr[0x1d] == 'V')) {
1273 return TRUE; 1273 return true;
1274 } 1274 }
1275 romversoffs = ROMAddr[0x16] | (ROMAddr[0x17] << 8); 1275 romversoffs = ROMAddr[0x16] | (ROMAddr[0x17] << 8);
1276 if(romversoffs) { 1276 if(romversoffs) {
@@ -1280,17 +1280,17 @@ SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr)
1280 } 1280 }
1281 } 1281 }
1282 if((romvmaj != 0) || (romvmin >= 92)) { 1282 if((romvmaj != 0) || (romvmin >= 92)) {
1283 return TRUE; 1283 return true;
1284 } 1284 }
1285 } else if(IS_SIS650740) { 1285 } else if(IS_SIS650740) {
1286 if((ROMAddr[0x1a] == 'N') && 1286 if((ROMAddr[0x1a] == 'N') &&
1287 (ROMAddr[0x1b] == 'e') && 1287 (ROMAddr[0x1b] == 'e') &&
1288 (ROMAddr[0x1c] == 'w') && 1288 (ROMAddr[0x1c] == 'w') &&
1289 (ROMAddr[0x1d] == 'V')) { 1289 (ROMAddr[0x1d] == 'V')) {
1290 return TRUE; 1290 return true;
1291 } 1291 }
1292 } 1292 }
1293 return FALSE; 1293 return false;
1294} 1294}
1295 1295
1296static void 1296static void
@@ -1299,8 +1299,8 @@ SiSDetermineROMUsage(struct SiS_Private *SiS_Pr)
1299 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 1299 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
1300 unsigned short romptr = 0; 1300 unsigned short romptr = 0;
1301 1301
1302 SiS_Pr->SiS_UseROM = FALSE; 1302 SiS_Pr->SiS_UseROM = false;
1303 SiS_Pr->SiS_ROMNew = FALSE; 1303 SiS_Pr->SiS_ROMNew = false;
1304 SiS_Pr->SiS_PWDOffset = 0; 1304 SiS_Pr->SiS_PWDOffset = 0;
1305 1305
1306 if(SiS_Pr->ChipType >= XGI_20) return; 1306 if(SiS_Pr->ChipType >= XGI_20) return;
@@ -1312,15 +1312,15 @@ SiSDetermineROMUsage(struct SiS_Private *SiS_Pr)
1312 * of the BIOS image. 1312 * of the BIOS image.
1313 */ 1313 */
1314 if((ROMAddr[3] == 0xe9) && ((ROMAddr[5] << 8) | ROMAddr[4]) > 0x21a) 1314 if((ROMAddr[3] == 0xe9) && ((ROMAddr[5] << 8) | ROMAddr[4]) > 0x21a)
1315 SiS_Pr->SiS_UseROM = TRUE; 1315 SiS_Pr->SiS_UseROM = true;
1316 } else if(SiS_Pr->ChipType < SIS_315H) { 1316 } else if(SiS_Pr->ChipType < SIS_315H) {
1317 /* Sony's VAIO BIOS 1.09 follows the standard, so perhaps 1317 /* Sony's VAIO BIOS 1.09 follows the standard, so perhaps
1318 * the others do as well 1318 * the others do as well
1319 */ 1319 */
1320 SiS_Pr->SiS_UseROM = TRUE; 1320 SiS_Pr->SiS_UseROM = true;
1321 } else { 1321 } else {
1322 /* 315/330 series stick to the standard(s) */ 1322 /* 315/330 series stick to the standard(s) */
1323 SiS_Pr->SiS_UseROM = TRUE; 1323 SiS_Pr->SiS_UseROM = true;
1324 if((SiS_Pr->SiS_ROMNew = SiSDetermineROMLayout661(SiS_Pr))) { 1324 if((SiS_Pr->SiS_ROMNew = SiSDetermineROMLayout661(SiS_Pr))) {
1325 SiS_Pr->SiS_EMIOffset = 14; 1325 SiS_Pr->SiS_EMIOffset = 14;
1326 SiS_Pr->SiS_PWDOffset = 17; 1326 SiS_Pr->SiS_PWDOffset = 17;
@@ -1488,7 +1488,7 @@ SiS_GetVBType(struct SiS_Private *SiS_Pr)
1488/*********************************************/ 1488/*********************************************/
1489 1489
1490#ifdef SIS_LINUX_KERNEL 1490#ifdef SIS_LINUX_KERNEL
1491static BOOLEAN 1491static bool
1492SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1492SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1493 unsigned short ModeIdIndex) 1493 unsigned short ModeIdIndex)
1494{ 1494{
@@ -1496,10 +1496,10 @@ SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1496 unsigned short modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); 1496 unsigned short modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex);
1497 unsigned short memorysize = ((modeflag & MemoryInfoFlag) >> MemorySizeShift) + 1; 1497 unsigned short memorysize = ((modeflag & MemoryInfoFlag) >> MemorySizeShift) + 1;
1498 1498
1499 if(!AdapterMemSize) return TRUE; 1499 if(!AdapterMemSize) return true;
1500 1500
1501 if(AdapterMemSize < memorysize) return FALSE; 1501 if(AdapterMemSize < memorysize) return false;
1502 return TRUE; 1502 return true;
1503} 1503}
1504#endif 1504#endif
1505 1505
@@ -1605,7 +1605,7 @@ SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
1605/* HELPER: SearchModeID */ 1605/* HELPER: SearchModeID */
1606/*********************************************/ 1606/*********************************************/
1607 1607
1608BOOLEAN 1608bool
1609SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 1609SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo,
1610 unsigned short *ModeIdIndex) 1610 unsigned short *ModeIdIndex)
1611{ 1611{
@@ -1617,7 +1617,7 @@ SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo,
1617 1617
1618 for((*ModeIdIndex) = 0; ;(*ModeIdIndex)++) { 1618 for((*ModeIdIndex) = 0; ;(*ModeIdIndex)++) {
1619 if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == (*ModeNo)) break; 1619 if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == (*ModeNo)) break;
1620 if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == 0xFF) return FALSE; 1620 if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == 0xFF) return false;
1621 } 1621 }
1622 1622
1623 if((*ModeNo) == 0x07) { 1623 if((*ModeNo) == 0x07) {
@@ -1635,11 +1635,11 @@ SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo,
1635 1635
1636 for((*ModeIdIndex) = 0; ;(*ModeIdIndex)++) { 1636 for((*ModeIdIndex) = 0; ;(*ModeIdIndex)++) {
1637 if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == (*ModeNo)) break; 1637 if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == (*ModeNo)) break;
1638 if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == 0xFF) return FALSE; 1638 if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == 0xFF) return false;
1639 } 1639 }
1640 1640
1641 } 1641 }
1642 return TRUE; 1642 return true;
1643} 1643}
1644 1644
1645/*********************************************/ 1645/*********************************************/
@@ -1696,13 +1696,13 @@ SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide
1696/* HELPER: LowModeTests */ 1696/* HELPER: LowModeTests */
1697/*********************************************/ 1697/*********************************************/
1698 1698
1699static BOOLEAN 1699static bool
1700SiS_DoLowModeTest(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 1700SiS_DoLowModeTest(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
1701{ 1701{
1702 unsigned short temp, temp1, temp2; 1702 unsigned short temp, temp1, temp2;
1703 1703
1704 if((ModeNo != 0x03) && (ModeNo != 0x10) && (ModeNo != 0x12)) 1704 if((ModeNo != 0x03) && (ModeNo != 0x10) && (ModeNo != 0x12))
1705 return TRUE; 1705 return true;
1706 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x11); 1706 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x11);
1707 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x11,0x80); 1707 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x11,0x80);
1708 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00); 1708 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00);
@@ -1712,13 +1712,13 @@ SiS_DoLowModeTest(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
1712 SiS_SetReg(SiS_Pr->SiS_P3d4,0x11,temp); 1712 SiS_SetReg(SiS_Pr->SiS_P3d4,0x11,temp);
1713 if((SiS_Pr->ChipType >= SIS_315H) || 1713 if((SiS_Pr->ChipType >= SIS_315H) ||
1714 (SiS_Pr->ChipType == SIS_300)) { 1714 (SiS_Pr->ChipType == SIS_300)) {
1715 if(temp2 == 0x55) return FALSE; 1715 if(temp2 == 0x55) return false;
1716 else return TRUE; 1716 else return true;
1717 } else { 1717 } else {
1718 if(temp2 != 0x55) return TRUE; 1718 if(temp2 != 0x55) return true;
1719 else { 1719 else {
1720 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); 1720 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
1721 return FALSE; 1721 return false;
1722 } 1722 }
1723 } 1723 }
1724} 1724}
@@ -3237,14 +3237,14 @@ static void
3237SiS_SetPitch(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) 3237SiS_SetPitch(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn)
3238{ 3238{
3239 SISPtr pSiS = SISPTR(pScrn); 3239 SISPtr pSiS = SISPTR(pScrn);
3240 BOOLEAN isslavemode = FALSE; 3240 bool isslavemode = false;
3241 3241
3242 if( (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && 3242 if( (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) &&
3243 ( ((pSiS->VGAEngine == SIS_300_VGA) && 3243 ( ((pSiS->VGAEngine == SIS_300_VGA) &&
3244 (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0xa0) == 0x20) || 3244 (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0xa0) == 0x20) ||
3245 ((pSiS->VGAEngine == SIS_315_VGA) && 3245 ((pSiS->VGAEngine == SIS_315_VGA) &&
3246 (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x50) == 0x10) ) ) { 3246 (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x50) == 0x10) ) ) {
3247 isslavemode = TRUE; 3247 isslavemode = true;
3248 } 3248 }
3249 3249
3250 /* We need to set pitch for CRT1 if bridge is in slave mode, too */ 3250 /* We need to set pitch for CRT1 if bridge is in slave mode, too */
@@ -3264,10 +3264,10 @@ SiS_SetPitch(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn)
3264 3264
3265#ifdef SIS_XORG_XF86 3265#ifdef SIS_XORG_XF86
3266/* We need pScrn for setting the pitch correctly */ 3266/* We need pScrn for setting the pitch correctly */
3267BOOLEAN 3267bool
3268SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, BOOLEAN dosetpitch) 3268SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, bool dosetpitch)
3269#else 3269#else
3270BOOLEAN 3270bool
3271SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 3271SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3272#endif 3272#endif
3273{ 3273{
@@ -3277,8 +3277,8 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3277#ifdef SIS_LINUX_KERNEL 3277#ifdef SIS_LINUX_KERNEL
3278 unsigned short KeepLockReg; 3278 unsigned short KeepLockReg;
3279 3279
3280 SiS_Pr->UseCustomMode = FALSE; 3280 SiS_Pr->UseCustomMode = false;
3281 SiS_Pr->CRT1UsesCustomMode = FALSE; 3281 SiS_Pr->CRT1UsesCustomMode = false;
3282#endif 3282#endif
3283 3283
3284 SiS_Pr->SiS_flag_clearbuffer = 0; 3284 SiS_Pr->SiS_flag_clearbuffer = 0;
@@ -3317,7 +3317,7 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3317 SiS_UnLockCRT2(SiS_Pr); 3317 SiS_UnLockCRT2(SiS_Pr);
3318 3318
3319 if(!SiS_Pr->UseCustomMode) { 3319 if(!SiS_Pr->UseCustomMode) {
3320 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE; 3320 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false;
3321 } else { 3321 } else {
3322 ModeIdIndex = 0; 3322 ModeIdIndex = 0;
3323 } 3323 }
@@ -3347,18 +3347,18 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3347#ifdef SIS_LINUX_KERNEL 3347#ifdef SIS_LINUX_KERNEL
3348 /* Check memory size (kernel framebuffer driver only) */ 3348 /* Check memory size (kernel framebuffer driver only) */
3349 if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) { 3349 if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) {
3350 return FALSE; 3350 return false;
3351 } 3351 }
3352#endif 3352#endif
3353 3353
3354 SiS_OpenCRTC(SiS_Pr); 3354 SiS_OpenCRTC(SiS_Pr);
3355 3355
3356 if(SiS_Pr->UseCustomMode) { 3356 if(SiS_Pr->UseCustomMode) {
3357 SiS_Pr->CRT1UsesCustomMode = TRUE; 3357 SiS_Pr->CRT1UsesCustomMode = true;
3358 SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock; 3358 SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock;
3359 SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag; 3359 SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag;
3360 } else { 3360 } else {
3361 SiS_Pr->CRT1UsesCustomMode = FALSE; 3361 SiS_Pr->CRT1UsesCustomMode = false;
3362 } 3362 }
3363 3363
3364 /* Set mode on CRT1 */ 3364 /* Set mode on CRT1 */
@@ -3445,7 +3445,7 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3445 if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00); 3445 if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00);
3446#endif 3446#endif
3447 3447
3448 return TRUE; 3448 return true;
3449} 3449}
3450 3450
3451/*********************************************/ 3451/*********************************************/
@@ -3454,14 +3454,14 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
3454/*********************************************/ 3454/*********************************************/
3455 3455
3456#ifdef SIS_XORG_XF86 3456#ifdef SIS_XORG_XF86
3457BOOLEAN 3457bool
3458SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3458SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3459 DisplayModePtr mode, BOOLEAN IsCustom) 3459 DisplayModePtr mode, bool IsCustom)
3460{ 3460{
3461 SISPtr pSiS = SISPTR(pScrn); 3461 SISPtr pSiS = SISPTR(pScrn);
3462 unsigned short ModeNo = 0; 3462 unsigned short ModeNo = 0;
3463 3463
3464 SiS_Pr->UseCustomMode = FALSE; 3464 SiS_Pr->UseCustomMode = false;
3465 3465
3466 if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3466 if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) {
3467 3467
@@ -3475,13 +3475,13 @@ SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3475 3475
3476 /* Don't need vbflags here; checks done earlier */ 3476 /* Don't need vbflags here; checks done earlier */
3477 ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); 3477 ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags);
3478 if(!ModeNo) return FALSE; 3478 if(!ModeNo) return false;
3479 3479
3480 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo); 3480 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo);
3481 3481
3482 } 3482 }
3483 3483
3484 return(SiSSetMode(SiS_Pr, pScrn, ModeNo, TRUE)); 3484 return(SiSSetMode(SiS_Pr, pScrn, ModeNo, true));
3485} 3485}
3486 3486
3487/*********************************************/ 3487/*********************************************/
@@ -3489,9 +3489,9 @@ SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3489/* for Dual-Head modes */ 3489/* for Dual-Head modes */
3490/*********************************************/ 3490/*********************************************/
3491 3491
3492BOOLEAN 3492bool
3493SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3493SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3494 DisplayModePtr mode, BOOLEAN IsCustom) 3494 DisplayModePtr mode, bool IsCustom)
3495{ 3495{
3496 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3496 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress;
3497 SISPtr pSiS = SISPTR(pScrn); 3497 SISPtr pSiS = SISPTR(pScrn);
@@ -3502,7 +3502,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3502 unsigned short ModeNo = 0; 3502 unsigned short ModeNo = 0;
3503 unsigned char backupreg = 0; 3503 unsigned char backupreg = 0;
3504 3504
3505 SiS_Pr->UseCustomMode = FALSE; 3505 SiS_Pr->UseCustomMode = false;
3506 3506
3507 /* Remember: Custom modes for CRT2 are ONLY supported 3507 /* Remember: Custom modes for CRT2 are ONLY supported
3508 * -) on the 30x/B/C, and 3508 * -) on the 30x/B/C, and
@@ -3516,7 +3516,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3516 } else { 3516 } else {
3517 3517
3518 ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); 3518 ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags);
3519 if(!ModeNo) return FALSE; 3519 if(!ModeNo) return false;
3520 3520
3521 } 3521 }
3522 3522
@@ -3550,10 +3550,10 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3550 if(pSiSEnt->CRT1ModeNo == -1) { 3550 if(pSiSEnt->CRT1ModeNo == -1) {
3551 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3551 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
3552 "Setting CRT2 mode delayed until after setting CRT1 mode\n"); 3552 "Setting CRT2 mode delayed until after setting CRT1 mode\n");
3553 return TRUE; 3553 return true;
3554 } 3554 }
3555#endif 3555#endif
3556 pSiSEnt->CRT2ModeSet = TRUE; 3556 pSiSEnt->CRT2ModeSet = true;
3557 } 3557 }
3558#endif 3558#endif
3559 3559
@@ -3578,7 +3578,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3578 SiS_UnLockCRT2(SiS_Pr); 3578 SiS_UnLockCRT2(SiS_Pr);
3579 3579
3580 if(!SiS_Pr->UseCustomMode) { 3580 if(!SiS_Pr->UseCustomMode) {
3581 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE; 3581 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false;
3582 } else { 3582 } else {
3583 ModeIdIndex = 0; 3583 ModeIdIndex = 0;
3584 } 3584 }
@@ -3658,7 +3658,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3658 3658
3659 SiS_Handle760(SiS_Pr); 3659 SiS_Handle760(SiS_Pr);
3660 3660
3661 return TRUE; 3661 return true;
3662} 3662}
3663 3663
3664/*********************************************/ 3664/*********************************************/
@@ -3666,9 +3666,9 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3666/* for Dual-Head modes */ 3666/* for Dual-Head modes */
3667/*********************************************/ 3667/*********************************************/
3668 3668
3669BOOLEAN 3669bool
3670SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3670SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3671 DisplayModePtr mode, BOOLEAN IsCustom) 3671 DisplayModePtr mode, bool IsCustom)
3672{ 3672{
3673 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3673 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress;
3674 SISPtr pSiS = SISPTR(pScrn); 3674 SISPtr pSiS = SISPTR(pScrn);
@@ -3677,10 +3677,10 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3677#ifdef SISDUALHEAD 3677#ifdef SISDUALHEAD
3678 SISEntPtr pSiSEnt = pSiS->entityPrivate; 3678 SISEntPtr pSiSEnt = pSiS->entityPrivate;
3679 unsigned char backupcr30, backupcr31, backupcr38, backupcr35, backupp40d=0; 3679 unsigned char backupcr30, backupcr31, backupcr38, backupcr35, backupp40d=0;
3680 BOOLEAN backupcustom; 3680 bool backupcustom;
3681#endif 3681#endif
3682 3682
3683 SiS_Pr->UseCustomMode = FALSE; 3683 SiS_Pr->UseCustomMode = false;
3684 3684
3685 if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3685 if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) {
3686 3686
@@ -3697,7 +3697,7 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3697 } else { 3697 } else {
3698 3698
3699 ModeNo = SiS_GetModeNumber(pScrn, mode, 0); /* don't give VBFlags */ 3699 ModeNo = SiS_GetModeNumber(pScrn, mode, 0); /* don't give VBFlags */
3700 if(!ModeNo) return FALSE; 3700 if(!ModeNo) return false;
3701 3701
3702 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3702 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
3703 "Setting standard mode 0x%x on CRT1\n", ModeNo); 3703 "Setting standard mode 0x%x on CRT1\n", ModeNo);
@@ -3721,7 +3721,7 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3721 SiS_UnLockCRT2(SiS_Pr); 3721 SiS_UnLockCRT2(SiS_Pr);
3722 3722
3723 if(!SiS_Pr->UseCustomMode) { 3723 if(!SiS_Pr->UseCustomMode) {
3724 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE; 3724 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false;
3725 } else { 3725 } else {
3726 ModeIdIndex = 0; 3726 ModeIdIndex = 0;
3727 } 3727 }
@@ -3771,11 +3771,11 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3771#endif 3771#endif
3772 3772
3773 if(SiS_Pr->UseCustomMode) { 3773 if(SiS_Pr->UseCustomMode) {
3774 SiS_Pr->CRT1UsesCustomMode = TRUE; 3774 SiS_Pr->CRT1UsesCustomMode = true;
3775 SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock; 3775 SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock;
3776 SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag; 3776 SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag;
3777 } else { 3777 } else {
3778 SiS_Pr->CRT1UsesCustomMode = FALSE; 3778 SiS_Pr->CRT1UsesCustomMode = false;
3779 } 3779 }
3780 3780
3781 /* Reset CRT2 if changing mode on CRT1 */ 3781 /* Reset CRT2 if changing mode on CRT1 */
@@ -3838,7 +3838,7 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
3838 /* Backup/Set ModeNo in BIOS scratch area */ 3838 /* Backup/Set ModeNo in BIOS scratch area */
3839 SiS_GetSetModeID(pScrn,ModeNo); 3839 SiS_GetSetModeID(pScrn,ModeNo);
3840 3840
3841 return TRUE; 3841 return true;
3842} 3842}
3843#endif /* Linux_XF86 */ 3843#endif /* Linux_XF86 */
3844 3844
@@ -4082,7 +4082,7 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
4082 DisplayModePtr current 4082 DisplayModePtr current
4083#endif 4083#endif
4084#ifdef SIS_LINUX_KERNEL 4084#ifdef SIS_LINUX_KERNEL
4085 struct fb_var_screeninfo *var, BOOLEAN writeres 4085 struct fb_var_screeninfo *var, bool writeres
4086#endif 4086#endif
4087) 4087)
4088{ 4088{
diff --git a/drivers/video/sis/init.h b/drivers/video/sis/init.h
index 59d12844b4dd..f40a680df86f 100644
--- a/drivers/video/sis/init.h
+++ b/drivers/video/sis/init.h
@@ -1521,13 +1521,13 @@ static const struct SiS_LVDSCRT1Data SiS_LVDSCRT1640x480_1_H[] =
1521 0x00}} 1521 0x00}}
1522}; 1522};
1523 1523
1524BOOLEAN SiSInitPtr(struct SiS_Private *SiS_Pr); 1524bool SiSInitPtr(struct SiS_Private *SiS_Pr);
1525#ifdef SIS_XORG_XF86 1525#ifdef SIS_XORG_XF86
1526unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 1526unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay,
1527 int Depth, BOOLEAN FSTN, int LCDwith, int LCDheight); 1527 int Depth, bool FSTN, int LCDwith, int LCDheight);
1528#endif 1528#endif
1529unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 1529unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay,
1530 int VDisplay, int Depth, BOOLEAN FSTN, 1530 int VDisplay, int Depth, bool FSTN,
1531 unsigned short CustomT, int LCDwith, int LCDheight, 1531 unsigned short CustomT, int LCDwith, int LCDheight,
1532 unsigned int VBFlags2); 1532 unsigned int VBFlags2);
1533unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, 1533unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay,
@@ -1558,12 +1558,12 @@ void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable);
1558void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 1558void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable);
1559unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1559unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1560 unsigned short ModeIdIndex); 1560 unsigned short ModeIdIndex);
1561BOOLEAN SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 1561bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr);
1562#ifndef SIS_LINUX_KERNEL 1562#ifndef SIS_LINUX_KERNEL
1563void SiS_GetVBType(struct SiS_Private *SiS_Pr); 1563void SiS_GetVBType(struct SiS_Private *SiS_Pr);
1564#endif 1564#endif
1565 1565
1566BOOLEAN SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 1566bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo,
1567 unsigned short *ModeIdIndex); 1567 unsigned short *ModeIdIndex);
1568unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1568unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1569 unsigned short ModeIdIndex); 1569 unsigned short ModeIdIndex);
@@ -1581,17 +1581,17 @@ unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned shor
1581#endif 1581#endif
1582void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1582void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
1583#ifdef SIS_XORG_XF86 1583#ifdef SIS_XORG_XF86
1584BOOLEAN SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, 1584bool SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo,
1585 BOOLEAN dosetpitch); 1585 bool dosetpitch);
1586BOOLEAN SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1586bool SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
1587 DisplayModePtr mode, BOOLEAN IsCustom); 1587 DisplayModePtr mode, bool IsCustom);
1588BOOLEAN SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1588bool SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
1589 DisplayModePtr mode, BOOLEAN IsCustom); 1589 DisplayModePtr mode, bool IsCustom);
1590BOOLEAN SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1590bool SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn,
1591 DisplayModePtr mode, BOOLEAN IsCustom); 1591 DisplayModePtr mode, bool IsCustom);
1592#endif 1592#endif
1593#ifdef SIS_LINUX_KERNEL 1593#ifdef SIS_LINUX_KERNEL
1594BOOLEAN SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 1594bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
1595#endif 1595#endif
1596void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1596void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth);
1597void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1597void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
@@ -1602,7 +1602,7 @@ void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdat
1602#endif 1602#endif
1603#ifdef SIS_LINUX_KERNEL 1603#ifdef SIS_LINUX_KERNEL
1604void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1604void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres,
1605 int yres, struct fb_var_screeninfo *var, BOOLEAN writeres); 1605 int yres, struct fb_var_screeninfo *var, bool writeres);
1606#endif 1606#endif
1607 1607
1608/* From init301.c: */ 1608/* From init301.c: */
@@ -1615,7 +1615,7 @@ extern void SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1615 unsigned short ModeIdIndex); 1615 unsigned short ModeIdIndex);
1616extern void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); 1616extern void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr);
1617extern void SiS_DisableBridge(struct SiS_Private *); 1617extern void SiS_DisableBridge(struct SiS_Private *);
1618extern BOOLEAN SiS_SetCRT2Group(struct SiS_Private *, unsigned short); 1618extern bool SiS_SetCRT2Group(struct SiS_Private *, unsigned short);
1619extern unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1619extern unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1620 unsigned short ModeIdIndex); 1620 unsigned short ModeIdIndex);
1621extern void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); 1621extern void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr);
@@ -1624,8 +1624,8 @@ extern unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short
1624extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); 1624extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax);
1625extern unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1625extern unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
1626 unsigned short ModeIdIndex, unsigned short RRTI); 1626 unsigned short ModeIdIndex, unsigned short RRTI);
1627extern BOOLEAN SiS_IsVAMode(struct SiS_Private *); 1627extern bool SiS_IsVAMode(struct SiS_Private *);
1628extern BOOLEAN SiS_IsDualEdge(struct SiS_Private *); 1628extern bool SiS_IsDualEdge(struct SiS_Private *);
1629 1629
1630#ifdef SIS_XORG_XF86 1630#ifdef SIS_XORG_XF86
1631/* From other modules: */ 1631/* From other modules: */
diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
index 47e1896cffeb..da33d801c22e 100644
--- a/drivers/video/sis/init301.c
+++ b/drivers/video/sis/init301.c
@@ -200,7 +200,7 @@ GetLCDStructPtr661_2(struct SiS_Private *SiS_Pr)
200/* Adjust Rate for CRT2 */ 200/* Adjust Rate for CRT2 */
201/*********************************************/ 201/*********************************************/
202 202
203static BOOLEAN 203static bool
204SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 204SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex,
205 unsigned short RRTI, unsigned short *i) 205 unsigned short RRTI, unsigned short *i)
206{ 206{
@@ -269,7 +269,7 @@ SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
269 /* Look backwards in table for matching CRT2 mode */ 269 /* Look backwards in table for matching CRT2 mode */
270 for(; SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID == modeid; (*i)--) { 270 for(; SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID == modeid; (*i)--) {
271 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; 271 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag;
272 if(infoflag & checkmask) return TRUE; 272 if(infoflag & checkmask) return true;
273 if((*i) == 0) break; 273 if((*i) == 0) break;
274 } 274 }
275 275
@@ -279,9 +279,9 @@ SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
279 for((*i) = 0; ; (*i)++) { 279 for((*i) = 0; ; (*i)++) {
280 if(SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID != modeid) break; 280 if(SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID != modeid) break;
281 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; 281 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag;
282 if(infoflag & checkmask) return TRUE; 282 if(infoflag & checkmask) return true;
283 } 283 }
284 return FALSE; 284 return false;
285} 285}
286 286
287/*********************************************/ 287/*********************************************/
@@ -405,7 +405,7 @@ SiS_SaveCRT2Info(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
405/*********************************************/ 405/*********************************************/
406 406
407#ifdef SIS300 407#ifdef SIS300
408static BOOLEAN 408static bool
409SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) 409SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr)
410{ 410{
411 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 411 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
@@ -415,13 +415,13 @@ SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr)
415 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { 415 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
416 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); 416 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f);
417 temp1 = SISGETROMW(0x23b); 417 temp1 = SISGETROMW(0x23b);
418 if(temp1 & temp) return TRUE; 418 if(temp1 & temp) return true;
419 } 419 }
420 } 420 }
421 return FALSE; 421 return false;
422} 422}
423 423
424static BOOLEAN 424static bool
425SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr) 425SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr)
426{ 426{
427 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 427 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
@@ -431,10 +431,10 @@ SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr)
431 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { 431 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
432 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); 432 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f);
433 temp1 = SISGETROMW(0x23d); 433 temp1 = SISGETROMW(0x23d);
434 if(temp1 & temp) return TRUE; 434 if(temp1 & temp) return true;
435 } 435 }
436 } 436 }
437 return FALSE; 437 return false;
438} 438}
439#endif 439#endif
440 440
@@ -687,38 +687,38 @@ SiS_VBLongWait(struct SiS_Private *SiS_Pr)
687/*********************************************/ 687/*********************************************/
688 688
689#ifdef SIS300 689#ifdef SIS300
690static BOOLEAN 690static bool
691SiS_Is301B(struct SiS_Private *SiS_Pr) 691SiS_Is301B(struct SiS_Private *SiS_Pr)
692{ 692{
693 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return TRUE; 693 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return true;
694 return FALSE; 694 return false;
695} 695}
696#endif 696#endif
697 697
698static BOOLEAN 698static bool
699SiS_CRT2IsLCD(struct SiS_Private *SiS_Pr) 699SiS_CRT2IsLCD(struct SiS_Private *SiS_Pr)
700{ 700{
701 if(SiS_Pr->ChipType == SIS_730) { 701 if(SiS_Pr->ChipType == SIS_730) {
702 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return TRUE; 702 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return true;
703 } 703 }
704 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return TRUE; 704 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return true;
705 return FALSE; 705 return false;
706} 706}
707 707
708BOOLEAN 708bool
709SiS_IsDualEdge(struct SiS_Private *SiS_Pr) 709SiS_IsDualEdge(struct SiS_Private *SiS_Pr)
710{ 710{
711#ifdef SIS315H 711#ifdef SIS315H
712 if(SiS_Pr->ChipType >= SIS_315H) { 712 if(SiS_Pr->ChipType >= SIS_315H) {
713 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { 713 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) {
714 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return TRUE; 714 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true;
715 } 715 }
716 } 716 }
717#endif 717#endif
718 return FALSE; 718 return false;
719} 719}
720 720
721BOOLEAN 721bool
722SiS_IsVAMode(struct SiS_Private *SiS_Pr) 722SiS_IsVAMode(struct SiS_Private *SiS_Pr)
723{ 723{
724#ifdef SIS315H 724#ifdef SIS315H
@@ -726,70 +726,70 @@ SiS_IsVAMode(struct SiS_Private *SiS_Pr)
726 726
727 if(SiS_Pr->ChipType >= SIS_315H) { 727 if(SiS_Pr->ChipType >= SIS_315H) {
728 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 728 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
729 if((flag & EnableDualEdge) && (flag & SetToLCDA)) return TRUE; 729 if((flag & EnableDualEdge) && (flag & SetToLCDA)) return true;
730 } 730 }
731#endif 731#endif
732 return FALSE; 732 return false;
733} 733}
734 734
735#ifdef SIS315H 735#ifdef SIS315H
736static BOOLEAN 736static bool
737SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) 737SiS_IsVAorLCD(struct SiS_Private *SiS_Pr)
738{ 738{
739 if(SiS_IsVAMode(SiS_Pr)) return TRUE; 739 if(SiS_IsVAMode(SiS_Pr)) return true;
740 if(SiS_CRT2IsLCD(SiS_Pr)) return TRUE; 740 if(SiS_CRT2IsLCD(SiS_Pr)) return true;
741 return FALSE; 741 return false;
742} 742}
743#endif 743#endif
744 744
745static BOOLEAN 745static bool
746SiS_IsDualLink(struct SiS_Private *SiS_Pr) 746SiS_IsDualLink(struct SiS_Private *SiS_Pr)
747{ 747{
748#ifdef SIS315H 748#ifdef SIS315H
749 if(SiS_Pr->ChipType >= SIS_315H) { 749 if(SiS_Pr->ChipType >= SIS_315H) {
750 if((SiS_CRT2IsLCD(SiS_Pr)) || 750 if((SiS_CRT2IsLCD(SiS_Pr)) ||
751 (SiS_IsVAMode(SiS_Pr))) { 751 (SiS_IsVAMode(SiS_Pr))) {
752 if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return TRUE; 752 if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return true;
753 } 753 }
754 } 754 }
755#endif 755#endif
756 return FALSE; 756 return false;
757} 757}
758 758
759#ifdef SIS315H 759#ifdef SIS315H
760static BOOLEAN 760static bool
761SiS_TVEnabled(struct SiS_Private *SiS_Pr) 761SiS_TVEnabled(struct SiS_Private *SiS_Pr)
762{ 762{
763 if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return TRUE; 763 if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return true;
764 if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { 764 if(SiS_Pr->SiS_VBType & VB_SISYPBPR) {
765 if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return TRUE; 765 if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return true;
766 } 766 }
767 return FALSE; 767 return false;
768} 768}
769#endif 769#endif
770 770
771#ifdef SIS315H 771#ifdef SIS315H
772static BOOLEAN 772static bool
773SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) 773SiS_LCDAEnabled(struct SiS_Private *SiS_Pr)
774{ 774{
775 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return TRUE; 775 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return true;
776 return FALSE; 776 return false;
777} 777}
778#endif 778#endif
779 779
780#ifdef SIS315H 780#ifdef SIS315H
781static BOOLEAN 781static bool
782SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) 782SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr)
783{ 783{
784 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) { 784 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) {
785 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return TRUE; 785 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return true;
786 } 786 }
787 return FALSE; 787 return false;
788} 788}
789#endif 789#endif
790 790
791#ifdef SIS315H 791#ifdef SIS315H
792static BOOLEAN 792static bool
793SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) 793SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr)
794{ 794{
795 unsigned short flag; 795 unsigned short flag;
@@ -798,90 +798,90 @@ SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr)
798 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; 798 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0;
799 /* Check for revision != A0 only */ 799 /* Check for revision != A0 only */
800 if((flag == 0xe0) || (flag == 0xc0) || 800 if((flag == 0xe0) || (flag == 0xc0) ||
801 (flag == 0xb0) || (flag == 0x90)) return FALSE; 801 (flag == 0xb0) || (flag == 0x90)) return false;
802 } else if(SiS_Pr->ChipType >= SIS_661) return FALSE; 802 } else if(SiS_Pr->ChipType >= SIS_661) return false;
803 return TRUE; 803 return true;
804} 804}
805#endif 805#endif
806 806
807#ifdef SIS315H 807#ifdef SIS315H
808static BOOLEAN 808static bool
809SiS_IsYPbPr(struct SiS_Private *SiS_Pr) 809SiS_IsYPbPr(struct SiS_Private *SiS_Pr)
810{ 810{
811 if(SiS_Pr->ChipType >= SIS_315H) { 811 if(SiS_Pr->ChipType >= SIS_315H) {
812 /* YPrPb = 0x08 */ 812 /* YPrPb = 0x08 */
813 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return TRUE; 813 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return true;
814 } 814 }
815 return FALSE; 815 return false;
816} 816}
817#endif 817#endif
818 818
819#ifdef SIS315H 819#ifdef SIS315H
820static BOOLEAN 820static bool
821SiS_IsChScart(struct SiS_Private *SiS_Pr) 821SiS_IsChScart(struct SiS_Private *SiS_Pr)
822{ 822{
823 if(SiS_Pr->ChipType >= SIS_315H) { 823 if(SiS_Pr->ChipType >= SIS_315H) {
824 /* Scart = 0x04 */ 824 /* Scart = 0x04 */
825 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return TRUE; 825 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return true;
826 } 826 }
827 return FALSE; 827 return false;
828} 828}
829#endif 829#endif
830 830
831#ifdef SIS315H 831#ifdef SIS315H
832static BOOLEAN 832static bool
833SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) 833SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr)
834{ 834{
835 unsigned short flag; 835 unsigned short flag;
836 836
837 if(SiS_Pr->ChipType >= SIS_315H) { 837 if(SiS_Pr->ChipType >= SIS_315H) {
838 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 838 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
839 if(flag & SetCRT2ToTV) return TRUE; 839 if(flag & SetCRT2ToTV) return true;
840 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 840 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
841 if(flag & EnableCHYPbPr) return TRUE; /* = YPrPb = 0x08 */ 841 if(flag & EnableCHYPbPr) return true; /* = YPrPb = 0x08 */
842 if(flag & EnableCHScart) return TRUE; /* = Scart = 0x04 - TW */ 842 if(flag & EnableCHScart) return true; /* = Scart = 0x04 - TW */
843 } else { 843 } else {
844 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 844 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
845 if(flag & SetCRT2ToTV) return TRUE; 845 if(flag & SetCRT2ToTV) return true;
846 } 846 }
847 return FALSE; 847 return false;
848} 848}
849#endif 849#endif
850 850
851#ifdef SIS315H 851#ifdef SIS315H
852static BOOLEAN 852static bool
853SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) 853SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr)
854{ 854{
855 unsigned short flag; 855 unsigned short flag;
856 856
857 if(SiS_Pr->ChipType >= SIS_315H) { 857 if(SiS_Pr->ChipType >= SIS_315H) {
858 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 858 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
859 if(flag & SetCRT2ToLCD) return TRUE; 859 if(flag & SetCRT2ToLCD) return true;
860 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 860 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
861 if(flag & SetToLCDA) return TRUE; 861 if(flag & SetToLCDA) return true;
862 } else { 862 } else {
863 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 863 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
864 if(flag & SetCRT2ToLCD) return TRUE; 864 if(flag & SetCRT2ToLCD) return true;
865 } 865 }
866 return FALSE; 866 return false;
867} 867}
868#endif 868#endif
869 869
870static BOOLEAN 870static bool
871SiS_HaveBridge(struct SiS_Private *SiS_Pr) 871SiS_HaveBridge(struct SiS_Private *SiS_Pr)
872{ 872{
873 unsigned short flag; 873 unsigned short flag;
874 874
875 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 875 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
876 return TRUE; 876 return true;
877 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { 877 } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
878 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); 878 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
879 if((flag == 1) || (flag == 2)) return TRUE; 879 if((flag == 1) || (flag == 2)) return true;
880 } 880 }
881 return FALSE; 881 return false;
882} 882}
883 883
884static BOOLEAN 884static bool
885SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr) 885SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr)
886{ 886{
887 unsigned short flag; 887 unsigned short flag;
@@ -890,23 +890,23 @@ SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr)
890 flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); 890 flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
891 if(SiS_Pr->ChipType < SIS_315H) { 891 if(SiS_Pr->ChipType < SIS_315H) {
892 flag &= 0xa0; 892 flag &= 0xa0;
893 if((flag == 0x80) || (flag == 0x20)) return TRUE; 893 if((flag == 0x80) || (flag == 0x20)) return true;
894 } else { 894 } else {
895 flag &= 0x50; 895 flag &= 0x50;
896 if((flag == 0x40) || (flag == 0x10)) return TRUE; 896 if((flag == 0x40) || (flag == 0x10)) return true;
897 } 897 }
898 } 898 }
899 return FALSE; 899 return false;
900} 900}
901 901
902static BOOLEAN 902static bool
903SiS_BridgeInSlavemode(struct SiS_Private *SiS_Pr) 903SiS_BridgeInSlavemode(struct SiS_Private *SiS_Pr)
904{ 904{
905 unsigned short flag1; 905 unsigned short flag1;
906 906
907 flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); 907 flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31);
908 if(flag1 & (SetInSlaveMode >> 8)) return TRUE; 908 if(flag1 & (SetInSlaveMode >> 8)) return true;
909 return FALSE; 909 return false;
910} 910}
911 911
912/*********************************************/ 912/*********************************************/
@@ -1461,11 +1461,11 @@ SiS_GetLCDInfoBIOS(struct SiS_Private *SiS_Pr)
1461 1461
1462 if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { 1462 if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) {
1463 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { 1463 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) {
1464 SiS_Pr->SiS_NeedRomModeData = TRUE; 1464 SiS_Pr->SiS_NeedRomModeData = true;
1465 SiS_Pr->PanelHT = temp; 1465 SiS_Pr->PanelHT = temp;
1466 } 1466 }
1467 if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) { 1467 if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) {
1468 SiS_Pr->SiS_NeedRomModeData = TRUE; 1468 SiS_Pr->SiS_NeedRomModeData = true;
1469 SiS_Pr->PanelVT = temp; 1469 SiS_Pr->PanelVT = temp;
1470 } 1470 }
1471 SiS_Pr->PanelHRS = SISGETROMW(10); 1471 SiS_Pr->PanelHRS = SISGETROMW(10);
@@ -1516,7 +1516,7 @@ void
1516SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) 1516SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex)
1517{ 1517{
1518 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; 1518 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0;
1519 BOOLEAN panelcanscale = FALSE; 1519 bool panelcanscale = false;
1520#ifdef SIS300 1520#ifdef SIS300
1521 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 1521 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
1522 static const unsigned char SiS300SeriesLCDRes[] = 1522 static const unsigned char SiS300SeriesLCDRes[] =
@@ -1534,10 +1534,10 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
1534 SiS_Pr->PanelHRE = 999; /* HSync end */ 1534 SiS_Pr->PanelHRE = 999; /* HSync end */
1535 SiS_Pr->PanelVRS = 999; /* VSync start */ 1535 SiS_Pr->PanelVRS = 999; /* VSync start */
1536 SiS_Pr->PanelVRE = 999; /* VSync end */ 1536 SiS_Pr->PanelVRE = 999; /* VSync end */
1537 SiS_Pr->SiS_NeedRomModeData = FALSE; 1537 SiS_Pr->SiS_NeedRomModeData = false;
1538 1538
1539 /* Alternative 1600x1200@60 timing for 1600x1200 LCDA */ 1539 /* Alternative 1600x1200@60 timing for 1600x1200 LCDA */
1540 SiS_Pr->Alternate1600x1200 = FALSE; 1540 SiS_Pr->Alternate1600x1200 = false;
1541 1541
1542 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return; 1542 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return;
1543 1543
@@ -1633,7 +1633,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
1633 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; 1633 SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
1634 } 1634 }
1635 1635
1636 panelcanscale = (SiS_Pr->SiS_LCDInfo & DontExpandLCD) ? TRUE : FALSE; 1636 panelcanscale = (bool)(SiS_Pr->SiS_LCDInfo & DontExpandLCD);
1637 1637
1638 if(!SiS_Pr->UsePanelScaler) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; 1638 if(!SiS_Pr->UsePanelScaler) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
1639 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; 1639 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
@@ -1833,7 +1833,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
1833 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 32; 1833 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 32;
1834 SiS_Pr->PanelVRS = 2; SiS_Pr->PanelVRE = 4; 1834 SiS_Pr->PanelVRS = 2; SiS_Pr->PanelVRE = 4;
1835 SiS_Pr->PanelVCLKIdx315 = VCLK130_315; 1835 SiS_Pr->PanelVCLKIdx315 = VCLK130_315;
1836 SiS_Pr->Alternate1600x1200 = TRUE; 1836 SiS_Pr->Alternate1600x1200 = true;
1837 } 1837 }
1838 } else if(SiS_Pr->SiS_IF_DEF_LVDS) { 1838 } else if(SiS_Pr->SiS_IF_DEF_LVDS) {
1839 SiS_Pr->PanelHT = 2048; SiS_Pr->PanelVT = 1320; 1839 SiS_Pr->PanelHT = 2048; SiS_Pr->PanelVT = 1320;
@@ -3448,7 +3448,7 @@ SiS_GetCRT2Data301(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
3448 3448
3449 } else { 3449 } else {
3450 3450
3451 BOOLEAN gotit = FALSE; 3451 bool gotit = false;
3452 3452
3453 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { 3453 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
3454 3454
@@ -3456,7 +3456,7 @@ SiS_GetCRT2Data301(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
3456 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; 3456 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT;
3457 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; 3457 SiS_Pr->SiS_HT = SiS_Pr->PanelHT;
3458 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; 3458 SiS_Pr->SiS_VT = SiS_Pr->PanelVT;
3459 gotit = TRUE; 3459 gotit = true;
3460 3460
3461 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { 3461 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) {
3462 3462
@@ -3474,7 +3474,7 @@ SiS_GetCRT2Data301(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
3474 if(ROMAddr[romptr+9] & 0x80) SiS_Pr->SiS_RVBHRS2 -= tempax; 3474 if(ROMAddr[romptr+9] & 0x80) SiS_Pr->SiS_RVBHRS2 -= tempax;
3475 else SiS_Pr->SiS_RVBHRS2 += tempax; 3475 else SiS_Pr->SiS_RVBHRS2 += tempax;
3476 } 3476 }
3477 if(SiS_Pr->SiS_VGAHT) gotit = TRUE; 3477 if(SiS_Pr->SiS_VGAHT) gotit = true;
3478 else { 3478 else {
3479 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; 3479 SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
3480 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; 3480 SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
@@ -3485,7 +3485,7 @@ SiS_GetCRT2Data301(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
3485 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; 3485 SiS_Pr->SiS_HT = SiS_Pr->PanelHT;
3486 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; 3486 SiS_Pr->SiS_VT = SiS_Pr->PanelVT;
3487 SiS_Pr->SiS_RVBHRS2 = 0; 3487 SiS_Pr->SiS_RVBHRS2 = 0;
3488 gotit = TRUE; 3488 gotit = true;
3489 } 3489 }
3490#endif 3490#endif
3491 3491
@@ -3960,8 +3960,8 @@ SiS_DisableBridge(struct SiS_Private *SiS_Pr)
3960#ifdef SIS315H /* 315 series */ 3960#ifdef SIS315H /* 315 series */
3961 3961
3962 int didpwd = 0; 3962 int didpwd = 0;
3963 BOOLEAN custom1 = ((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || 3963 bool custom1 = (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
3964 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) ? TRUE : FALSE; 3964 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400);
3965 3965
3966 modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f; 3966 modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f;
3967 3967
@@ -4313,7 +4313,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
4313 unsigned short temp=0, tempah; 4313 unsigned short temp=0, tempah;
4314#ifdef SIS315H 4314#ifdef SIS315H
4315 unsigned short temp1, pushax=0; 4315 unsigned short temp1, pushax=0;
4316 BOOLEAN delaylong = FALSE; 4316 bool delaylong = false;
4317#endif 4317#endif
4318 4318
4319 if(SiS_Pr->SiS_VBType & VB_SISVB) { 4319 if(SiS_Pr->SiS_VBType & VB_SISVB) {
@@ -4448,7 +4448,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
4448 4448
4449 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) { 4449 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) {
4450 SiS_PanelDelayLoop(SiS_Pr, 3, 10); 4450 SiS_PanelDelayLoop(SiS_Pr, 3, 10);
4451 delaylong = TRUE; 4451 delaylong = true;
4452 } 4452 }
4453 4453
4454 } 4454 }
@@ -4530,7 +4530,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
4530 SiS_Pr->EMI_33 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 2]; 4530 SiS_Pr->EMI_33 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 2];
4531 if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40; 4531 if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40;
4532 /* emidelay = SISGETROMW((romptr + 0x22)); */ 4532 /* emidelay = SISGETROMW((romptr + 0x22)); */
4533 SiS_Pr->HaveEMI = SiS_Pr->HaveEMILCD = SiS_Pr->OverruleEMI = TRUE; 4533 SiS_Pr->HaveEMI = SiS_Pr->HaveEMILCD = SiS_Pr->OverruleEMI = true;
4534 } 4534 }
4535 } 4535 }
4536 4536
@@ -4644,7 +4644,7 @@ SiS_EnableBridge(struct SiS_Private *SiS_Pr)
4644 SiS_PanelDelayLoop(SiS_Pr, 3, 5); 4644 SiS_PanelDelayLoop(SiS_Pr, 3, 5);
4645 if(delaylong) { 4645 if(delaylong) {
4646 SiS_PanelDelayLoop(SiS_Pr, 3, 5); 4646 SiS_PanelDelayLoop(SiS_Pr, 3, 5);
4647 delaylong = FALSE; 4647 delaylong = false;
4648 } 4648 }
4649 SiS_WaitVBRetrace(SiS_Pr); 4649 SiS_WaitVBRetrace(SiS_Pr);
4650 SiS_WaitVBRetrace(SiS_Pr); 4650 SiS_WaitVBRetrace(SiS_Pr);
@@ -5454,7 +5454,7 @@ SiS_SetGroup1_LVDS(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
5454 unsigned short modeflag, resinfo = 0; 5454 unsigned short modeflag, resinfo = 0;
5455 unsigned short push2, tempax, tempbx, tempcx, temp; 5455 unsigned short push2, tempax, tempbx, tempcx, temp;
5456 unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0; 5456 unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0;
5457 BOOLEAN islvds = FALSE, issis = FALSE, chkdclkfirst = FALSE; 5457 bool islvds = false, issis = false, chkdclkfirst = false;
5458#ifdef SIS300 5458#ifdef SIS300
5459 unsigned short crt2crtc = 0; 5459 unsigned short crt2crtc = 0;
5460#endif 5460#endif
@@ -5480,17 +5480,17 @@ SiS_SetGroup1_LVDS(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
5480 5480
5481 /* is lvds if really LVDS, or 301B-DH with external LVDS transmitter */ 5481 /* is lvds if really LVDS, or 301B-DH with external LVDS transmitter */
5482 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { 5482 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) {
5483 islvds = TRUE; 5483 islvds = true;
5484 } 5484 }
5485 5485
5486 /* is really sis if sis bridge, but not 301B-DH */ 5486 /* is really sis if sis bridge, but not 301B-DH */
5487 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { 5487 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) {
5488 issis = TRUE; 5488 issis = true;
5489 } 5489 }
5490 5490
5491 if((SiS_Pr->ChipType >= SIS_315H) && (islvds) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA))) { 5491 if((SiS_Pr->ChipType >= SIS_315H) && (islvds) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA))) {
5492 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) { 5492 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
5493 chkdclkfirst = TRUE; 5493 chkdclkfirst = true;
5494 } 5494 }
5495 } 5495 }
5496 5496
@@ -6447,13 +6447,13 @@ SiS_SetGroup2_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned
6447 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp); 6447 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp);
6448} 6448}
6449 6449
6450static BOOLEAN 6450static bool
6451SiS_GetCRT2Part2Ptr(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex, 6451SiS_GetCRT2Part2Ptr(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex,
6452 unsigned short RefreshRateTableIndex,unsigned short *CRT2Index, 6452 unsigned short RefreshRateTableIndex,unsigned short *CRT2Index,
6453 unsigned short *ResIndex) 6453 unsigned short *ResIndex)
6454{ 6454{
6455 6455
6456 if(SiS_Pr->ChipType < SIS_315H) return FALSE; 6456 if(SiS_Pr->ChipType < SIS_315H) return false;
6457 6457
6458 if(ModeNo <= 0x13) 6458 if(ModeNo <= 0x13)
6459 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; 6459 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
@@ -6688,7 +6688,7 @@ SiS_SetGroup2(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
6688 unsigned short i, j, tempax, tempbx, tempcx, tempch, tempcl, temp; 6688 unsigned short i, j, tempax, tempbx, tempcx, tempch, tempcl, temp;
6689 unsigned short push2, modeflag, crt2crtc, bridgeoffset; 6689 unsigned short push2, modeflag, crt2crtc, bridgeoffset;
6690 unsigned int longtemp, PhaseIndex; 6690 unsigned int longtemp, PhaseIndex;
6691 BOOLEAN newtvphase; 6691 bool newtvphase;
6692 const unsigned char *TimingPoint; 6692 const unsigned char *TimingPoint;
6693#ifdef SIS315H 6693#ifdef SIS315H
6694 unsigned short resindex, CRT2Index; 6694 unsigned short resindex, CRT2Index;
@@ -6721,11 +6721,11 @@ SiS_SetGroup2(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
6721 PhaseIndex = 0x01; /* SiS_PALPhase */ 6721 PhaseIndex = 0x01; /* SiS_PALPhase */
6722 TimingPoint = SiS_Pr->SiS_PALTiming; 6722 TimingPoint = SiS_Pr->SiS_PALTiming;
6723 6723
6724 newtvphase = FALSE; 6724 newtvphase = false;
6725 if( (SiS_Pr->SiS_VBType & VB_SIS30xBLV) && 6725 if( (SiS_Pr->SiS_VBType & VB_SIS30xBLV) &&
6726 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || 6726 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
6727 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { 6727 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) {
6728 newtvphase = TRUE; 6728 newtvphase = true;
6729 } 6729 }
6730 6730
6731 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { 6731 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
@@ -7754,13 +7754,13 @@ SiS_SetGroup5(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
7754/* MODIFY CRT1 GROUP FOR SLAVE MODE */ 7754/* MODIFY CRT1 GROUP FOR SLAVE MODE */
7755/*********************************************/ 7755/*********************************************/
7756 7756
7757static BOOLEAN 7757static bool
7758SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, 7758SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex,
7759 unsigned short RefreshRateTableIndex, unsigned short *ResIndex, 7759 unsigned short RefreshRateTableIndex, unsigned short *ResIndex,
7760 unsigned short *DisplayType) 7760 unsigned short *DisplayType)
7761 { 7761 {
7762 unsigned short modeflag = 0; 7762 unsigned short modeflag = 0;
7763 BOOLEAN checkhd = TRUE; 7763 bool checkhd = true;
7764 7764
7765 /* Pass 1:1 not supported here */ 7765 /* Pass 1:1 not supported here */
7766 7766
@@ -7792,7 +7792,7 @@ SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
7792 (*DisplayType = 0); 7792 (*DisplayType = 0);
7793 switch(SiS_Pr->SiS_LCDResInfo) { 7793 switch(SiS_Pr->SiS_LCDResInfo) {
7794 case Panel_320x240_1: (*DisplayType) = 50; 7794 case Panel_320x240_1: (*DisplayType) = 50;
7795 checkhd = FALSE; 7795 checkhd = false;
7796 break; 7796 break;
7797 case Panel_320x240_2: (*DisplayType) = 14; 7797 case Panel_320x240_2: (*DisplayType) = 14;
7798 break; 7798 break;
@@ -7802,7 +7802,7 @@ SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
7802 break; 7802 break;
7803 case Panel_1024x600: (*DisplayType) = 26; 7803 case Panel_1024x600: (*DisplayType) = 26;
7804 break; 7804 break;
7805 default: return TRUE; 7805 default: return true;
7806 } 7806 }
7807 7807
7808 if(checkhd) { 7808 if(checkhd) {
@@ -7815,7 +7815,7 @@ SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
7815 7815
7816 } 7816 }
7817 7817
7818 return TRUE; 7818 return true;
7819} 7819}
7820 7820
7821static void 7821static void
@@ -8654,7 +8654,7 @@ SiS_ChrontelDoSomething1(struct SiS_Private *SiS_Pr)
8654/* MAIN: SET CRT2 REGISTER GROUP */ 8654/* MAIN: SET CRT2 REGISTER GROUP */
8655/*********************************************/ 8655/*********************************************/
8656 8656
8657BOOLEAN 8657bool
8658SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 8658SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
8659{ 8659{
8660#ifdef SIS300 8660#ifdef SIS300
@@ -8690,7 +8690,7 @@ SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
8690 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { 8690 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
8691 SiS_LockCRT2(SiS_Pr); 8691 SiS_LockCRT2(SiS_Pr);
8692 SiS_DisplayOn(SiS_Pr); 8692 SiS_DisplayOn(SiS_Pr);
8693 return TRUE; 8693 return true;
8694 } 8694 }
8695 8695
8696 SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8696 SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex);
@@ -8828,7 +8828,7 @@ SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
8828 SiS_LockCRT2(SiS_Pr); 8828 SiS_LockCRT2(SiS_Pr);
8829 } 8829 }
8830 8830
8831 return TRUE; 8831 return true;
8832} 8832}
8833 8833
8834 8834
@@ -8908,7 +8908,7 @@ SiS_SetTrumpBlockLoop(struct SiS_Private *SiS_Pr, unsigned char *dataptr)
8908 return NULL; 8908 return NULL;
8909} 8909}
8910 8910
8911static BOOLEAN 8911static bool
8912SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr) 8912SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr)
8913{ 8913{
8914 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ 8914 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */
@@ -8921,14 +8921,14 @@ SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr)
8921 8921
8922 while(*dataptr) { 8922 while(*dataptr) {
8923 dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr); 8923 dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr);
8924 if(!dataptr) return FALSE; 8924 if(!dataptr) return false;
8925 } 8925 }
8926#ifdef SIS_XORG_XF86 8926#ifdef SIS_XORG_XF86
8927#ifdef TWDEBUG 8927#ifdef TWDEBUG
8928 xf86DrvMsg(0, X_INFO, "Trumpion block success\n"); 8928 xf86DrvMsg(0, X_INFO, "Trumpion block success\n");
8929#endif 8929#endif
8930#endif 8930#endif
8931 return TRUE; 8931 return true;
8932} 8932}
8933#endif 8933#endif
8934 8934
@@ -8939,7 +8939,7 @@ SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr)
8939 * 0x0a, possibly for working around the DDC problems 8939 * 0x0a, possibly for working around the DDC problems
8940 */ 8940 */
8941 8941
8942static BOOLEAN 8942static bool
8943SiS_SetChReg(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val, unsigned short myor) 8943SiS_SetChReg(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val, unsigned short myor)
8944{ 8944{
8945 unsigned short temp, i; 8945 unsigned short temp, i;
@@ -8958,9 +8958,9 @@ SiS_SetChReg(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val,
8958 if(temp) continue; /* (ERROR: no ack) */ 8958 if(temp) continue; /* (ERROR: no ack) */
8959 if(SiS_SetStop(SiS_Pr)) continue; /* Set stop condition */ 8959 if(SiS_SetStop(SiS_Pr)) continue; /* Set stop condition */
8960 SiS_Pr->SiS_ChrontelInit = 1; 8960 SiS_Pr->SiS_ChrontelInit = 1;
8961 return TRUE; 8961 return true;
8962 } 8962 }
8963 return FALSE; 8963 return false;
8964} 8964}
8965 8965
8966/* Write to Chrontel 700x */ 8966/* Write to Chrontel 700x */
@@ -9119,7 +9119,7 @@ static
9119#endif 9119#endif
9120unsigned short 9120unsigned short
9121SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 9121SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine,
9122 unsigned short adaptnum, unsigned short DDCdatatype, BOOLEAN checkcr32, 9122 unsigned short adaptnum, unsigned short DDCdatatype, bool checkcr32,
9123 unsigned int VBFlags2) 9123 unsigned int VBFlags2)
9124{ 9124{
9125 unsigned char ddcdtype[] = { 0xa0, 0xa0, 0xa0, 0xa2, 0xa6 }; 9125 unsigned char ddcdtype[] = { 0xa0, 0xa0, 0xa0, 0xa2, 0xa6 };
@@ -9287,7 +9287,7 @@ SiS_DoProbeDDC(struct SiS_Private *SiS_Pr)
9287{ 9287{
9288 unsigned char mask, value; 9288 unsigned char mask, value;
9289 unsigned short temp, ret=0; 9289 unsigned short temp, ret=0;
9290 BOOLEAN failed = FALSE; 9290 bool failed = false;
9291 9291
9292 SiS_SetSwitchDDC2(SiS_Pr); 9292 SiS_SetSwitchDDC2(SiS_Pr);
9293 if(SiS_PrepareDDC(SiS_Pr)) { 9293 if(SiS_PrepareDDC(SiS_Pr)) {
@@ -9308,7 +9308,7 @@ SiS_DoProbeDDC(struct SiS_Private *SiS_Pr)
9308 mask = 0xff; 9308 mask = 0xff;
9309 value = 0xff; 9309 value = 0xff;
9310 } else { 9310 } else {
9311 failed = TRUE; 9311 failed = true;
9312 ret = 0xFFFF; 9312 ret = 0xFFFF;
9313#ifdef SIS_XORG_XF86 9313#ifdef SIS_XORG_XF86
9314#ifdef TWDEBUG 9314#ifdef TWDEBUG
@@ -9317,7 +9317,7 @@ SiS_DoProbeDDC(struct SiS_Private *SiS_Pr)
9317#endif 9317#endif
9318 } 9318 }
9319 } 9319 }
9320 if(failed == FALSE) { 9320 if(!failed) {
9321 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); 9321 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr);
9322 SiS_SendACK(SiS_Pr, 1); 9322 SiS_SendACK(SiS_Pr, 1);
9323 temp &= mask; 9323 temp &= mask;
@@ -9431,7 +9431,7 @@ SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine,
9431 if((!(VBFlags2 & VB2_VIDEOBRIDGE)) && (adaptnum > 0)) 9431 if((!(VBFlags2 & VB2_VIDEOBRIDGE)) && (adaptnum > 0))
9432 return 0xFFFF; 9432 return 0xFFFF;
9433 9433
9434 if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, FALSE, VBFlags2) == 0xFFFF) 9434 if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, false, VBFlags2) == 0xFFFF)
9435 return 0xFFFF; 9435 return 0xFFFF;
9436 9436
9437 sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f); 9437 sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f);
@@ -9829,7 +9829,7 @@ SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
9829{ 9829{
9830 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 9830 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
9831 unsigned short delay=0,index,myindex,temp,romptr=0; 9831 unsigned short delay=0,index,myindex,temp,romptr=0;
9832 BOOLEAN dochiptest = TRUE; 9832 bool dochiptest = true;
9833 9833
9834 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 9834 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
9835 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf); 9835 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf);
@@ -9864,7 +9864,7 @@ SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
9864 9864
9865 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) { /* ---------- LCD/LCDA */ 9865 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) { /* ---------- LCD/LCDA */
9866 9866
9867 BOOLEAN gotitfrompci = FALSE; 9867 bool gotitfrompci = false;
9868 9868
9869 /* Could we detect a PDC for LCD or did we get a user-defined? If yes, use it */ 9869 /* Could we detect a PDC for LCD or did we get a user-defined? If yes, use it */
9870 9870
@@ -9916,22 +9916,22 @@ SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
9916 case CUT_COMPAQ1280: 9916 case CUT_COMPAQ1280:
9917 case CUT_COMPAQ12802: 9917 case CUT_COMPAQ12802:
9918 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { 9918 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
9919 gotitfrompci = TRUE; 9919 gotitfrompci = true;
9920 dochiptest = FALSE; 9920 dochiptest = false;
9921 delay = 0x03; 9921 delay = 0x03;
9922 } 9922 }
9923 break; 9923 break;
9924 case CUT_CLEVO1400: 9924 case CUT_CLEVO1400:
9925 case CUT_CLEVO14002: 9925 case CUT_CLEVO14002:
9926 gotitfrompci = TRUE; 9926 gotitfrompci = true;
9927 dochiptest = FALSE; 9927 dochiptest = false;
9928 delay = 0x02; 9928 delay = 0x02;
9929 break; 9929 break;
9930 case CUT_CLEVO1024: 9930 case CUT_CLEVO1024:
9931 case CUT_CLEVO10242: 9931 case CUT_CLEVO10242:
9932 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { 9932 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
9933 gotitfrompci = TRUE; 9933 gotitfrompci = true;
9934 dochiptest = FALSE; 9934 dochiptest = false;
9935 delay = 0x33; 9935 delay = 0x33;
9936 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); 9936 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay);
9937 delay &= 0x0f; 9937 delay &= 0x0f;
@@ -10009,7 +10009,7 @@ SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
10009 10009
10010 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 10010 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
10011 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0)); 10011 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0));
10012 dochiptest = FALSE; 10012 dochiptest = false;
10013 } 10013 }
10014 10014
10015 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* ------------ TV */ 10015 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* ------------ TV */
@@ -10043,12 +10043,12 @@ SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
10043 case CUT_CLEVO1400: 10043 case CUT_CLEVO1400:
10044 case CUT_CLEVO14002: 10044 case CUT_CLEVO14002:
10045 delay = 0x02; 10045 delay = 0x02;
10046 dochiptest = FALSE; 10046 dochiptest = false;
10047 break; 10047 break;
10048 case CUT_CLEVO1024: 10048 case CUT_CLEVO1024:
10049 case CUT_CLEVO10242: 10049 case CUT_CLEVO10242:
10050 delay = 0x03; 10050 delay = 0x03;
10051 dochiptest = FALSE; 10051 dochiptest = false;
10052 break; 10052 break;
10053 default: 10053 default:
10054 delay = SiS310_TVDelayCompensation_651301LV[index]; 10054 delay = SiS310_TVDelayCompensation_651301LV[index];
@@ -10085,7 +10085,7 @@ SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo)
10085 10085
10086 if(SiS_LCDAEnabled(SiS_Pr)) { 10086 if(SiS_LCDAEnabled(SiS_Pr)) {
10087 delay &= 0x0f; 10087 delay &= 0x0f;
10088 dochiptest = FALSE; 10088 dochiptest = false;
10089 } 10089 }
10090 10090
10091 } else return; 10091 } else return;
@@ -10728,7 +10728,7 @@ SiS_FinalizeLCD(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned shor
10728 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); 10728 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00);
10729 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); 10729 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b);
10730 } 10730 }
10731 if((SiS_Pr->Backup == TRUE) && (SiS_Pr->Backup_Mode == ModeNo)) { 10731 if(SiS_Pr->Backup && (SiS_Pr->Backup_Mode == ModeNo)) {
10732 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14); 10732 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14);
10733 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15); 10733 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15);
10734 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16); 10734 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16);
diff --git a/drivers/video/sis/init301.h b/drivers/video/sis/init301.h
index 4f3a28699d37..7708e1e1d99e 100644
--- a/drivers/video/sis/init301.h
+++ b/drivers/video/sis/init301.h
@@ -363,8 +363,8 @@ void SiS_LockCRT2(struct SiS_Private *SiS_Pr);
363void SiS_EnableCRT2(struct SiS_Private *SiS_Pr); 363void SiS_EnableCRT2(struct SiS_Private *SiS_Pr);
364unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 364unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
365void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); 365void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr);
366BOOLEAN SiS_IsDualEdge(struct SiS_Private *SiS_Pr); 366bool SiS_IsDualEdge(struct SiS_Private *SiS_Pr);
367BOOLEAN SiS_IsVAMode(struct SiS_Private *SiS_Pr); 367bool SiS_IsVAMode(struct SiS_Private *SiS_Pr);
368void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 368void SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
369 unsigned short ModeIdIndex, int checkcrt2mode); 369 unsigned short ModeIdIndex, int checkcrt2mode);
370void SiS_SetYPbPr(struct SiS_Private *SiS_Pr); 370void SiS_SetYPbPr(struct SiS_Private *SiS_Pr);
@@ -379,7 +379,7 @@ void SiS_DisableBridge(struct SiS_Private *SiS_Pr);
379#ifndef SIS_LINUX_KERNEL 379#ifndef SIS_LINUX_KERNEL
380void SiS_EnableBridge(struct SiS_Private *SiS_Pr); 380void SiS_EnableBridge(struct SiS_Private *SiS_Pr);
381#endif 381#endif
382BOOLEAN SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 382bool SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
383void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr); 383void SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr);
384void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr); 384void SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr);
385 385
@@ -403,7 +403,7 @@ void SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr);
403#endif /* 315 */ 403#endif /* 315 */
404 404
405#ifdef SIS300 405#ifdef SIS300
406static BOOLEAN SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr); 406static bool SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr);
407void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo); 407void SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo);
408#endif 408#endif
409 409
@@ -416,14 +416,14 @@ unsigned short SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, i
416#ifdef SIS_XORG_XF86 416#ifdef SIS_XORG_XF86
417unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 417unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags,
418 int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 418 int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype,
419 BOOLEAN checkcr32, unsigned int VBFlags2); 419 bool checkcr32, unsigned int VBFlags2);
420unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 420unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr);
421unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 421unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype,
422 unsigned char *buffer); 422 unsigned char *buffer);
423#else 423#else
424static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 424static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags,
425 int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 425 int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype,
426 BOOLEAN checkcr32, unsigned int VBFlags2); 426 bool checkcr32, unsigned int VBFlags2);
427static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 427static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr);
428static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 428static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype,
429 unsigned char *buffer); 429 unsigned char *buffer);
@@ -469,7 +469,7 @@ extern void SiS_SetRegOR(SISIOADDRESS, unsigned short, unsigned short);
469extern void SiS_SetRegAND(SISIOADDRESS, unsigned short, unsigned short); 469extern void SiS_SetRegAND(SISIOADDRESS, unsigned short, unsigned short);
470extern void SiS_DisplayOff(struct SiS_Private *SiS_Pr); 470extern void SiS_DisplayOff(struct SiS_Private *SiS_Pr);
471extern void SiS_DisplayOn(struct SiS_Private *SiS_Pr); 471extern void SiS_DisplayOn(struct SiS_Private *SiS_Pr);
472extern BOOLEAN SiS_SearchModeID(struct SiS_Private *, unsigned short *, unsigned short *); 472extern bool SiS_SearchModeID(struct SiS_Private *, unsigned short *, unsigned short *);
473extern unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 473extern unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
474 unsigned short ModeIdIndex); 474 unsigned short ModeIdIndex);
475extern unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 475extern unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex);
diff --git a/drivers/video/sis/initextlfb.c b/drivers/video/sis/initextlfb.c
index c3884a29f4c5..47a33501549d 100644
--- a/drivers/video/sis/initextlfb.c
+++ b/drivers/video/sis/initextlfb.c
@@ -38,14 +38,14 @@ int sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr,
38 unsigned char modeno, unsigned char rateindex); 38 unsigned char modeno, unsigned char rateindex);
39int sisfb_mode_rate_to_ddata(struct SiS_Private *SiS_Pr, unsigned char modeno, 39int sisfb_mode_rate_to_ddata(struct SiS_Private *SiS_Pr, unsigned char modeno,
40 unsigned char rateindex, struct fb_var_screeninfo *var); 40 unsigned char rateindex, struct fb_var_screeninfo *var);
41BOOLEAN sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, 41bool sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno,
42 int *htotal, int *vtotal, unsigned char rateindex); 42 int *htotal, int *vtotal, unsigned char rateindex);
43 43
44extern BOOLEAN SiSInitPtr(struct SiS_Private *SiS_Pr); 44extern bool SiSInitPtr(struct SiS_Private *SiS_Pr);
45extern BOOLEAN SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, 45extern bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo,
46 unsigned short *ModeIdIndex); 46 unsigned short *ModeIdIndex);
47extern void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, 47extern void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
48 int xres, int yres, struct fb_var_screeninfo *var, BOOLEAN writeres); 48 int xres, int yres, struct fb_var_screeninfo *var, bool writeres);
49 49
50int 50int
51sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr, unsigned char modeno, 51sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr, unsigned char modeno,
@@ -131,7 +131,7 @@ sisfb_mode_rate_to_ddata(struct SiS_Private *SiS_Pr, unsigned char modeno,
131 (unsigned char *)&SiS_Pr->SiS_CRT1Table[index].CR[0], 131 (unsigned char *)&SiS_Pr->SiS_CRT1Table[index].CR[0],
132 SiS_Pr->SiS_RefIndex[RRTI].XRes, 132 SiS_Pr->SiS_RefIndex[RRTI].XRes,
133 SiS_Pr->SiS_RefIndex[RRTI].YRes, 133 SiS_Pr->SiS_RefIndex[RRTI].YRes,
134 var, FALSE); 134 var, false);
135 135
136 if(SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag & 0x8000) 136 if(SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag & 0x8000)
137 var->sync &= ~FB_SYNC_VERT_HIGH_ACT; 137 var->sync &= ~FB_SYNC_VERT_HIGH_ACT;
@@ -175,7 +175,7 @@ sisfb_mode_rate_to_ddata(struct SiS_Private *SiS_Pr, unsigned char modeno,
175 return 1; 175 return 1;
176} 176}
177 177
178BOOLEAN 178bool
179sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, int *htotal, 179sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, int *htotal,
180 int *vtotal, unsigned char rateindex) 180 int *vtotal, unsigned char rateindex)
181{ 181{
@@ -184,7 +184,7 @@ sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, int *ht
184 unsigned short RRTI = 0; 184 unsigned short RRTI = 0;
185 unsigned char sr_data, cr_data, cr_data2; 185 unsigned char sr_data, cr_data, cr_data2;
186 186
187 if(!SiSInitPtr(SiS_Pr)) return FALSE; 187 if(!SiSInitPtr(SiS_Pr)) return false;
188 188
189 if(rateindex > 0) rateindex--; 189 if(rateindex > 0) rateindex--;
190 190
@@ -195,7 +195,7 @@ sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, int *ht
195 } 195 }
196#endif 196#endif
197 197
198 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE; 198 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false;
199 199
200 RRTI = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; 200 RRTI = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;
201 if(SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag & HaveWideTiming) { 201 if(SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag & HaveWideTiming) {
@@ -226,7 +226,7 @@ sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, int *ht
226 if(SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag & InterlaceMode) 226 if(SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag & InterlaceMode)
227 *vtotal *= 2; 227 *vtotal *= 2;
228 228
229 return TRUE; 229 return true;
230} 230}
231 231
232 232
diff --git a/drivers/video/sis/sis.h b/drivers/video/sis/sis.h
index a259446ca7fe..7d5ee2145e21 100644
--- a/drivers/video/sis/sis.h
+++ b/drivers/video/sis/sis.h
@@ -526,7 +526,7 @@ struct sis_video_info {
526 u16 vmax; 526 u16 vmax;
527 u32 dclockmax; 527 u32 dclockmax;
528 u8 feature; 528 u8 feature;
529 BOOLEAN datavalid; 529 bool datavalid;
530 } sisfb_thismonitor; 530 } sisfb_thismonitor;
531 531
532 unsigned short chip_id; /* PCI ID of chip */ 532 unsigned short chip_id; /* PCI ID of chip */
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index baaf495a0a6d..01197d740217 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -110,7 +110,7 @@ sisfb_setdefaultparms(void)
110/* ------------- Parameter parsing -------------- */ 110/* ------------- Parameter parsing -------------- */
111 111
112static void __devinit 112static void __devinit
113sisfb_search_vesamode(unsigned int vesamode, BOOLEAN quiet) 113sisfb_search_vesamode(unsigned int vesamode, bool quiet)
114{ 114{
115 int i = 0, j = 0; 115 int i = 0, j = 0;
116 116
@@ -150,7 +150,7 @@ sisfb_search_vesamode(unsigned int vesamode, BOOLEAN quiet)
150} 150}
151 151
152static void __devinit 152static void __devinit
153sisfb_search_mode(char *name, BOOLEAN quiet) 153sisfb_search_mode(char *name, bool quiet)
154{ 154{
155 unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0; 155 unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
156 int i = 0; 156 int i = 0;
@@ -251,7 +251,7 @@ sisfb_get_vga_mode_from_kernel(void)
251 "sisfb: Using vga mode %s pre-set by kernel as default\n", 251 "sisfb: Using vga mode %s pre-set by kernel as default\n",
252 mymode); 252 mymode);
253 253
254 sisfb_search_mode(mymode, TRUE); 254 sisfb_search_mode(mymode, true);
255 } 255 }
256#endif 256#endif
257 return; 257 return;
@@ -307,7 +307,7 @@ static void __init
307sisfb_search_specialtiming(const char *name) 307sisfb_search_specialtiming(const char *name)
308{ 308{
309 int i = 0; 309 int i = 0;
310 BOOLEAN found = FALSE; 310 bool found = false;
311 311
312 /* We don't know the hardware specs yet and there is no ivideo */ 312 /* We don't know the hardware specs yet and there is no ivideo */
313 313
@@ -322,7 +322,7 @@ sisfb_search_specialtiming(const char *name)
322 if(!strnicmp(name,mycustomttable[i].optionName, 322 if(!strnicmp(name,mycustomttable[i].optionName,
323 strlen(mycustomttable[i].optionName))) { 323 strlen(mycustomttable[i].optionName))) {
324 sisfb_specialtiming = mycustomttable[i].SpecialID; 324 sisfb_specialtiming = mycustomttable[i].SpecialID;
325 found = TRUE; 325 found = true;
326 printk(KERN_INFO "sisfb: Special timing for %s %s forced (\"%s\")\n", 326 printk(KERN_INFO "sisfb: Special timing for %s %s forced (\"%s\")\n",
327 mycustomttable[i].vendorName, 327 mycustomttable[i].vendorName,
328 mycustomttable[i].cardName, 328 mycustomttable[i].cardName,
@@ -353,7 +353,7 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
353{ 353{
354 unsigned char *biosver = NULL; 354 unsigned char *biosver = NULL;
355 unsigned char *biosdate = NULL; 355 unsigned char *biosdate = NULL;
356 BOOLEAN footprint; 356 bool footprint;
357 u32 chksum = 0; 357 u32 chksum = 0;
358 int i, j; 358 int i, j;
359 359
@@ -380,16 +380,16 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
380 (mycustomttable[i].bioschksum == chksum))) && 380 (mycustomttable[i].bioschksum == chksum))) &&
381 (mycustomttable[i].pcisubsysvendor == ivideo->subsysvendor) && 381 (mycustomttable[i].pcisubsysvendor == ivideo->subsysvendor) &&
382 (mycustomttable[i].pcisubsyscard == ivideo->subsysdevice) ) { 382 (mycustomttable[i].pcisubsyscard == ivideo->subsysdevice) ) {
383 footprint = TRUE; 383 footprint = true;
384 for(j = 0; j < 5; j++) { 384 for(j = 0; j < 5; j++) {
385 if(mycustomttable[i].biosFootprintAddr[j]) { 385 if(mycustomttable[i].biosFootprintAddr[j]) {
386 if(ivideo->SiS_Pr.UseROM) { 386 if(ivideo->SiS_Pr.UseROM) {
387 if(ivideo->SiS_Pr.VirtualRomBase[mycustomttable[i].biosFootprintAddr[j]] != 387 if(ivideo->SiS_Pr.VirtualRomBase[mycustomttable[i].biosFootprintAddr[j]] !=
388 mycustomttable[i].biosFootprintData[j]) { 388 mycustomttable[i].biosFootprintData[j]) {
389 footprint = FALSE; 389 footprint = false;
390 } 390 }
391 } else 391 } else
392 footprint = FALSE; 392 footprint = false;
393 } 393 }
394 } 394 }
395 if(footprint) { 395 if(footprint) {
@@ -406,7 +406,7 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
406 } while(mycustomttable[i].chipID); 406 } while(mycustomttable[i].chipID);
407} 407}
408 408
409static BOOLEAN __devinit 409static bool __devinit
410sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer) 410sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
411{ 411{
412 int i, j, xres, yres, refresh, index; 412 int i, j, xres, yres, refresh, index;
@@ -417,13 +417,13 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
417 buffer[4] != 0xff || buffer[5] != 0xff || 417 buffer[4] != 0xff || buffer[5] != 0xff ||
418 buffer[6] != 0xff || buffer[7] != 0x00) { 418 buffer[6] != 0xff || buffer[7] != 0x00) {
419 printk(KERN_DEBUG "sisfb: Bad EDID header\n"); 419 printk(KERN_DEBUG "sisfb: Bad EDID header\n");
420 return FALSE; 420 return false;
421 } 421 }
422 422
423 if(buffer[0x12] != 0x01) { 423 if(buffer[0x12] != 0x01) {
424 printk(KERN_INFO "sisfb: EDID version %d not supported\n", 424 printk(KERN_INFO "sisfb: EDID version %d not supported\n",
425 buffer[0x12]); 425 buffer[0x12]);
426 return FALSE; 426 return false;
427 } 427 }
428 428
429 monitor->feature = buffer[0x18]; 429 monitor->feature = buffer[0x18];
@@ -449,7 +449,7 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
449 monitor->vmin = buffer[j + 5]; 449 monitor->vmin = buffer[j + 5];
450 monitor->vmax = buffer[j + 6]; 450 monitor->vmax = buffer[j + 6];
451 monitor->dclockmax = buffer[j + 9] * 10 * 1000; 451 monitor->dclockmax = buffer[j + 9] * 10 * 1000;
452 monitor->datavalid = TRUE; 452 monitor->datavalid = true;
453 break; 453 break;
454 } 454 }
455 j += 18; 455 j += 18;
@@ -501,7 +501,7 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
501 index += 2; 501 index += 2;
502 } 502 }
503 if((monitor->hmin <= monitor->hmax) && (monitor->vmin <= monitor->vmax)) { 503 if((monitor->hmin <= monitor->hmax) && (monitor->vmin <= monitor->vmax)) {
504 monitor->datavalid = TRUE; 504 monitor->datavalid = true;
505 } 505 }
506 } 506 }
507 507
@@ -514,7 +514,7 @@ sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, i
514 unsigned short temp, i, realcrtno = crtno; 514 unsigned short temp, i, realcrtno = crtno;
515 unsigned char buffer[256]; 515 unsigned char buffer[256];
516 516
517 monitor->datavalid = FALSE; 517 monitor->datavalid = false;
518 518
519 if(crtno) { 519 if(crtno) {
520 if(ivideo->vbflags & CRT2_LCD) realcrtno = 1; 520 if(ivideo->vbflags & CRT2_LCD) realcrtno = 1;
@@ -563,7 +563,7 @@ sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, i
563 563
564/* -------------- Mode validation --------------- */ 564/* -------------- Mode validation --------------- */
565 565
566static BOOLEAN 566static bool
567sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, 567sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor,
568 int mode_idx, int rate_idx, int rate) 568 int mode_idx, int rate_idx, int rate)
569{ 569{
@@ -571,10 +571,10 @@ sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor,
571 unsigned int dclock, hsync; 571 unsigned int dclock, hsync;
572 572
573 if(!monitor->datavalid) 573 if(!monitor->datavalid)
574 return TRUE; 574 return true;
575 575
576 if(mode_idx < 0) 576 if(mode_idx < 0)
577 return FALSE; 577 return false;
578 578
579 /* Skip for 320x200, 320x240, 640x400 */ 579 /* Skip for 320x200, 320x240, 640x400 */
580 switch(sisbios_mode[mode_idx].mode_no[ivideo->mni]) { 580 switch(sisbios_mode[mode_idx].mode_no[ivideo->mni]) {
@@ -587,34 +587,34 @@ sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor,
587 case 0x2f: 587 case 0x2f:
588 case 0x5d: 588 case 0x5d:
589 case 0x5e: 589 case 0x5e:
590 return TRUE; 590 return true;
591#ifdef CONFIG_FB_SIS_315 591#ifdef CONFIG_FB_SIS_315
592 case 0x5a: 592 case 0x5a:
593 case 0x5b: 593 case 0x5b:
594 if(ivideo->sisvga_engine == SIS_315_VGA) return TRUE; 594 if(ivideo->sisvga_engine == SIS_315_VGA) return true;
595#endif 595#endif
596 } 596 }
597 597
598 if(rate < (monitor->vmin - 1)) 598 if(rate < (monitor->vmin - 1))
599 return FALSE; 599 return false;
600 if(rate > (monitor->vmax + 1)) 600 if(rate > (monitor->vmax + 1))
601 return FALSE; 601 return false;
602 602
603 if(sisfb_gettotalfrommode(&ivideo->SiS_Pr, 603 if(sisfb_gettotalfrommode(&ivideo->SiS_Pr,
604 sisbios_mode[mode_idx].mode_no[ivideo->mni], 604 sisbios_mode[mode_idx].mode_no[ivideo->mni],
605 &htotal, &vtotal, rate_idx)) { 605 &htotal, &vtotal, rate_idx)) {
606 dclock = (htotal * vtotal * rate) / 1000; 606 dclock = (htotal * vtotal * rate) / 1000;
607 if(dclock > (monitor->dclockmax + 1000)) 607 if(dclock > (monitor->dclockmax + 1000))
608 return FALSE; 608 return false;
609 hsync = dclock / htotal; 609 hsync = dclock / htotal;
610 if(hsync < (monitor->hmin - 1)) 610 if(hsync < (monitor->hmin - 1))
611 return FALSE; 611 return false;
612 if(hsync > (monitor->hmax + 1)) 612 if(hsync > (monitor->hmax + 1))
613 return FALSE; 613 return false;
614 } else { 614 } else {
615 return FALSE; 615 return false;
616 } 616 }
617 return TRUE; 617 return true;
618} 618}
619 619
620static int 620static int
@@ -732,49 +732,49 @@ sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, int
732 } 732 }
733} 733}
734 734
735static BOOLEAN 735static bool
736sisfb_bridgeisslave(struct sis_video_info *ivideo) 736sisfb_bridgeisslave(struct sis_video_info *ivideo)
737{ 737{
738 unsigned char P1_00; 738 unsigned char P1_00;
739 739
740 if(!(ivideo->vbflags2 & VB2_VIDEOBRIDGE)) 740 if(!(ivideo->vbflags2 & VB2_VIDEOBRIDGE))
741 return FALSE; 741 return false;
742 742
743 inSISIDXREG(SISPART1,0x00,P1_00); 743 inSISIDXREG(SISPART1,0x00,P1_00);
744 if( ((ivideo->sisvga_engine == SIS_300_VGA) && (P1_00 & 0xa0) == 0x20) || 744 if( ((ivideo->sisvga_engine == SIS_300_VGA) && (P1_00 & 0xa0) == 0x20) ||
745 ((ivideo->sisvga_engine == SIS_315_VGA) && (P1_00 & 0x50) == 0x10) ) { 745 ((ivideo->sisvga_engine == SIS_315_VGA) && (P1_00 & 0x50) == 0x10) ) {
746 return TRUE; 746 return true;
747 } else { 747 } else {
748 return FALSE; 748 return false;
749 } 749 }
750} 750}
751 751
752static BOOLEAN 752static bool
753sisfballowretracecrt1(struct sis_video_info *ivideo) 753sisfballowretracecrt1(struct sis_video_info *ivideo)
754{ 754{
755 u8 temp; 755 u8 temp;
756 756
757 inSISIDXREG(SISCR,0x17,temp); 757 inSISIDXREG(SISCR,0x17,temp);
758 if(!(temp & 0x80)) 758 if(!(temp & 0x80))
759 return FALSE; 759 return false;
760 760
761 inSISIDXREG(SISSR,0x1f,temp); 761 inSISIDXREG(SISSR,0x1f,temp);
762 if(temp & 0xc0) 762 if(temp & 0xc0)
763 return FALSE; 763 return false;
764 764
765 return TRUE; 765 return true;
766} 766}
767 767
768static BOOLEAN 768static bool
769sisfbcheckvretracecrt1(struct sis_video_info *ivideo) 769sisfbcheckvretracecrt1(struct sis_video_info *ivideo)
770{ 770{
771 if(!sisfballowretracecrt1(ivideo)) 771 if(!sisfballowretracecrt1(ivideo))
772 return FALSE; 772 return false;
773 773
774 if(inSISREG(SISINPSTAT) & 0x08) 774 if(inSISREG(SISINPSTAT) & 0x08)
775 return TRUE; 775 return true;
776 else 776 else
777 return FALSE; 777 return false;
778} 778}
779 779
780static void 780static void
@@ -791,7 +791,7 @@ sisfbwaitretracecrt1(struct sis_video_info *ivideo)
791 while((inSISREG(SISINPSTAT) & 0x08) && --watchdog); 791 while((inSISREG(SISINPSTAT) & 0x08) && --watchdog);
792} 792}
793 793
794static BOOLEAN 794static bool
795sisfbcheckvretracecrt2(struct sis_video_info *ivideo) 795sisfbcheckvretracecrt2(struct sis_video_info *ivideo)
796{ 796{
797 unsigned char temp, reg; 797 unsigned char temp, reg;
@@ -799,17 +799,17 @@ sisfbcheckvretracecrt2(struct sis_video_info *ivideo)
799 switch(ivideo->sisvga_engine) { 799 switch(ivideo->sisvga_engine) {
800 case SIS_300_VGA: reg = 0x25; break; 800 case SIS_300_VGA: reg = 0x25; break;
801 case SIS_315_VGA: reg = 0x30; break; 801 case SIS_315_VGA: reg = 0x30; break;
802 default: return FALSE; 802 default: return false;
803 } 803 }
804 804
805 inSISIDXREG(SISPART1, reg, temp); 805 inSISIDXREG(SISPART1, reg, temp);
806 if(temp & 0x02) 806 if(temp & 0x02)
807 return TRUE; 807 return true;
808 else 808 else
809 return FALSE; 809 return false;
810} 810}
811 811
812static BOOLEAN 812static bool
813sisfb_CheckVBRetrace(struct sis_video_info *ivideo) 813sisfb_CheckVBRetrace(struct sis_video_info *ivideo)
814{ 814{
815 if(ivideo->currentvbflags & VB_DISPTYPE_DISP2) { 815 if(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
@@ -874,7 +874,7 @@ static int
874sisfb_myblank(struct sis_video_info *ivideo, int blank) 874sisfb_myblank(struct sis_video_info *ivideo, int blank)
875{ 875{
876 u8 sr01, sr11, sr1f, cr63=0, p2_0, p1_13; 876 u8 sr01, sr11, sr1f, cr63=0, p2_0, p1_13;
877 BOOLEAN backlight = TRUE; 877 bool backlight = true;
878 878
879 switch(blank) { 879 switch(blank) {
880 case FB_BLANK_UNBLANK: /* on */ 880 case FB_BLANK_UNBLANK: /* on */
@@ -884,7 +884,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
884 cr63 = 0x00; 884 cr63 = 0x00;
885 p2_0 = 0x20; 885 p2_0 = 0x20;
886 p1_13 = 0x00; 886 p1_13 = 0x00;
887 backlight = TRUE; 887 backlight = true;
888 break; 888 break;
889 case FB_BLANK_NORMAL: /* blank */ 889 case FB_BLANK_NORMAL: /* blank */
890 sr01 = 0x20; 890 sr01 = 0x20;
@@ -893,7 +893,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
893 cr63 = 0x00; 893 cr63 = 0x00;
894 p2_0 = 0x20; 894 p2_0 = 0x20;
895 p1_13 = 0x00; 895 p1_13 = 0x00;
896 backlight = TRUE; 896 backlight = true;
897 break; 897 break;
898 case FB_BLANK_VSYNC_SUSPEND: /* no vsync */ 898 case FB_BLANK_VSYNC_SUSPEND: /* no vsync */
899 sr01 = 0x20; 899 sr01 = 0x20;
@@ -902,7 +902,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
902 cr63 = 0x40; 902 cr63 = 0x40;
903 p2_0 = 0x40; 903 p2_0 = 0x40;
904 p1_13 = 0x80; 904 p1_13 = 0x80;
905 backlight = FALSE; 905 backlight = false;
906 break; 906 break;
907 case FB_BLANK_HSYNC_SUSPEND: /* no hsync */ 907 case FB_BLANK_HSYNC_SUSPEND: /* no hsync */
908 sr01 = 0x20; 908 sr01 = 0x20;
@@ -911,7 +911,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
911 cr63 = 0x40; 911 cr63 = 0x40;
912 p2_0 = 0x80; 912 p2_0 = 0x80;
913 p1_13 = 0x40; 913 p1_13 = 0x40;
914 backlight = FALSE; 914 backlight = false;
915 break; 915 break;
916 case FB_BLANK_POWERDOWN: /* off */ 916 case FB_BLANK_POWERDOWN: /* off */
917 sr01 = 0x20; 917 sr01 = 0x20;
@@ -920,7 +920,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
920 cr63 = 0x40; 920 cr63 = 0x40;
921 p2_0 = 0xc0; 921 p2_0 = 0xc0;
922 p1_13 = 0xc0; 922 p1_13 = 0xc0;
923 backlight = FALSE; 923 backlight = false;
924 break; 924 break;
925 default: 925 default:
926 return 1; 926 return 1;
@@ -1109,11 +1109,11 @@ sisfb_calc_pitch(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
1109static void 1109static void
1110sisfb_set_pitch(struct sis_video_info *ivideo) 1110sisfb_set_pitch(struct sis_video_info *ivideo)
1111{ 1111{
1112 BOOLEAN isslavemode = FALSE; 1112 bool isslavemode = false;
1113 unsigned short HDisplay1 = ivideo->scrnpitchCRT1 >> 3; 1113 unsigned short HDisplay1 = ivideo->scrnpitchCRT1 >> 3;
1114 unsigned short HDisplay2 = ivideo->video_linelength >> 3; 1114 unsigned short HDisplay2 = ivideo->video_linelength >> 3;
1115 1115
1116 if(sisfb_bridgeisslave(ivideo)) isslavemode = TRUE; 1116 if(sisfb_bridgeisslave(ivideo)) isslavemode = true;
1117 1117
1118 /* We need to set pitch for CRT1 if bridge is in slave mode, too */ 1118 /* We need to set pitch for CRT1 if bridge is in slave mode, too */
1119 if((ivideo->currentvbflags & VB_DISPTYPE_DISP1) || (isslavemode)) { 1119 if((ivideo->currentvbflags & VB_DISPTYPE_DISP1) || (isslavemode)) {
@@ -1178,7 +1178,7 @@ sisfb_set_mode(struct sis_video_info *ivideo, int clrscrn)
1178 1178
1179 sisfb_pre_setmode(ivideo); 1179 sisfb_pre_setmode(ivideo);
1180 1180
1181 if(SiSSetMode(&ivideo->SiS_Pr, modeno) == 0) { 1181 if(!SiSSetMode(&ivideo->SiS_Pr, modeno)) {
1182 printk(KERN_ERR "sisfb: Setting mode[0x%x] failed\n", ivideo->mode_no); 1182 printk(KERN_ERR "sisfb: Setting mode[0x%x] failed\n", ivideo->mode_no);
1183 return -EINVAL; 1183 return -EINVAL;
1184 } 1184 }
@@ -1446,7 +1446,7 @@ sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
1446 unsigned int drate = 0, hrate = 0, maxyres; 1446 unsigned int drate = 0, hrate = 0, maxyres;
1447 int found_mode = 0; 1447 int found_mode = 0;
1448 int refresh_rate, search_idx, tidx; 1448 int refresh_rate, search_idx, tidx;
1449 BOOLEAN recalc_clock = FALSE; 1449 bool recalc_clock = false;
1450 u32 pixclock; 1450 u32 pixclock;
1451 1451
1452 htotal = var->left_margin + var->xres + var->right_margin + var->hsync_len; 1452 htotal = var->left_margin + var->xres + var->right_margin + var->hsync_len;
@@ -1524,7 +1524,7 @@ sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
1524 (var->bits_per_pixel == 8) ) { 1524 (var->bits_per_pixel == 8) ) {
1525 /* Slave modes on LVDS and 301B-DH */ 1525 /* Slave modes on LVDS and 301B-DH */
1526 refresh_rate = 60; 1526 refresh_rate = 60;
1527 recalc_clock = TRUE; 1527 recalc_clock = true;
1528 } else if( (ivideo->current_htotal == htotal) && 1528 } else if( (ivideo->current_htotal == htotal) &&
1529 (ivideo->current_vtotal == vtotal) && 1529 (ivideo->current_vtotal == vtotal) &&
1530 (ivideo->current_pixclock == pixclock) ) { 1530 (ivideo->current_pixclock == pixclock) ) {
@@ -1545,17 +1545,17 @@ sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
1545 } else { 1545 } else {
1546 refresh_rate = 60; 1546 refresh_rate = 60;
1547 } 1547 }
1548 recalc_clock = TRUE; 1548 recalc_clock = true;
1549 } else if((pixclock) && (htotal) && (vtotal)) { 1549 } else if((pixclock) && (htotal) && (vtotal)) {
1550 drate = 1000000000 / pixclock; 1550 drate = 1000000000 / pixclock;
1551 hrate = (drate * 1000) / htotal; 1551 hrate = (drate * 1000) / htotal;
1552 refresh_rate = (unsigned int) (hrate * 2 / vtotal); 1552 refresh_rate = (unsigned int) (hrate * 2 / vtotal);
1553 } else if(ivideo->current_refresh_rate) { 1553 } else if(ivideo->current_refresh_rate) {
1554 refresh_rate = ivideo->current_refresh_rate; 1554 refresh_rate = ivideo->current_refresh_rate;
1555 recalc_clock = TRUE; 1555 recalc_clock = true;
1556 } else { 1556 } else {
1557 refresh_rate = 60; 1557 refresh_rate = 60;
1558 recalc_clock = TRUE; 1558 recalc_clock = true;
1559 } 1559 }
1560 1560
1561 myrateindex = sisfb_search_refresh_rate(ivideo, refresh_rate, search_idx); 1561 myrateindex = sisfb_search_refresh_rate(ivideo, refresh_rate, search_idx);
@@ -2181,7 +2181,7 @@ sisfb_detect_VB_connect(struct sis_video_info *ivideo)
2181 2181
2182/* ------------------ Sensing routines ------------------ */ 2182/* ------------------ Sensing routines ------------------ */
2183 2183
2184static BOOLEAN __devinit 2184static bool __devinit
2185sisfb_test_DDC1(struct sis_video_info *ivideo) 2185sisfb_test_DDC1(struct sis_video_info *ivideo)
2186{ 2186{
2187 unsigned short old; 2187 unsigned short old;
@@ -2191,13 +2191,13 @@ sisfb_test_DDC1(struct sis_video_info *ivideo)
2191 do { 2191 do {
2192 if(old != SiS_ReadDDC1Bit(&ivideo->SiS_Pr)) break; 2192 if(old != SiS_ReadDDC1Bit(&ivideo->SiS_Pr)) break;
2193 } while(count--); 2193 } while(count--);
2194 return (count == -1) ? FALSE : TRUE; 2194 return (count != -1);
2195} 2195}
2196 2196
2197static void __devinit 2197static void __devinit
2198sisfb_sense_crt1(struct sis_video_info *ivideo) 2198sisfb_sense_crt1(struct sis_video_info *ivideo)
2199{ 2199{
2200 BOOLEAN mustwait = FALSE; 2200 bool mustwait = false;
2201 u8 sr1F, cr17; 2201 u8 sr1F, cr17;
2202#ifdef CONFIG_FB_SIS_315 2202#ifdef CONFIG_FB_SIS_315
2203 u8 cr63=0; 2203 u8 cr63=0;
@@ -2208,7 +2208,7 @@ sisfb_sense_crt1(struct sis_video_info *ivideo)
2208 inSISIDXREG(SISSR,0x1F,sr1F); 2208 inSISIDXREG(SISSR,0x1F,sr1F);
2209 orSISIDXREG(SISSR,0x1F,0x04); 2209 orSISIDXREG(SISSR,0x1F,0x04);
2210 andSISIDXREG(SISSR,0x1F,0x3F); 2210 andSISIDXREG(SISSR,0x1F,0x3F);
2211 if(sr1F & 0xc0) mustwait = TRUE; 2211 if(sr1F & 0xc0) mustwait = true;
2212 2212
2213#ifdef CONFIG_FB_SIS_315 2213#ifdef CONFIG_FB_SIS_315
2214 if(ivideo->sisvga_engine == SIS_315_VGA) { 2214 if(ivideo->sisvga_engine == SIS_315_VGA) {
@@ -2222,7 +2222,7 @@ sisfb_sense_crt1(struct sis_video_info *ivideo)
2222 cr17 &= 0x80; 2222 cr17 &= 0x80;
2223 if(!cr17) { 2223 if(!cr17) {
2224 orSISIDXREG(SISCR,0x17,0x80); 2224 orSISIDXREG(SISCR,0x17,0x80);
2225 mustwait = TRUE; 2225 mustwait = true;
2226 outSISIDXREG(SISSR, 0x00, 0x01); 2226 outSISIDXREG(SISSR, 0x00, 0x01);
2227 outSISIDXREG(SISSR, 0x00, 0x03); 2227 outSISIDXREG(SISSR, 0x00, 0x03);
2228 } 2228 }
@@ -2284,7 +2284,7 @@ SiS_SenseLCD(struct sis_video_info *ivideo)
2284 u8 reg, cr37 = 0, paneltype = 0; 2284 u8 reg, cr37 = 0, paneltype = 0;
2285 u16 xres, yres; 2285 u16 xres, yres;
2286 2286
2287 ivideo->SiS_Pr.PanelSelfDetected = FALSE; 2287 ivideo->SiS_Pr.PanelSelfDetected = false;
2288 2288
2289 /* LCD detection only for TMDS bridges */ 2289 /* LCD detection only for TMDS bridges */
2290 if(!(ivideo->vbflags2 & VB2_SISTMDSBRIDGE)) 2290 if(!(ivideo->vbflags2 & VB2_SISTMDSBRIDGE))
@@ -2361,7 +2361,7 @@ SiS_SenseLCD(struct sis_video_info *ivideo)
2361 setSISIDXREG(SISCR, 0x37, 0x0c, cr37); 2361 setSISIDXREG(SISCR, 0x37, 0x0c, cr37);
2362 orSISIDXREG(SISCR, 0x32, 0x08); 2362 orSISIDXREG(SISCR, 0x32, 0x08);
2363 2363
2364 ivideo->SiS_Pr.PanelSelfDetected = TRUE; 2364 ivideo->SiS_Pr.PanelSelfDetected = true;
2365} 2365}
2366 2366
2367static int __devinit 2367static int __devinit
@@ -3016,7 +3016,7 @@ sisfb_save_pdc_emi(struct sis_video_info *ivideo)
3016 int tmp; 3016 int tmp;
3017 inSISIDXREG(SISPART1,0x13,tmp); 3017 inSISIDXREG(SISPART1,0x13,tmp);
3018 if(tmp & 0x04) { 3018 if(tmp & 0x04) {
3019 ivideo->SiS_Pr.SiS_UseLCDA = TRUE; 3019 ivideo->SiS_Pr.SiS_UseLCDA = true;
3020 ivideo->detectedlcda = 0x03; 3020 ivideo->detectedlcda = 0x03;
3021 } 3021 }
3022 } 3022 }
@@ -3071,9 +3071,9 @@ sisfb_save_pdc_emi(struct sis_video_info *ivideo)
3071 inSISIDXREG(SISPART4,0x31,ivideo->SiS_Pr.EMI_31); 3071 inSISIDXREG(SISPART4,0x31,ivideo->SiS_Pr.EMI_31);
3072 inSISIDXREG(SISPART4,0x32,ivideo->SiS_Pr.EMI_32); 3072 inSISIDXREG(SISPART4,0x32,ivideo->SiS_Pr.EMI_32);
3073 inSISIDXREG(SISPART4,0x33,ivideo->SiS_Pr.EMI_33); 3073 inSISIDXREG(SISPART4,0x33,ivideo->SiS_Pr.EMI_33);
3074 ivideo->SiS_Pr.HaveEMI = TRUE; 3074 ivideo->SiS_Pr.HaveEMI = true;
3075 if((tmp & 0x20) || (ivideo->detectedlcda != 0xff)) { 3075 if((tmp & 0x20) || (ivideo->detectedlcda != 0xff)) {
3076 ivideo->SiS_Pr.HaveEMILCD = TRUE; 3076 ivideo->SiS_Pr.HaveEMILCD = true;
3077 } 3077 }
3078 } 3078 }
3079 } 3079 }
@@ -3558,8 +3558,8 @@ sisfb_pre_setmode(struct sis_video_info *ivideo)
3558 } 3558 }
3559#endif 3559#endif
3560 3560
3561 SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE); 3561 SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
3562 SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE); 3562 SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
3563 ivideo->curFSTN = ivideo->curDSTN = 0; 3563 ivideo->curFSTN = ivideo->curDSTN = 0;
3564 3564
3565 switch(ivideo->currentvbflags & VB_DISPTYPE_DISP2) { 3565 switch(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
@@ -3814,8 +3814,8 @@ sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val)
3814static void 3814static void
3815sisfb_post_setmode(struct sis_video_info *ivideo) 3815sisfb_post_setmode(struct sis_video_info *ivideo)
3816{ 3816{
3817 BOOLEAN crt1isoff = FALSE; 3817 bool crt1isoff = false;
3818 BOOLEAN doit = TRUE; 3818 bool doit = true;
3819#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315) 3819#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
3820 u8 reg; 3820 u8 reg;
3821#endif 3821#endif
@@ -3834,17 +3834,17 @@ sisfb_post_setmode(struct sis_video_info *ivideo)
3834 3834
3835 /* We can't switch off CRT1 if bridge is in slave mode */ 3835 /* We can't switch off CRT1 if bridge is in slave mode */
3836 if(ivideo->vbflags2 & VB2_VIDEOBRIDGE) { 3836 if(ivideo->vbflags2 & VB2_VIDEOBRIDGE) {
3837 if(sisfb_bridgeisslave(ivideo)) doit = FALSE; 3837 if(sisfb_bridgeisslave(ivideo)) doit = false;
3838 } else 3838 } else
3839 ivideo->sisfb_crt1off = 0; 3839 ivideo->sisfb_crt1off = 0;
3840 3840
3841#ifdef CONFIG_FB_SIS_300 3841#ifdef CONFIG_FB_SIS_300
3842 if(ivideo->sisvga_engine == SIS_300_VGA) { 3842 if(ivideo->sisvga_engine == SIS_300_VGA) {
3843 if((ivideo->sisfb_crt1off) && (doit)) { 3843 if((ivideo->sisfb_crt1off) && (doit)) {
3844 crt1isoff = TRUE; 3844 crt1isoff = true;
3845 reg = 0x00; 3845 reg = 0x00;
3846 } else { 3846 } else {
3847 crt1isoff = FALSE; 3847 crt1isoff = false;
3848 reg = 0x80; 3848 reg = 0x80;
3849 } 3849 }
3850 setSISIDXREG(SISCR, 0x17, 0x7f, reg); 3850 setSISIDXREG(SISCR, 0x17, 0x7f, reg);
@@ -3853,11 +3853,11 @@ sisfb_post_setmode(struct sis_video_info *ivideo)
3853#ifdef CONFIG_FB_SIS_315 3853#ifdef CONFIG_FB_SIS_315
3854 if(ivideo->sisvga_engine == SIS_315_VGA) { 3854 if(ivideo->sisvga_engine == SIS_315_VGA) {
3855 if((ivideo->sisfb_crt1off) && (doit)) { 3855 if((ivideo->sisfb_crt1off) && (doit)) {
3856 crt1isoff = TRUE; 3856 crt1isoff = true;
3857 reg = 0x40; 3857 reg = 0x40;
3858 reg1 = 0xc0; 3858 reg1 = 0xc0;
3859 } else { 3859 } else {
3860 crt1isoff = FALSE; 3860 crt1isoff = false;
3861 reg = 0x00; 3861 reg = 0x00;
3862 reg1 = 0x00; 3862 reg1 = 0x00;
3863 } 3863 }
@@ -4004,9 +4004,9 @@ sisfb_setup(char *options)
4004 } else if(!strnicmp(this_opt, "tvstandard:",11)) { 4004 } else if(!strnicmp(this_opt, "tvstandard:",11)) {
4005 sisfb_search_tvstd(this_opt + 11); 4005 sisfb_search_tvstd(this_opt + 11);
4006 } else if(!strnicmp(this_opt, "mode:", 5)) { 4006 } else if(!strnicmp(this_opt, "mode:", 5)) {
4007 sisfb_search_mode(this_opt + 5, FALSE); 4007 sisfb_search_mode(this_opt + 5, false);
4008 } else if(!strnicmp(this_opt, "vesa:", 5)) { 4008 } else if(!strnicmp(this_opt, "vesa:", 5)) {
4009 sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), FALSE); 4009 sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), false);
4010 } else if(!strnicmp(this_opt, "rate:", 5)) { 4010 } else if(!strnicmp(this_opt, "rate:", 5)) {
4011 sisfb_parm_rate = simple_strtoul(this_opt + 5, NULL, 0); 4011 sisfb_parm_rate = simple_strtoul(this_opt + 5, NULL, 0);
4012 } else if(!strnicmp(this_opt, "forcecrt1:", 10)) { 4012 } else if(!strnicmp(this_opt, "forcecrt1:", 10)) {
@@ -4062,7 +4062,7 @@ sisfb_setup(char *options)
4062 sisfb_lvdshl = temp; 4062 sisfb_lvdshl = temp;
4063 } 4063 }
4064 } else if(this_opt[0] >= '0' && this_opt[0] <= '9') { 4064 } else if(this_opt[0] >= '0' && this_opt[0] <= '9') {
4065 sisfb_search_mode(this_opt, TRUE); 4065 sisfb_search_mode(this_opt, true);
4066#if !defined(__i386__) && !defined(__x86_64__) 4066#if !defined(__i386__) && !defined(__x86_64__)
4067 } else if(!strnicmp(this_opt, "resetcard", 9)) { 4067 } else if(!strnicmp(this_opt, "resetcard", 9)) {
4068 sisfb_resetcard = 1; 4068 sisfb_resetcard = 1;
@@ -4564,9 +4564,9 @@ sisfb_post_sis300(struct pci_dev *pdev)
4564 sisfb_sense_crt1(ivideo); 4564 sisfb_sense_crt1(ivideo);
4565 4565
4566 /* Set default mode, don't clear screen */ 4566 /* Set default mode, don't clear screen */
4567 ivideo->SiS_Pr.SiS_UseOEM = FALSE; 4567 ivideo->SiS_Pr.SiS_UseOEM = false;
4568 SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE); 4568 SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
4569 SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE); 4569 SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
4570 ivideo->curFSTN = ivideo->curDSTN = 0; 4570 ivideo->curFSTN = ivideo->curDSTN = 0;
4571 ivideo->SiS_Pr.VideoMemorySize = 8 << 20; 4571 ivideo->SiS_Pr.VideoMemorySize = 8 << 20;
4572 SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80); 4572 SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80);
@@ -5680,9 +5680,9 @@ sisfb_post_xgi(struct pci_dev *pdev)
5680 } else { 5680 } else {
5681 5681
5682 /* Set default mode, don't clear screen */ 5682 /* Set default mode, don't clear screen */
5683 ivideo->SiS_Pr.SiS_UseOEM = FALSE; 5683 ivideo->SiS_Pr.SiS_UseOEM = false;
5684 SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE); 5684 SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
5685 SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE); 5685 SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
5686 ivideo->curFSTN = ivideo->curDSTN = 0; 5686 ivideo->curFSTN = ivideo->curDSTN = 0;
5687 ivideo->SiS_Pr.VideoMemorySize = 8 << 20; 5687 ivideo->SiS_Pr.VideoMemorySize = 8 << 20;
5688 SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80); 5688 SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80);
@@ -5723,9 +5723,9 @@ sisfb_post_xgi(struct pci_dev *pdev)
5723 } 5723 }
5724 5724
5725 /* Set default mode, don't clear screen */ 5725 /* Set default mode, don't clear screen */
5726 ivideo->SiS_Pr.SiS_UseOEM = FALSE; 5726 ivideo->SiS_Pr.SiS_UseOEM = false;
5727 SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE); 5727 SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
5728 SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE); 5728 SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
5729 ivideo->curFSTN = ivideo->curDSTN = 0; 5729 ivideo->curFSTN = ivideo->curDSTN = 0;
5730 SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80); 5730 SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80);
5731 5731
@@ -5819,7 +5819,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5819 ivideo->detectedpdca = 0xff; 5819 ivideo->detectedpdca = 0xff;
5820 ivideo->detectedlcda = 0xff; 5820 ivideo->detectedlcda = 0xff;
5821 5821
5822 ivideo->sisfb_thismonitor.datavalid = FALSE; 5822 ivideo->sisfb_thismonitor.datavalid = false;
5823 5823
5824 ivideo->current_base = 0; 5824 ivideo->current_base = 0;
5825 5825
@@ -5871,21 +5871,21 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5871 5871
5872 ivideo->SiS_Pr.SiS_Backup70xx = 0xff; 5872 ivideo->SiS_Pr.SiS_Backup70xx = 0xff;
5873 ivideo->SiS_Pr.SiS_CHOverScan = -1; 5873 ivideo->SiS_Pr.SiS_CHOverScan = -1;
5874 ivideo->SiS_Pr.SiS_ChSW = FALSE; 5874 ivideo->SiS_Pr.SiS_ChSW = false;
5875 ivideo->SiS_Pr.SiS_UseLCDA = FALSE; 5875 ivideo->SiS_Pr.SiS_UseLCDA = false;
5876 ivideo->SiS_Pr.HaveEMI = FALSE; 5876 ivideo->SiS_Pr.HaveEMI = false;
5877 ivideo->SiS_Pr.HaveEMILCD = FALSE; 5877 ivideo->SiS_Pr.HaveEMILCD = false;
5878 ivideo->SiS_Pr.OverruleEMI = FALSE; 5878 ivideo->SiS_Pr.OverruleEMI = false;
5879 ivideo->SiS_Pr.SiS_SensibleSR11 = FALSE; 5879 ivideo->SiS_Pr.SiS_SensibleSR11 = false;
5880 ivideo->SiS_Pr.SiS_MyCR63 = 0x63; 5880 ivideo->SiS_Pr.SiS_MyCR63 = 0x63;
5881 ivideo->SiS_Pr.PDC = -1; 5881 ivideo->SiS_Pr.PDC = -1;
5882 ivideo->SiS_Pr.PDCA = -1; 5882 ivideo->SiS_Pr.PDCA = -1;
5883 ivideo->SiS_Pr.DDCPortMixup = FALSE; 5883 ivideo->SiS_Pr.DDCPortMixup = false;
5884#ifdef CONFIG_FB_SIS_315 5884#ifdef CONFIG_FB_SIS_315
5885 if(ivideo->chip >= SIS_330) { 5885 if(ivideo->chip >= SIS_330) {
5886 ivideo->SiS_Pr.SiS_MyCR63 = 0x53; 5886 ivideo->SiS_Pr.SiS_MyCR63 = 0x53;
5887 if(ivideo->chip >= SIS_661) { 5887 if(ivideo->chip >= SIS_661) {
5888 ivideo->SiS_Pr.SiS_SensibleSR11 = TRUE; 5888 ivideo->SiS_Pr.SiS_SensibleSR11 = true;
5889 } 5889 }
5890 } 5890 }
5891#endif 5891#endif
@@ -5969,7 +5969,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
5969 do { 5969 do {
5970 if(mychswtable[i].subsysVendor == ivideo->subsysvendor && 5970 if(mychswtable[i].subsysVendor == ivideo->subsysvendor &&
5971 mychswtable[i].subsysCard == ivideo->subsysdevice) { 5971 mychswtable[i].subsysCard == ivideo->subsysdevice) {
5972 ivideo->SiS_Pr.SiS_ChSW = TRUE; 5972 ivideo->SiS_Pr.SiS_ChSW = true;
5973 printk(KERN_DEBUG "sisfb: Identified [%s %s] " 5973 printk(KERN_DEBUG "sisfb: Identified [%s %s] "
5974 "requiring Chrontel/GPIO setup\n", 5974 "requiring Chrontel/GPIO setup\n",
5975 mychswtable[i].vendorName, 5975 mychswtable[i].vendorName,
@@ -6018,20 +6018,20 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
6018 /* Search and copy ROM image */ 6018 /* Search and copy ROM image */
6019 ivideo->bios_abase = NULL; 6019 ivideo->bios_abase = NULL;
6020 ivideo->SiS_Pr.VirtualRomBase = NULL; 6020 ivideo->SiS_Pr.VirtualRomBase = NULL;
6021 ivideo->SiS_Pr.UseROM = FALSE; 6021 ivideo->SiS_Pr.UseROM = false;
6022 ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = FALSE; 6022 ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = false;
6023 if(ivideo->sisfb_userom) { 6023 if(ivideo->sisfb_userom) {
6024 ivideo->SiS_Pr.VirtualRomBase = sisfb_find_rom(pdev); 6024 ivideo->SiS_Pr.VirtualRomBase = sisfb_find_rom(pdev);
6025 ivideo->bios_abase = ivideo->SiS_Pr.VirtualRomBase; 6025 ivideo->bios_abase = ivideo->SiS_Pr.VirtualRomBase;
6026 ivideo->SiS_Pr.UseROM = (ivideo->SiS_Pr.VirtualRomBase) ? TRUE : FALSE; 6026 ivideo->SiS_Pr.UseROM = (bool)(ivideo->SiS_Pr.VirtualRomBase);
6027 printk(KERN_INFO "sisfb: Video ROM %sfound\n", 6027 printk(KERN_INFO "sisfb: Video ROM %sfound\n",
6028 ivideo->SiS_Pr.UseROM ? "" : "not "); 6028 ivideo->SiS_Pr.UseROM ? "" : "not ");
6029 if((ivideo->SiS_Pr.UseROM) && (ivideo->chip >= XGI_20)) { 6029 if((ivideo->SiS_Pr.UseROM) && (ivideo->chip >= XGI_20)) {
6030 ivideo->SiS_Pr.UseROM = FALSE; 6030 ivideo->SiS_Pr.UseROM = false;
6031 ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = TRUE; 6031 ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = true;
6032 if( (ivideo->revision_id == 2) && 6032 if( (ivideo->revision_id == 2) &&
6033 (!(ivideo->bios_abase[0x1d1] & 0x01)) ) { 6033 (!(ivideo->bios_abase[0x1d1] & 0x01)) ) {
6034 ivideo->SiS_Pr.DDCPortMixup = TRUE; 6034 ivideo->SiS_Pr.DDCPortMixup = true;
6035 } 6035 }
6036 } 6036 }
6037 } else { 6037 } else {
@@ -6677,9 +6677,9 @@ static int __init sisfb_init_module(void)
6677 sisfb_search_tvstd(tvstandard); 6677 sisfb_search_tvstd(tvstandard);
6678 6678
6679 if(mode) 6679 if(mode)
6680 sisfb_search_mode(mode, FALSE); 6680 sisfb_search_mode(mode, false);
6681 else if(vesa != -1) 6681 else if(vesa != -1)
6682 sisfb_search_vesamode(vesa, FALSE); 6682 sisfb_search_vesamode(vesa, false);
6683 6683
6684 sisfb_crt1off = (crt1off == 0) ? 1 : 0; 6684 sisfb_crt1off = (crt1off == 0) ? 1 : 0;
6685 6685
diff --git a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h
index 88e4f1e41470..3e3b7fa05d6c 100644
--- a/drivers/video/sis/sis_main.h
+++ b/drivers/video/sis/sis_main.h
@@ -411,54 +411,54 @@ static const struct _sis_vrate {
411 u16 xres; 411 u16 xres;
412 u16 yres; 412 u16 yres;
413 u16 refresh; 413 u16 refresh;
414 BOOLEAN SiS730valid32bpp; 414 bool SiS730valid32bpp;
415} sisfb_vrate[] = { 415} sisfb_vrate[] = {
416 {1, 320, 200, 70, TRUE}, 416 {1, 320, 200, 70, true},
417 {1, 320, 240, 60, TRUE}, 417 {1, 320, 240, 60, true},
418 {1, 400, 300, 60, TRUE}, 418 {1, 400, 300, 60, true},
419 {1, 512, 384, 60, TRUE}, 419 {1, 512, 384, 60, true},
420 {1, 640, 400, 72, TRUE}, 420 {1, 640, 400, 72, true},
421 {1, 640, 480, 60, TRUE}, {2, 640, 480, 72, TRUE}, {3, 640, 480, 75, TRUE}, 421 {1, 640, 480, 60, true}, {2, 640, 480, 72, true}, {3, 640, 480, 75, true},
422 {4, 640, 480, 85, TRUE}, {5, 640, 480, 100, TRUE}, {6, 640, 480, 120, TRUE}, 422 {4, 640, 480, 85, true}, {5, 640, 480, 100, true}, {6, 640, 480, 120, true},
423 {7, 640, 480, 160, TRUE}, {8, 640, 480, 200, TRUE}, 423 {7, 640, 480, 160, true}, {8, 640, 480, 200, true},
424 {1, 720, 480, 60, TRUE}, 424 {1, 720, 480, 60, true},
425 {1, 720, 576, 58, TRUE}, 425 {1, 720, 576, 58, true},
426 {1, 768, 576, 58, TRUE}, 426 {1, 768, 576, 58, true},
427 {1, 800, 480, 60, TRUE}, {2, 800, 480, 75, TRUE}, {3, 800, 480, 85, TRUE}, 427 {1, 800, 480, 60, true}, {2, 800, 480, 75, true}, {3, 800, 480, 85, true},
428 {1, 800, 600, 56, TRUE}, {2, 800, 600, 60, TRUE}, {3, 800, 600, 72, TRUE}, 428 {1, 800, 600, 56, true}, {2, 800, 600, 60, true}, {3, 800, 600, 72, true},
429 {4, 800, 600, 75, TRUE}, {5, 800, 600, 85, TRUE}, {6, 800, 600, 105, TRUE}, 429 {4, 800, 600, 75, true}, {5, 800, 600, 85, true}, {6, 800, 600, 105, true},
430 {7, 800, 600, 120, TRUE}, {8, 800, 600, 160, TRUE}, 430 {7, 800, 600, 120, true}, {8, 800, 600, 160, true},
431 {1, 848, 480, 39, TRUE}, {2, 848, 480, 60, TRUE}, 431 {1, 848, 480, 39, true}, {2, 848, 480, 60, true},
432 {1, 856, 480, 39, TRUE}, {2, 856, 480, 60, TRUE}, 432 {1, 856, 480, 39, true}, {2, 856, 480, 60, true},
433 {1, 960, 540, 60, TRUE}, 433 {1, 960, 540, 60, true},
434 {1, 960, 600, 60, TRUE}, 434 {1, 960, 600, 60, true},
435 {1, 1024, 576, 60, TRUE}, {2, 1024, 576, 75, TRUE}, {3, 1024, 576, 85, TRUE}, 435 {1, 1024, 576, 60, true}, {2, 1024, 576, 75, true}, {3, 1024, 576, 85, true},
436 {1, 1024, 600, 60, TRUE}, 436 {1, 1024, 600, 60, true},
437 {1, 1024, 768, 43, TRUE}, {2, 1024, 768, 60, TRUE}, {3, 1024, 768, 70, FALSE}, 437 {1, 1024, 768, 43, true}, {2, 1024, 768, 60, true}, {3, 1024, 768, 70, false},
438 {4, 1024, 768, 75, FALSE}, {5, 1024, 768, 85, TRUE}, {6, 1024, 768, 100, TRUE}, 438 {4, 1024, 768, 75, false}, {5, 1024, 768, 85, true}, {6, 1024, 768, 100, true},
439 {7, 1024, 768, 120, TRUE}, 439 {7, 1024, 768, 120, true},
440 {1, 1152, 768, 60, TRUE}, 440 {1, 1152, 768, 60, true},
441 {1, 1152, 864, 60, TRUE}, {2, 1152, 864, 75, TRUE}, {3, 1152, 864, 84, TRUE}, 441 {1, 1152, 864, 60, true}, {2, 1152, 864, 75, true}, {3, 1152, 864, 84, true},
442 {1, 1280, 720, 60, TRUE}, {2, 1280, 720, 75, TRUE}, {3, 1280, 720, 85, TRUE}, 442 {1, 1280, 720, 60, true}, {2, 1280, 720, 75, true}, {3, 1280, 720, 85, true},
443 {1, 1280, 768, 60, TRUE}, 443 {1, 1280, 768, 60, true},
444 {1, 1280, 800, 60, TRUE}, 444 {1, 1280, 800, 60, true},
445 {1, 1280, 854, 60, TRUE}, 445 {1, 1280, 854, 60, true},
446 {1, 1280, 960, 60, TRUE}, {2, 1280, 960, 85, TRUE}, 446 {1, 1280, 960, 60, true}, {2, 1280, 960, 85, true},
447 {1, 1280, 1024, 43, TRUE}, {2, 1280, 1024, 60, TRUE}, {3, 1280, 1024, 75, TRUE}, 447 {1, 1280, 1024, 43, true}, {2, 1280, 1024, 60, true}, {3, 1280, 1024, 75, true},
448 {4, 1280, 1024, 85, TRUE}, 448 {4, 1280, 1024, 85, true},
449 {1, 1360, 768, 60, TRUE}, 449 {1, 1360, 768, 60, true},
450 {1, 1360, 1024, 59, TRUE}, 450 {1, 1360, 1024, 59, true},
451 {1, 1400, 1050, 60, TRUE}, {2, 1400, 1050, 75, TRUE}, 451 {1, 1400, 1050, 60, true}, {2, 1400, 1050, 75, true},
452 {1, 1600, 1200, 60, TRUE}, {2, 1600, 1200, 65, TRUE}, {3, 1600, 1200, 70, TRUE}, 452 {1, 1600, 1200, 60, true}, {2, 1600, 1200, 65, true}, {3, 1600, 1200, 70, true},
453 {4, 1600, 1200, 75, TRUE}, {5, 1600, 1200, 85, TRUE}, {6, 1600, 1200, 100, TRUE}, 453 {4, 1600, 1200, 75, true}, {5, 1600, 1200, 85, true}, {6, 1600, 1200, 100, true},
454 {7, 1600, 1200, 120, TRUE}, 454 {7, 1600, 1200, 120, true},
455 {1, 1680, 1050, 60, TRUE}, 455 {1, 1680, 1050, 60, true},
456 {1, 1920, 1080, 30, TRUE}, 456 {1, 1920, 1080, 30, true},
457 {1, 1920, 1440, 60, TRUE}, {2, 1920, 1440, 65, TRUE}, {3, 1920, 1440, 70, TRUE}, 457 {1, 1920, 1440, 60, true}, {2, 1920, 1440, 65, true}, {3, 1920, 1440, 70, true},
458 {4, 1920, 1440, 75, TRUE}, {5, 1920, 1440, 85, TRUE}, {6, 1920, 1440, 100, TRUE}, 458 {4, 1920, 1440, 75, true}, {5, 1920, 1440, 85, true}, {6, 1920, 1440, 100, true},
459 {1, 2048, 1536, 60, TRUE}, {2, 2048, 1536, 65, TRUE}, {3, 2048, 1536, 70, TRUE}, 459 {1, 2048, 1536, 60, true}, {2, 2048, 1536, 65, true}, {3, 2048, 1536, 70, true},
460 {4, 2048, 1536, 75, TRUE}, {5, 2048, 1536, 85, TRUE}, 460 {4, 2048, 1536, 75, true}, {5, 2048, 1536, 85, true},
461 {0, 0, 0, 0, FALSE} 461 {0, 0, 0, 0, false}
462}; 462};
463 463
464static struct _sisfbddcsmodes { 464static struct _sisfbddcsmodes {
@@ -691,7 +691,7 @@ extern int sisfb_initaccel(struct sis_video_info *ivideo);
691extern void sisfb_syncaccel(struct sis_video_info *ivideo); 691extern void sisfb_syncaccel(struct sis_video_info *ivideo);
692 692
693/* Internal general routines */ 693/* Internal general routines */
694static void sisfb_search_mode(char *name, BOOLEAN quiet); 694static void sisfb_search_mode(char *name, bool quiet);
695static int sisfb_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags); 695static int sisfb_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags);
696static u8 sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, 696static u8 sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate,
697 int index); 697 int index);
@@ -702,10 +702,10 @@ static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
702 struct fb_info *info); 702 struct fb_info *info);
703static void sisfb_pre_setmode(struct sis_video_info *ivideo); 703static void sisfb_pre_setmode(struct sis_video_info *ivideo);
704static void sisfb_post_setmode(struct sis_video_info *ivideo); 704static void sisfb_post_setmode(struct sis_video_info *ivideo);
705static BOOLEAN sisfb_CheckVBRetrace(struct sis_video_info *ivideo); 705static bool sisfb_CheckVBRetrace(struct sis_video_info *ivideo);
706static BOOLEAN sisfbcheckvretracecrt2(struct sis_video_info *ivideo); 706static bool sisfbcheckvretracecrt2(struct sis_video_info *ivideo);
707static BOOLEAN sisfbcheckvretracecrt1(struct sis_video_info *ivideo); 707static bool sisfbcheckvretracecrt1(struct sis_video_info *ivideo);
708static BOOLEAN sisfb_bridgeisslave(struct sis_video_info *ivideo); 708static bool sisfb_bridgeisslave(struct sis_video_info *ivideo);
709static void sisfb_detect_VB_connect(struct sis_video_info *ivideo); 709static void sisfb_detect_VB_connect(struct sis_video_info *ivideo);
710static void sisfb_get_VB_type(struct sis_video_info *ivideo); 710static void sisfb_get_VB_type(struct sis_video_info *ivideo);
711static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val); 711static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val);
@@ -737,20 +737,20 @@ static void sisfb_free_node(struct SIS_HEAP *memheap, struct SIS_OH *poh);
737 737
738/* Routines from init.c/init301.c */ 738/* Routines from init.c/init301.c */
739extern unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 739extern unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay,
740 int VDisplay, int Depth, BOOLEAN FSTN, unsigned short CustomT, 740 int VDisplay, int Depth, bool FSTN, unsigned short CustomT,
741 int LCDwith, int LCDheight, unsigned int VBFlags2); 741 int LCDwith, int LCDheight, unsigned int VBFlags2);
742extern unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay, 742extern unsigned short SiS_GetModeID_TV(int VGAEngine, unsigned int VBFlags, int HDisplay,
743 int VDisplay, int Depth, unsigned int VBFlags2); 743 int VDisplay, int Depth, unsigned int VBFlags2);
744extern unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, 744extern unsigned short SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay,
745 int VDisplay, int Depth, unsigned int VBFlags2); 745 int VDisplay, int Depth, unsigned int VBFlags2);
746extern void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr); 746extern void SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
747extern BOOLEAN SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 747extern bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
748extern void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable); 748extern void SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable);
749extern void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); 749extern void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable);
750 750
751extern BOOLEAN SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); 751extern bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr);
752 752
753extern BOOLEAN sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno, 753extern bool sisfb_gettotalfrommode(struct SiS_Private *SiS_Pr, unsigned char modeno,
754 int *htotal, int *vtotal, unsigned char rateindex); 754 int *htotal, int *vtotal, unsigned char rateindex);
755extern int sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr, 755extern int sisfb_mode_rate_to_dclock(struct SiS_Private *SiS_Pr,
756 unsigned char modeno, unsigned char rateindex); 756 unsigned char modeno, unsigned char rateindex);
diff --git a/drivers/video/sis/vgatypes.h b/drivers/video/sis/vgatypes.h
index 05d08b7889a1..b532fbd2b04c 100644
--- a/drivers/video/sis/vgatypes.h
+++ b/drivers/video/sis/vgatypes.h
@@ -57,18 +57,6 @@
57#include <linux/version.h> 57#include <linux/version.h>
58#endif 58#endif
59 59
60#ifndef FALSE
61#define FALSE 0
62#endif
63
64#ifndef TRUE
65#define TRUE 1
66#endif
67
68#ifndef BOOLEAN
69typedef unsigned int BOOLEAN;
70#endif
71
72#define SISIOMEMTYPE 60#define SISIOMEMTYPE
73 61
74#ifdef SIS_LINUX_KERNEL 62#ifdef SIS_LINUX_KERNEL
diff --git a/drivers/video/sis/vstruct.h b/drivers/video/sis/vstruct.h
index 9ae32923c142..705c85360526 100644
--- a/drivers/video/sis/vstruct.h
+++ b/drivers/video/sis/vstruct.h
@@ -240,7 +240,7 @@ struct SiS_Private
240 void *ivideo; 240 void *ivideo;
241#endif 241#endif
242 unsigned char *VirtualRomBase; 242 unsigned char *VirtualRomBase;
243 BOOLEAN UseROM; 243 bool UseROM;
244#ifdef SIS_LINUX_KERNEL 244#ifdef SIS_LINUX_KERNEL
245 unsigned char SISIOMEMTYPE *VideoMemoryAddress; 245 unsigned char SISIOMEMTYPE *VideoMemoryAddress;
246 unsigned int VideoMemorySize; 246 unsigned int VideoMemorySize;
@@ -283,24 +283,24 @@ struct SiS_Private
283#ifdef SIS_XORG_XF86 283#ifdef SIS_XORG_XF86
284 unsigned short SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4; 284 unsigned short SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4;
285#endif 285#endif
286 BOOLEAN SiS_UseROM; 286 bool SiS_UseROM;
287 BOOLEAN SiS_ROMNew; 287 bool SiS_ROMNew;
288 BOOLEAN SiS_XGIROM; 288 bool SiS_XGIROM;
289 BOOLEAN SiS_NeedRomModeData; 289 bool SiS_NeedRomModeData;
290 BOOLEAN PanelSelfDetected; 290 bool PanelSelfDetected;
291 BOOLEAN DDCPortMixup; 291 bool DDCPortMixup;
292 int SiS_CHOverScan; 292 int SiS_CHOverScan;
293 BOOLEAN SiS_CHSOverScan; 293 bool SiS_CHSOverScan;
294 BOOLEAN SiS_ChSW; 294 bool SiS_ChSW;
295 BOOLEAN SiS_UseLCDA; 295 bool SiS_UseLCDA;
296 int SiS_UseOEM; 296 int SiS_UseOEM;
297 unsigned int SiS_CustomT; 297 unsigned int SiS_CustomT;
298 int SiS_UseWide, SiS_UseWideCRT2; 298 int SiS_UseWide, SiS_UseWideCRT2;
299 int SiS_TVBlue; 299 int SiS_TVBlue;
300 unsigned short SiS_Backup70xx; 300 unsigned short SiS_Backup70xx;
301 BOOLEAN HaveEMI; 301 bool HaveEMI;
302 BOOLEAN HaveEMILCD; 302 bool HaveEMILCD;
303 BOOLEAN OverruleEMI; 303 bool OverruleEMI;
304 unsigned char EMI_30,EMI_31,EMI_32,EMI_33; 304 unsigned char EMI_30,EMI_31,EMI_32,EMI_33;
305 unsigned short SiS_EMIOffset; 305 unsigned short SiS_EMIOffset;
306 unsigned short SiS_PWDOffset; 306 unsigned short SiS_PWDOffset;
@@ -352,7 +352,7 @@ struct SiS_Private
352 unsigned short SiS_DDC_ReadAddr; 352 unsigned short SiS_DDC_ReadAddr;
353 unsigned short SiS_DDC_SecAddr; 353 unsigned short SiS_DDC_SecAddr;
354 unsigned short SiS_ChrontelInit; 354 unsigned short SiS_ChrontelInit;
355 BOOLEAN SiS_SensibleSR11; 355 bool SiS_SensibleSR11;
356 unsigned short SiS661LCD2TableSize; 356 unsigned short SiS661LCD2TableSize;
357 357
358 unsigned short SiS_PanelMinLVDS; 358 unsigned short SiS_PanelMinLVDS;
@@ -494,10 +494,10 @@ struct SiS_Private
494 unsigned short PanelVRS, PanelVRE; 494 unsigned short PanelVRS, PanelVRE;
495 unsigned short PanelVCLKIdx300; 495 unsigned short PanelVCLKIdx300;
496 unsigned short PanelVCLKIdx315; 496 unsigned short PanelVCLKIdx315;
497 BOOLEAN Alternate1600x1200; 497 bool Alternate1600x1200;
498 498
499 BOOLEAN UseCustomMode; 499 bool UseCustomMode;
500 BOOLEAN CRT1UsesCustomMode; 500 bool CRT1UsesCustomMode;
501 unsigned short CHDisplay; 501 unsigned short CHDisplay;
502 unsigned short CHSyncStart; 502 unsigned short CHSyncStart;
503 unsigned short CHSyncEnd; 503 unsigned short CHSyncEnd;
@@ -523,7 +523,7 @@ struct SiS_Private
523 523
524 int LVDSHL; 524 int LVDSHL;
525 525
526 BOOLEAN Backup; 526 bool Backup;
527 unsigned char Backup_Mode; 527 unsigned char Backup_Mode;
528 unsigned char Backup_14; 528 unsigned char Backup_14;
529 unsigned char Backup_15; 529 unsigned char Backup_15;
@@ -542,12 +542,12 @@ struct SiS_Private
542 int CenterScreen; 542 int CenterScreen;
543 543
544 unsigned short CP_Vendor, CP_Product; 544 unsigned short CP_Vendor, CP_Product;
545 BOOLEAN CP_HaveCustomData; 545 bool CP_HaveCustomData;
546 int CP_PreferredX, CP_PreferredY, CP_PreferredIndex; 546 int CP_PreferredX, CP_PreferredY, CP_PreferredIndex;
547 int CP_MaxX, CP_MaxY, CP_MaxClock; 547 int CP_MaxX, CP_MaxY, CP_MaxClock;
548 unsigned char CP_PrefSR2B, CP_PrefSR2C; 548 unsigned char CP_PrefSR2B, CP_PrefSR2C;
549 unsigned short CP_PrefClock; 549 unsigned short CP_PrefClock;
550 BOOLEAN CP_Supports64048075; 550 bool CP_Supports64048075;
551 int CP_HDisplay[7], CP_VDisplay[7]; /* For Custom LCD panel dimensions */ 551 int CP_HDisplay[7], CP_VDisplay[7]; /* For Custom LCD panel dimensions */
552 int CP_HTotal[7], CP_VTotal[7]; 552 int CP_HTotal[7], CP_VTotal[7];
553 int CP_HSyncStart[7], CP_VSyncStart[7]; 553 int CP_HSyncStart[7], CP_VSyncStart[7];
@@ -555,8 +555,8 @@ struct SiS_Private
555 int CP_HBlankStart[7], CP_VBlankStart[7]; 555 int CP_HBlankStart[7], CP_VBlankStart[7];
556 int CP_HBlankEnd[7], CP_VBlankEnd[7]; 556 int CP_HBlankEnd[7], CP_VBlankEnd[7];
557 int CP_Clock[7]; 557 int CP_Clock[7];
558 BOOLEAN CP_DataValid[7]; 558 bool CP_DataValid[7];
559 BOOLEAN CP_HSync_P[7], CP_VSync_P[7], CP_SyncValid[7]; 559 bool CP_HSync_P[7], CP_VSync_P[7], CP_SyncValid[7];
560}; 560};
561 561
562#endif 562#endif