diff options
author | Richard Knutsson <ricknu-0@student.ltu.se> | 2007-02-12 03:55:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:42 -0500 |
commit | c30660ead2dd6ced47ac6ad4c099fb9305263ffb (patch) | |
tree | b85e8c6db87e0627924568ac6ad2b5d71965bcfb /drivers/video/sis/init301.c | |
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/init301.c')
-rw-r--r-- | drivers/video/sis/init301.c | 260 |
1 files changed, 130 insertions, 130 deletions
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 | ||
203 | static BOOLEAN | 203 | static bool |
204 | SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, | 204 | SiS_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 |
408 | static BOOLEAN | 408 | static bool |
409 | SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) | 409 | SiS_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 | ||
424 | static BOOLEAN | 424 | static bool |
425 | SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr) | 425 | SiS_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 |
690 | static BOOLEAN | 690 | static bool |
691 | SiS_Is301B(struct SiS_Private *SiS_Pr) | 691 | SiS_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 | ||
698 | static BOOLEAN | 698 | static bool |
699 | SiS_CRT2IsLCD(struct SiS_Private *SiS_Pr) | 699 | SiS_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 | ||
708 | BOOLEAN | 708 | bool |
709 | SiS_IsDualEdge(struct SiS_Private *SiS_Pr) | 709 | SiS_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 | ||
721 | BOOLEAN | 721 | bool |
722 | SiS_IsVAMode(struct SiS_Private *SiS_Pr) | 722 | SiS_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 |
736 | static BOOLEAN | 736 | static bool |
737 | SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) | 737 | SiS_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 | ||
745 | static BOOLEAN | 745 | static bool |
746 | SiS_IsDualLink(struct SiS_Private *SiS_Pr) | 746 | SiS_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 |
760 | static BOOLEAN | 760 | static bool |
761 | SiS_TVEnabled(struct SiS_Private *SiS_Pr) | 761 | SiS_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 |
772 | static BOOLEAN | 772 | static bool |
773 | SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) | 773 | SiS_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 |
781 | static BOOLEAN | 781 | static bool |
782 | SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) | 782 | SiS_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 |
792 | static BOOLEAN | 792 | static bool |
793 | SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) | 793 | SiS_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 |
808 | static BOOLEAN | 808 | static bool |
809 | SiS_IsYPbPr(struct SiS_Private *SiS_Pr) | 809 | SiS_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 |
820 | static BOOLEAN | 820 | static bool |
821 | SiS_IsChScart(struct SiS_Private *SiS_Pr) | 821 | SiS_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 |
832 | static BOOLEAN | 832 | static bool |
833 | SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) | 833 | SiS_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 |
852 | static BOOLEAN | 852 | static bool |
853 | SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) | 853 | SiS_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 | ||
870 | static BOOLEAN | 870 | static bool |
871 | SiS_HaveBridge(struct SiS_Private *SiS_Pr) | 871 | SiS_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 | ||
884 | static BOOLEAN | 884 | static bool |
885 | SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr) | 885 | SiS_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 | ||
902 | static BOOLEAN | 902 | static bool |
903 | SiS_BridgeInSlavemode(struct SiS_Private *SiS_Pr) | 903 | SiS_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 | |||
1516 | SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) | 1516 | SiS_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 | ||
6450 | static BOOLEAN | 6450 | static bool |
6451 | SiS_GetCRT2Part2Ptr(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex, | 6451 | SiS_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 | ||
7757 | static BOOLEAN | 7757 | static bool |
7758 | SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, | 7758 | SiS_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 | ||
7821 | static void | 7821 | static 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 | ||
8657 | BOOLEAN | 8657 | bool |
8658 | SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo) | 8658 | SiS_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 | ||
8911 | static BOOLEAN | 8911 | static bool |
8912 | SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr) | 8912 | SiS_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 | ||
8942 | static BOOLEAN | 8942 | static bool |
8943 | SiS_SetChReg(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val, unsigned short myor) | 8943 | SiS_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 |
9120 | unsigned short | 9120 | unsigned short |
9121 | SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, | 9121 | SiS_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); |