diff options
author | Thomas Winischhofer <thomas@winischhofer.net> | 2004-06-21 00:38:20 +0000 |
---|---|---|
committer | Thomas Winischhofer <thomas@winischhofer.net> | 2004-06-21 00:38:20 +0000 |
commit | a8ea3115164f845246e9b3f935238499b1b62531 (patch) | |
tree | 3245591be998a1ce127a233db911fa5a61406ddb | |
parent | 870c22fd4254ee5623dbf82289d1e03edf609bb7 (diff) |
SiS driver: Fix LCD support for ECS 90x; Work-around broken BIOS reporting
wrong LCD size.
-rw-r--r-- | src/init301.c | 15 | ||||
-rw-r--r-- | src/sis.h | 2 | ||||
-rw-r--r-- | src/sis_dri.h | 2 | ||||
-rw-r--r-- | src/sis_driver.c | 3 | ||||
-rw-r--r-- | src/sis_vb.c | 34 |
5 files changed, 37 insertions, 19 deletions
diff --git a/src/init301.c b/src/init301.c index 0ebf272..2508eaa 100644 --- a/src/init301.c +++ b/src/init301.c @@ -1537,7 +1537,9 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, } temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); - if(!temp) return; + + /* For broken BIOSes: Assume 1024x768 */ + if(temp == 0) temp = 0x02; if((HwInfo->jChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2; @@ -1782,7 +1784,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, } #endif - if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { + if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { /* Always center screen on LVDS (if scaling is disabled) */ SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } else if(SiS_Pr->SiS_VBType & VB_SISVB) { @@ -1802,7 +1804,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, } } - if(SiS_Pr->SiS_VBType & VB_SISVB) { + if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { if(modeflag & NoSupportLCDScale) { /* No scaling for this mode on any panel */ @@ -1952,7 +1954,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, if(!((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) { - if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { + if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) { if(ModeNo == 0x12) { if(SiS_Pr->SiS_LCDInfo & LCDPass11) { @@ -5522,9 +5524,8 @@ SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, #endif } - /* is lvds if really LVDS, or SiS 301B-DH with external LVDS transmitter */ - if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || - ((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBType & VB_NoLCD))) { + /* is lvds if really LVDS, or 301B-DH with external LVDS transmitter */ + if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { islvds = TRUE; } @@ -40,7 +40,7 @@ #define SISDRIVERVERSIONYEAR 4 #define SISDRIVERVERSIONMONTH 6 -#define SISDRIVERVERSIONDAY 17 +#define SISDRIVERVERSIONDAY 20 #define SISDRIVERREVISION 1 #define SISDRIVERIVERSION (SISDRIVERVERSIONYEAR << 16) | \ diff --git a/src/sis_dri.h b/src/sis_dri.h index 39ace5e..ad0bef5 100644 --- a/src/sis_dri.h +++ b/src/sis_dri.h @@ -37,7 +37,7 @@ #include "xf86drm.h" -/* Hack: Since the types were changed, the typedefs +/* Hack: When the types were changed, the typedefs * went into drm.h. This file did not exist earlier. */ #ifndef _DRM_H_ diff --git a/src/sis_driver.c b/src/sis_driver.c index 46fcf0c..d1127c4 100644 --- a/src/sis_driver.c +++ b/src/sis_driver.c @@ -4126,7 +4126,8 @@ SISPreInit(ScrnInfoPtr pScrn, int flags) if((pSiS->VGAEngine != SIS_300_VGA) || (!(pSiS->VBFlags & VB_TRUMPION))) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTSCALE; - if(pSiS->VBFlags & (VB_301|VB_301B|VB_302B|VB_301C)) { + if((pSiS->VBFlags & (VB_301|VB_301B|VB_302B|VB_301C)) && + (!(pSiS->VBFlags & VB_30xBDH))) { pSiS->SiS_SD_Flags |= SiS_SD_SUPPORTCENTER; } } diff --git a/src/sis_vb.c b/src/sis_vb.c index 4134f71..5f90c03 100644 --- a/src/sis_vb.c +++ b/src/sis_vb.c @@ -364,15 +364,31 @@ void SISLCDPreInit(ScrnInfoPtr pScrn, Bool quiet) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Assuming LCD/plasma panel (848x480, expanding, RGB24)\n"); } else { - if((pSiS->VGAEngine == SIS_315_VGA) && (!CR36)) { - /* Old 650/301LV BIOS version "forgot" to set CR36, CR37 */ - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "BIOS-provided LCD information invalid, probing myself...\n"); - if(pSiS->VBFlags & VB_LVDS) pSiS->SiS_Pr->SiS_IF_DEF_LVDS = 1; - else pSiS->SiS_Pr->SiS_IF_DEF_LVDS = 0; - SiS_GetPanelID(pSiS->SiS_Pr, &pSiS->sishw_ext); - inSISIDXREG(SISCR, 0x36, CR36); - inSISIDXREG(SISCR, 0x37, CR37); + if(CR36 == 0) { + /* Old 650/301LV and ECS A907 BIOS versions "forget" to set CR36, CR37 */ + if(pSiS->VGAEngine == SIS_315_VGA) { + if(pSiS->sishw_ext.jChipType < SIS_661) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "BIOS provided invalid panel size, probing...\n"); + if(pSiS->VBFlags & VB_LVDS) pSiS->SiS_Pr->SiS_IF_DEF_LVDS = 1; + else pSiS->SiS_Pr->SiS_IF_DEF_LVDS = 0; + SiS_GetPanelID(pSiS->SiS_Pr, &pSiS->sishw_ext); + inSISIDXREG(SISCR, 0x36, CR36); + inSISIDXREG(SISCR, 0x37, CR37); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Broken BIOS, unable to determine panel size, disabling LCD\n"); + pSiS->VBFlags &= ~CRT2_LCD; + return; + } + } else if(pSiS->VGAEngine == SIS_300_VGA) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "BIOS provided invalid panel size, assuming 1024x768, RGB18\n"); + setSISIDXREG(SISCR,0x36,0xf0,0x02); + setSISIDXREG(SISCR,0x37,0xee,0x01); + CR36 = 0x02; + inSISIDXREG(SISCR,0x37,CR37); + } } if(((CR36 & 0x0f) == 0x0f) && (pSiS->SiS_Pr->CP_HaveCustomData)) { pSiS->VBLCDFlags |= VB_LCD_CUSTOM; |