diff options
author | Richard Knutsson <ricknu-0@student.ltu.se> | 2007-02-12 00:55:06 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 09:48:42 -0800 |
commit | c30660ead2dd6ced47ac6ad4c099fb9305263ffb (patch) | |
tree | b85e8c6db87e0627924568ac6ad2b5d71965bcfb /drivers/video/sis | |
parent | 3aebbd8f92ef1aa3048800b4991db60403b85964 (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.c | 140 | ||||
-rw-r--r-- | drivers/video/sis/init.h | 36 | ||||
-rw-r--r-- | drivers/video/sis/init301.c | 260 | ||||
-rw-r--r-- | drivers/video/sis/init301.h | 14 | ||||
-rw-r--r-- | drivers/video/sis/initextlfb.c | 18 | ||||
-rw-r--r-- | drivers/video/sis/sis.h | 2 | ||||
-rw-r--r-- | drivers/video/sis/sis_main.c | 214 | ||||
-rw-r--r-- | drivers/video/sis/sis_main.h | 112 | ||||
-rw-r--r-- | drivers/video/sis/vgatypes.h | 12 | ||||
-rw-r--r-- | drivers/video/sis/vstruct.h | 44 |
10 files changed, 420 insertions, 432 deletions
diff --git a/drivers/video/sis/init.c b/drivers/video/sis/init.c index 2ab3868efde..c311ad3c368 100644 --- a/drivers/video/sis/init.c +++ b/drivers/video/sis/init.c @@ -317,23 +317,23 @@ InitTo310Pointer(struct SiS_Private *SiS_Pr) } #endif -BOOLEAN +bool SiSInitPtr(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType < SIS_315H) { #ifdef SIS300 InitTo300Pointer(SiS_Pr); #else - return FALSE; + return false; #endif } else { #ifdef SIS315H InitTo310Pointer(SiS_Pr); #else - return FALSE; + return false; #endif } - return TRUE; + return true; } /*********************************************/ @@ -345,7 +345,7 @@ static #endif unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, - int Depth, BOOLEAN FSTN, int LCDwidth, int LCDheight) + int Depth, bool FSTN, int LCDwidth, int LCDheight) { unsigned short ModeIndex = 0; @@ -483,7 +483,7 @@ SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, - int Depth, BOOLEAN FSTN, unsigned short CustomT, int LCDwidth, int LCDheight, + int Depth, bool FSTN, unsigned short CustomT, int LCDwidth, int LCDheight, unsigned int VBFlags2) { unsigned short ModeIndex = 0; @@ -873,7 +873,7 @@ SiS_GetModeID_VGA2(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDispl break; } - return SiS_GetModeID(VGAEngine, 0, HDisplay, VDisplay, Depth, FALSE, 0, 0); + return SiS_GetModeID(VGAEngine, 0, HDisplay, VDisplay, Depth, false, 0, 0); } @@ -1020,12 +1020,12 @@ SiS_GetSysFlags(struct SiS_Private *SiS_Pr) /* 661 and newer: NEVER write non-zero to SR11[7:4] */ /* (SR11 is used for DDC and in enable/disablebridge) */ - SiS_Pr->SiS_SensibleSR11 = FALSE; + SiS_Pr->SiS_SensibleSR11 = false; SiS_Pr->SiS_MyCR63 = 0x63; if(SiS_Pr->ChipType >= SIS_330) { SiS_Pr->SiS_MyCR63 = 0x53; if(SiS_Pr->ChipType >= SIS_661) { - SiS_Pr->SiS_SensibleSR11 = TRUE; + SiS_Pr->SiS_SensibleSR11 = true; } } @@ -1253,7 +1253,7 @@ SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, /* HELPER: Determine ROM usage */ /*********************************************/ -BOOLEAN +bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; @@ -1261,16 +1261,16 @@ SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr) if(SiS_Pr->ChipType >= XGI_20) { /* XGI ROMs don't qualify */ - return FALSE; + return false; } else if(SiS_Pr->ChipType >= SIS_761) { /* I very much assume 761, 340 and newer will use new layout */ - return TRUE; + return true; } else if(SiS_Pr->ChipType >= SIS_661) { if((ROMAddr[0x1a] == 'N') && (ROMAddr[0x1b] == 'e') && (ROMAddr[0x1c] == 'w') && (ROMAddr[0x1d] == 'V')) { - return TRUE; + return true; } romversoffs = ROMAddr[0x16] | (ROMAddr[0x17] << 8); if(romversoffs) { @@ -1280,17 +1280,17 @@ SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr) } } if((romvmaj != 0) || (romvmin >= 92)) { - return TRUE; + return true; } } else if(IS_SIS650740) { if((ROMAddr[0x1a] == 'N') && (ROMAddr[0x1b] == 'e') && (ROMAddr[0x1c] == 'w') && (ROMAddr[0x1d] == 'V')) { - return TRUE; + return true; } } - return FALSE; + return false; } static void @@ -1299,8 +1299,8 @@ SiSDetermineROMUsage(struct SiS_Private *SiS_Pr) unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; unsigned short romptr = 0; - SiS_Pr->SiS_UseROM = FALSE; - SiS_Pr->SiS_ROMNew = FALSE; + SiS_Pr->SiS_UseROM = false; + SiS_Pr->SiS_ROMNew = false; SiS_Pr->SiS_PWDOffset = 0; if(SiS_Pr->ChipType >= XGI_20) return; @@ -1312,15 +1312,15 @@ SiSDetermineROMUsage(struct SiS_Private *SiS_Pr) * of the BIOS image. */ if((ROMAddr[3] == 0xe9) && ((ROMAddr[5] << 8) | ROMAddr[4]) > 0x21a) - SiS_Pr->SiS_UseROM = TRUE; + SiS_Pr->SiS_UseROM = true; } else if(SiS_Pr->ChipType < SIS_315H) { /* Sony's VAIO BIOS 1.09 follows the standard, so perhaps * the others do as well */ - SiS_Pr->SiS_UseROM = TRUE; + SiS_Pr->SiS_UseROM = true; } else { /* 315/330 series stick to the standard(s) */ - SiS_Pr->SiS_UseROM = TRUE; + SiS_Pr->SiS_UseROM = true; if((SiS_Pr->SiS_ROMNew = SiSDetermineROMLayout661(SiS_Pr))) { SiS_Pr->SiS_EMIOffset = 14; SiS_Pr->SiS_PWDOffset = 17; @@ -1488,7 +1488,7 @@ SiS_GetVBType(struct SiS_Private *SiS_Pr) /*********************************************/ #ifdef SIS_LINUX_KERNEL -static BOOLEAN +static bool SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { @@ -1496,10 +1496,10 @@ SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); unsigned short memorysize = ((modeflag & MemoryInfoFlag) >> MemorySizeShift) + 1; - if(!AdapterMemSize) return TRUE; + if(!AdapterMemSize) return true; - if(AdapterMemSize < memorysize) return FALSE; - return TRUE; + if(AdapterMemSize < memorysize) return false; + return true; } #endif @@ -1605,7 +1605,7 @@ SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo) /* HELPER: SearchModeID */ /*********************************************/ -BOOLEAN +bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, unsigned short *ModeIdIndex) { @@ -1617,7 +1617,7 @@ SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, for((*ModeIdIndex) = 0; ;(*ModeIdIndex)++) { if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == (*ModeNo)) break; - if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == 0xFF) return FALSE; + if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == 0xFF) return false; } if((*ModeNo) == 0x07) { @@ -1635,11 +1635,11 @@ SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, for((*ModeIdIndex) = 0; ;(*ModeIdIndex)++) { if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == (*ModeNo)) break; - if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == 0xFF) return FALSE; + if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == 0xFF) return false; } } - return TRUE; + return true; } /*********************************************/ @@ -1696,13 +1696,13 @@ SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide /* HELPER: LowModeTests */ /*********************************************/ -static BOOLEAN +static bool SiS_DoLowModeTest(struct SiS_Private *SiS_Pr, unsigned short ModeNo) { unsigned short temp, temp1, temp2; if((ModeNo != 0x03) && (ModeNo != 0x10) && (ModeNo != 0x12)) - return TRUE; + return true; temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x11); SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x11,0x80); temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00); @@ -1712,13 +1712,13 @@ SiS_DoLowModeTest(struct SiS_Private *SiS_Pr, unsigned short ModeNo) SiS_SetReg(SiS_Pr->SiS_P3d4,0x11,temp); if((SiS_Pr->ChipType >= SIS_315H) || (SiS_Pr->ChipType == SIS_300)) { - if(temp2 == 0x55) return FALSE; - else return TRUE; + if(temp2 == 0x55) return false; + else return true; } else { - if(temp2 != 0x55) return TRUE; + if(temp2 != 0x55) return true; else { SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); - return FALSE; + return false; } } } @@ -3237,14 +3237,14 @@ static void SiS_SetPitch(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) { SISPtr pSiS = SISPTR(pScrn); - BOOLEAN isslavemode = FALSE; + bool isslavemode = false; if( (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && ( ((pSiS->VGAEngine == SIS_300_VGA) && (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0xa0) == 0x20) || ((pSiS->VGAEngine == SIS_315_VGA) && (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x50) == 0x10) ) ) { - isslavemode = TRUE; + isslavemode = true; } /* 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) #ifdef SIS_XORG_XF86 /* We need pScrn for setting the pitch correctly */ -BOOLEAN -SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, BOOLEAN dosetpitch) +bool +SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, bool dosetpitch) #else -BOOLEAN +bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) #endif { @@ -3277,8 +3277,8 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) #ifdef SIS_LINUX_KERNEL unsigned short KeepLockReg; - SiS_Pr->UseCustomMode = FALSE; - SiS_Pr->CRT1UsesCustomMode = FALSE; + SiS_Pr->UseCustomMode = false; + SiS_Pr->CRT1UsesCustomMode = false; #endif SiS_Pr->SiS_flag_clearbuffer = 0; @@ -3317,7 +3317,7 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) SiS_UnLockCRT2(SiS_Pr); if(!SiS_Pr->UseCustomMode) { - if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE; + if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; } else { ModeIdIndex = 0; } @@ -3347,18 +3347,18 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) #ifdef SIS_LINUX_KERNEL /* Check memory size (kernel framebuffer driver only) */ if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) { - return FALSE; + return false; } #endif SiS_OpenCRTC(SiS_Pr); if(SiS_Pr->UseCustomMode) { - SiS_Pr->CRT1UsesCustomMode = TRUE; + SiS_Pr->CRT1UsesCustomMode = true; SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock; SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag; } else { - SiS_Pr->CRT1UsesCustomMode = FALSE; + SiS_Pr->CRT1UsesCustomMode = false; } /* Set mode on CRT1 */ @@ -3445,7 +3445,7 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00); #endif - return TRUE; + return true; } /*********************************************/ @@ -3454,14 +3454,14 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) /*********************************************/ #ifdef SIS_XORG_XF86 -BOOLEAN +bool SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, - DisplayModePtr mode, BOOLEAN IsCustom) + DisplayModePtr mode, bool IsCustom) { SISPtr pSiS = SISPTR(pScrn); unsigned short ModeNo = 0; - SiS_Pr->UseCustomMode = FALSE; + SiS_Pr->UseCustomMode = false; if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { @@ -3475,13 +3475,13 @@ SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, /* Don't need vbflags here; checks done earlier */ ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); - if(!ModeNo) return FALSE; + if(!ModeNo) return false; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo); } - return(SiSSetMode(SiS_Pr, pScrn, ModeNo, TRUE)); + return(SiSSetMode(SiS_Pr, pScrn, ModeNo, true)); } /*********************************************/ @@ -3489,9 +3489,9 @@ SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, /* for Dual-Head modes */ /*********************************************/ -BOOLEAN +bool SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, - DisplayModePtr mode, BOOLEAN IsCustom) + DisplayModePtr mode, bool IsCustom) { SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; SISPtr pSiS = SISPTR(pScrn); @@ -3502,7 +3502,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo = 0; unsigned char backupreg = 0; - SiS_Pr->UseCustomMode = FALSE; + SiS_Pr->UseCustomMode = false; /* Remember: Custom modes for CRT2 are ONLY supported * -) on the 30x/B/C, and @@ -3516,7 +3516,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, } else { ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); - if(!ModeNo) return FALSE; + if(!ModeNo) return false; } @@ -3550,10 +3550,10 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, if(pSiSEnt->CRT1ModeNo == -1) { xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting CRT2 mode delayed until after setting CRT1 mode\n"); - return TRUE; + return true; } #endif - pSiSEnt->CRT2ModeSet = TRUE; + pSiSEnt->CRT2ModeSet = true; } #endif @@ -3578,7 +3578,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, SiS_UnLockCRT2(SiS_Pr); if(!SiS_Pr->UseCustomMode) { - if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE; + if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; } else { ModeIdIndex = 0; } @@ -3658,7 +3658,7 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, SiS_Handle760(SiS_Pr); - return TRUE; + return true; } /*********************************************/ @@ -3666,9 +3666,9 @@ SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, /* for Dual-Head modes */ /*********************************************/ -BOOLEAN +bool SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, - DisplayModePtr mode, BOOLEAN IsCustom) + DisplayModePtr mode, bool IsCustom) { SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; SISPtr pSiS = SISPTR(pScrn); @@ -3677,10 +3677,10 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, #ifdef SISDUALHEAD SISEntPtr pSiSEnt = pSiS->entityPrivate; unsigned char backupcr30, backupcr31, backupcr38, backupcr35, backupp40d=0; - BOOLEAN backupcustom; + bool backupcustom; #endif - SiS_Pr->UseCustomMode = FALSE; + SiS_Pr->UseCustomMode = false; if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { @@ -3697,7 +3697,7 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, } else { ModeNo = SiS_GetModeNumber(pScrn, mode, 0); /* don't give VBFlags */ - if(!ModeNo) return FALSE; + if(!ModeNo) return false; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x on CRT1\n", ModeNo); @@ -3721,7 +3721,7 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, SiS_UnLockCRT2(SiS_Pr); if(!SiS_Pr->UseCustomMode) { - if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return FALSE; + if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; } else { ModeIdIndex = 0; } @@ -3771,11 +3771,11 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, #endif if(SiS_Pr->UseCustomMode) { - SiS_Pr->CRT1UsesCustomMode = TRUE; + SiS_Pr->CRT1UsesCustomMode = true; SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock; SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag; } else { - SiS_Pr->CRT1UsesCustomMode = FALSE; + SiS_Pr->CRT1UsesCustomMode = false; } /* Reset CRT2 if changing mode on CRT1 */ @@ -3838,7 +3838,7 @@ SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, /* Backup/Set ModeNo in BIOS scratch area */ SiS_GetSetModeID(pScrn,ModeNo); - return TRUE; + return true; } #endif /* Linux_XF86 */ @@ -4082,7 +4082,7 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, DisplayModePtr current #endif #ifdef SIS_LINUX_KERNEL - struct fb_var_screeninfo *var, BOOLEAN writeres + struct fb_var_screeninfo *var, bool writeres #endif ) { diff --git a/drivers/video/sis/init.h b/drivers/video/sis/init.h index 59d12844b4d..f40a680df86 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[] = 0x00}} }; -BOOLEAN SiSInitPtr(struct SiS_Private *SiS_Pr); +bool SiSInitPtr(struct SiS_Private *SiS_Pr); #ifdef SIS_XORG_XF86 unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, - int Depth, BOOLEAN FSTN, int LCDwith, int LCDheight); + int Depth, bool FSTN, int LCDwith, int LCDheight); #endif unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, - int VDisplay, int Depth, BOOLEAN FSTN, + int VDisplay, int Depth, bool FSTN, unsigned short CustomT, int LCDwith, int LCDheight, unsigned int VBFlags2); unsigned 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); void SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable); unsigned short SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); -BOOLEAN SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); +bool SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr); #ifndef SIS_LINUX_KERNEL void SiS_GetVBType(struct SiS_Private *SiS_Pr); #endif -BOOLEAN SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, +bool SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, unsigned short *ModeIdIndex); unsigned short SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); @@ -1581,17 +1581,17 @@ unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned shor #endif void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); #ifdef SIS_XORG_XF86 -BOOLEAN SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, - BOOLEAN dosetpitch); -BOOLEAN SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, - DisplayModePtr mode, BOOLEAN IsCustom); -BOOLEAN SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, - DisplayModePtr mode, BOOLEAN IsCustom); -BOOLEAN SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, - DisplayModePtr mode, BOOLEAN IsCustom); +bool SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, + bool dosetpitch); +bool SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, + DisplayModePtr mode, bool IsCustom); +bool SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, + DisplayModePtr mode, bool IsCustom); +bool SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, + DisplayModePtr mode, bool IsCustom); #endif #ifdef SIS_LINUX_KERNEL -BOOLEAN SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); +bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); #endif void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); void 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 #endif #ifdef SIS_LINUX_KERNEL void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, - int yres, struct fb_var_screeninfo *var, BOOLEAN writeres); + int yres, struct fb_var_screeninfo *var, bool writeres); #endif /* From init301.c: */ @@ -1615,7 +1615,7 @@ extern void SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); extern void SiS_UnLockCRT2(struct SiS_Private *SiS_Pr); extern void SiS_DisableBridge(struct SiS_Private *); -extern BOOLEAN SiS_SetCRT2Group(struct SiS_Private *, unsigned short); +extern bool SiS_SetCRT2Group(struct SiS_Private *, unsigned short); extern unsigned short SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); extern void SiS_WaitRetrace1(struct SiS_Private *SiS_Pr); @@ -1624,8 +1624,8 @@ extern unsigned short SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short extern unsigned short SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempax); extern unsigned short SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RRTI); -extern BOOLEAN SiS_IsVAMode(struct SiS_Private *); -extern BOOLEAN SiS_IsDualEdge(struct SiS_Private *); +extern bool SiS_IsVAMode(struct SiS_Private *); +extern bool SiS_IsDualEdge(struct SiS_Private *); #ifdef SIS_XORG_XF86 /* From other modules: */ diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c index 47e1896cffe..da33d801c22 100644 --- a/drivers/video/sis/init301.c +++ b/drivers/video/sis/init301.c @@ -200,7 +200,7 @@ GetLCDStructPtr661_2(struct SiS_Private *SiS_Pr) /* Adjust Rate for CRT2 */ /*********************************************/ -static BOOLEAN +static bool SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RRTI, unsigned short *i) { @@ -269,7 +269,7 @@ SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s /* Look backwards in table for matching CRT2 mode */ for(; SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID == modeid; (*i)--) { infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; - if(infoflag & checkmask) return TRUE; + if(infoflag & checkmask) return true; if((*i) == 0) break; } @@ -279,9 +279,9 @@ SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s for((*i) = 0; ; (*i)++) { if(SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID != modeid) break; infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; - if(infoflag & checkmask) return TRUE; + if(infoflag & checkmask) return true; } - return FALSE; + return false; } /*********************************************/ @@ -405,7 +405,7 @@ SiS_SaveCRT2Info(struct SiS_Private *SiS_Pr, unsigned short ModeNo) /*********************************************/ #ifdef SIS300 -static BOOLEAN +static bool SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; @@ -415,13 +415,13 @@ SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); temp1 = SISGETROMW(0x23b); - if(temp1 & temp) return TRUE; + if(temp1 & temp) return true; } } - return FALSE; + return false; } -static BOOLEAN +static bool SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr) { unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; @@ -431,10 +431,10 @@ SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr) if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); temp1 = SISGETROMW(0x23d); - if(temp1 & temp) return TRUE; + if(temp1 & temp) return true; } } - return FALSE; + return false; } #endif @@ -687,38 +687,38 @@ SiS_VBLongWait(struct SiS_Private *SiS_Pr) /*********************************************/ #ifdef SIS300 -static BOOLEAN +static bool SiS_Is301B(struct SiS_Private *SiS_Pr) { - if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return TRUE; - return FALSE; + if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return true; + return false; } #endif -static BOOLEAN +static bool SiS_CRT2IsLCD(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType == SIS_730) { - if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return TRUE; + if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return true; } - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return TRUE; - return FALSE; + if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return true; + return false; } -BOOLEAN +bool SiS_IsDualEdge(struct SiS_Private *SiS_Pr) { #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return TRUE; + if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; } } #endif - return FALSE; + return false; } -BOOLEAN +bool SiS_IsVAMode(struct SiS_Private *SiS_Pr) { #ifdef SIS315H @@ -726,70 +726,70 @@ SiS_IsVAMode(struct SiS_Private *SiS_Pr) if(SiS_Pr->ChipType >= SIS_315H) { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); - if((flag & EnableDualEdge) && (flag & SetToLCDA)) return TRUE; + if((flag & EnableDualEdge) && (flag & SetToLCDA)) return true; } #endif - return FALSE; + return false; } #ifdef SIS315H -static BOOLEAN +static bool SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) { - if(SiS_IsVAMode(SiS_Pr)) return TRUE; - if(SiS_CRT2IsLCD(SiS_Pr)) return TRUE; - return FALSE; + if(SiS_IsVAMode(SiS_Pr)) return true; + if(SiS_CRT2IsLCD(SiS_Pr)) return true; + return false; } #endif -static BOOLEAN +static bool SiS_IsDualLink(struct SiS_Private *SiS_Pr) { #ifdef SIS315H if(SiS_Pr->ChipType >= SIS_315H) { if((SiS_CRT2IsLCD(SiS_Pr)) || (SiS_IsVAMode(SiS_Pr))) { - if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return TRUE; + if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return true; } } #endif - return FALSE; + return false; } #ifdef SIS315H -static BOOLEAN +static bool SiS_TVEnabled(struct SiS_Private *SiS_Pr) { - if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return TRUE; + if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return true; if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { - if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return TRUE; + if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return true; } - return FALSE; + return false; } #endif #ifdef SIS315H -static BOOLEAN +static bool SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) { - if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return TRUE; - return FALSE; + if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return true; + return false; } #endif #ifdef SIS315H -static BOOLEAN +static bool SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) { if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) { - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return TRUE; + if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return true; } - return FALSE; + return false; } #endif #ifdef SIS315H -static BOOLEAN +static bool SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) { unsigned short flag; @@ -798,90 +798,90 @@ SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; /* Check for revision != A0 only */ if((flag == 0xe0) || (flag == 0xc0) || - (flag == 0xb0) || (flag == 0x90)) return FALSE; - } else if(SiS_Pr->ChipType >= SIS_661) return FALSE; - return TRUE; + (flag == 0xb0) || (flag == 0x90)) return false; + } else if(SiS_Pr->ChipType >= SIS_661) return false; + return true; } #endif #ifdef SIS315H -static BOOLEAN +static bool SiS_IsYPbPr(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType >= SIS_315H) { /* YPrPb = 0x08 */ - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return TRUE; + if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return true; } - return FALSE; + return false; } #endif #ifdef SIS315H -static BOOLEAN +static bool SiS_IsChScart(struct SiS_Private *SiS_Pr) { if(SiS_Pr->ChipType >= SIS_315H) { /* Scart = 0x04 */ - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return TRUE; + if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return true; } - return FALSE; + return false; } #endif #ifdef SIS315H -static BOOLEAN +static bool SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_Pr->ChipType >= SIS_315H) { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); - if(flag & SetCRT2ToTV) return TRUE; + if(flag & SetCRT2ToTV) return true; flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); - if(flag & EnableCHYPbPr) return TRUE; /* = YPrPb = 0x08 */ - if(flag & EnableCHScart) return TRUE; /* = Scart = 0x04 - TW */ + if(flag & EnableCHYPbPr) return true; /* = YPrPb = 0x08 */ + if(flag & EnableCHScart) return true; /* = Scart = 0x04 - TW */ } else { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); - if(flag & SetCRT2ToTV) return TRUE; + if(flag & SetCRT2ToTV) return true; } - return FALSE; + return false; } #endif #ifdef SIS315H -static BOOLEAN +static bool SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_Pr->ChipType >= SIS_315H) { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); - if(flag & SetCRT2ToLCD) return TRUE; + if(flag & SetCRT2ToLCD) return true; flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); - if(flag & SetToLCDA) return TRUE; + if(flag & SetToLCDA) return true; } else { flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); - if(flag & SetCRT2ToLCD) return TRUE; + if(flag & SetCRT2ToLCD) return true; } - return FALSE; + return false; } #endif -static BOOLEAN +static bool SiS_HaveBridge(struct SiS_Private *SiS_Pr) { unsigned short flag; if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { - return TRUE; + return true; } else if(SiS_Pr->SiS_VBType & VB_SISVB) { flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); - if((flag == 1) || (flag == 2)) return TRUE; + if((flag == 1) || (flag == 2)) return true; } - return FALSE; + return false; } -static BOOLEAN +static bool SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr) { unsigned short flag; @@ -890,23 +890,23 @@ SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr) flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); if(SiS_Pr->ChipType < SIS_315H) { flag &= 0xa0; - if((flag == 0x80) || (flag == 0x20)) return TRUE; + if((flag == 0x80) || (flag == 0x20)) return true; } else { flag &= 0x50; - if((flag == 0x40) || (flag == 0x10)) return TRUE; + if((flag == 0x40) || (flag == 0x10)) return true; } } - return FALSE; + return false; } -static BOOLEAN +static bool SiS_BridgeInSlavemode(struct SiS_Private *SiS_Pr) { unsigned short flag1; flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); - if(flag1 & (SetInSlaveMode >> 8)) return TRUE; - return FALSE; + if(flag1 & (SetInSlaveMode >> 8)) return true; + return false; } /*********************************************/ @@ -1461,11 +1461,11 @@ SiS_GetLCDInfoBIOS(struct SiS_Private *SiS_Pr) if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { - SiS_Pr->SiS_NeedRomModeData = TRUE; + SiS_Pr->SiS_NeedRomModeData = true; SiS_Pr->PanelHT = temp; } if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) { - SiS_Pr->SiS_NeedRomModeData = TRUE; + SiS_Pr->SiS_NeedRomModeData = true; SiS_Pr->PanelVT = temp; } SiS_Pr->PanelHRS = SISGETROMW(10); @@ -1516,7 +1516,7 @@ void SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) { unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; - BOOLEAN panelcanscale = FALSE; + bool panelcanscale = false; #ifdef SIS300 unsigned char *ROMAddr = SiS_Pr->Virtua |