diff options
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r-- | drivers/staging/xgifb/XGI_main_26.c | 45 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_def.h | 21 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_init.c | 5 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_setmode.c | 601 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_struct.h | 49 | ||||
-rw-r--r-- | drivers/staging/xgifb/vb_table.h | 194 |
6 files changed, 248 insertions, 667 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index 64ffd70..f775c54 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -6,6 +6,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include <linux/sizes.h> #include <linux/module.h> #ifdef CONFIG_MTRR @@ -329,6 +330,7 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex) { u16 xres, yres; struct xgi_hw_device_info *hw_info = &xgifb_info->hw_info; + unsigned long required_mem; if (xgifb_info->chip == XG21) { if (xgifb_info->display2 == XGIFB_DISP_LCD) { @@ -345,13 +347,13 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex) } } - return myindex; + goto check_memory; } /* FIXME: for now, all is valid on XG27 */ if (xgifb_info->chip == XG27) - return myindex; + goto check_memory; if (!(XGIbios_mode[myindex].chipset & MD_XGI315)) return -1; @@ -539,6 +541,12 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex) case XGIFB_DISP_NONE: break; } + +check_memory: + required_mem = XGIbios_mode[myindex].xres * XGIbios_mode[myindex].yres * + XGIbios_mode[myindex].bpp / 8; + if (required_mem > xgifb_info->video_size) + return -1; return myindex; } @@ -913,17 +921,10 @@ static void XGIfb_post_setmode(struct xgifb_video_info *xgifb_info) } if ((filter >= 0) && (filter <= 7)) { - pr_debug("FilterTable[%d]-%d: %02x %02x %02x %02x\n", + pr_debug("FilterTable[%d]-%d: %*ph\n", filter_tb, filter, - XGI_TV_filter[filter_tb]. - filter[filter][0], - XGI_TV_filter[filter_tb]. - filter[filter][1], - XGI_TV_filter[filter_tb]. - filter[filter][2], - XGI_TV_filter[filter_tb]. - filter[filter][3] - ); + 4, XGI_TV_filter[filter_tb]. + filter[filter]); xgifb_reg_set( XGIPART2, 0x35, @@ -1404,11 +1405,10 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var, if (var->yoffset < 0 || var->yoffset >= info->var.yres_virtual || var->xoffset) return -EINVAL; - } else { - if (var->xoffset + info->var.xres > info->var.xres_virtual + } else if (var->xoffset + info->var.xres > info->var.xres_virtual || var->yoffset + info->var.yres - > info->var.yres_virtual) - return -EINVAL; + > info->var.yres_virtual) { + return -EINVAL; } err = XGIfb_pan_var(var, info); if (err < 0) @@ -1471,6 +1471,9 @@ static int XGIfb_get_dram_size(struct xgifb_video_info *xgifb_info) xgifb_reg_set(XGISR, IND_SIS_DRAM_SIZE, 0x51); reg = xgifb_reg_get(XGISR, IND_SIS_DRAM_SIZE); + if (!reg) + return -1; + switch ((reg & XGI_DRAM_SIZE_MASK) >> 4) { case XGI_DRAM_SIZE_1MB: xgifb_info->video_size = 0x100000; @@ -1701,6 +1704,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, struct fb_info *fb_info; struct xgifb_video_info *xgifb_info; struct xgi_hw_device_info *hw_info; + unsigned long video_size_max; fb_info = framebuffer_alloc(sizeof(*xgifb_info), &pdev->dev); if (!fb_info) @@ -1721,6 +1725,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, xgifb_info->subsysvendor = pdev->subsystem_vendor; xgifb_info->subsysdevice = pdev->subsystem_device; + video_size_max = pci_resource_len(pdev, 0); xgifb_info->video_base = pci_resource_start(pdev, 0); xgifb_info->mmio_base = pci_resource_start(pdev, 1); xgifb_info->mmio_size = pci_resource_len(pdev, 1); @@ -1777,10 +1782,10 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, hw_info->jChipType = xgifb_info->chip; if (XGIfb_get_dram_size(xgifb_info)) { - dev_err(&pdev->dev, - "Fatal error: Unable to determine RAM size.\n"); - ret = -ENODEV; - goto error_disable; + xgifb_info->video_size = min_t(unsigned long, video_size_max, + SZ_16M); + } else if (xgifb_info->video_size > video_size_max) { + xgifb_info->video_size = video_size_max; } /* Enable PCI_LINEAR_ADDRESSING and MMIO_ENABLE */ diff --git a/drivers/staging/xgifb/vb_def.h b/drivers/staging/xgifb/vb_def.h index 69078d9..77137e4 100644 --- a/drivers/staging/xgifb/vb_def.h +++ b/drivers/staging/xgifb/vb_def.h @@ -3,9 +3,7 @@ #include "../../video/sis/initdef.h" #define VB_XGI301C 0x0020 /* for 301C */ -#define VB_YPbPr1080i 0x03 -#define LVDSCRT1Len 15 #define SupportCRT2in301C 0x0100 /* for 301C */ #define SetCHTVOverScan 0x8000 @@ -22,15 +20,6 @@ #define XGI_CRT2_PORT_00 (0x00 - 0x030) -/* ============================================================= - for 310 -============================================================== */ -#define ModeSoftSetting 0x04 - -/* ---------------- SetMode Stack */ -#define CRT1Len 15 -#define VCLKLen 4 - #define SupportAllCRT2 0x0078 #define NoSupportTV 0x0070 #define NoSupportHiVisionTV 0x0060 @@ -115,16 +104,6 @@ #define ActiveHiTV 0x08 #define ActiveYPbPr 0x10 -/* --------------------------------------------------------- */ -/* translated from asm code 301def.h */ -/* */ -/* --------------------------------------------------------- */ -#define LVDSCRT1Len_H 8 -#define LVDSCRT1Len_V 7 -#define LCDDesDataLen 6 -#define LVDSDesDataLen2 8 -#define LCDDesDataLen2 8 - #define NTSC1024x768HT 1908 #define YPbPrTV525iHT 1716 /* YPbPr */ diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c index 80dba6a..7739dbd 100644 --- a/drivers/staging/xgifb/vb_init.c +++ b/drivers/staging/xgifb/vb_init.c @@ -1269,7 +1269,7 @@ static unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo) if (temp <= 2) temp &= 0x03; else - temp = ((temp & 0x04) >> 1) || ((~temp) & 0x01); + temp = ((temp & 0x04) >> 1) | ((~temp) & 0x01); xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A); @@ -1299,8 +1299,6 @@ unsigned char XGIInitNew(struct pci_dev *pdev) outb(0x67, (pVBInfo->BaseAddr + 0x12)); /* 3c2 <- 67 ,ynlai */ - pVBInfo->ISXPDOS = 0; - pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14; pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24; pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10; @@ -1494,7 +1492,6 @@ unsigned char XGIInitNew(struct pci_dev *pdev) XGINew_SetModeScratch(HwDeviceExtension, pVBInfo); xgifb_reg_set(pVBInfo->P3d4, 0x8c, 0x87); - xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x31); return 1; } /* end of init */ diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index e81149f..e95a165 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -23,20 +23,18 @@ static const unsigned short XGINew_VGA_DAC[] = { void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) { - pVBInfo->StandTable = (struct SiS_StandTable_S *) &XGI330_StandTable; - pVBInfo->EModeIDTable = (struct XGI_ExtStruct *) XGI330_EModeIDTable; - pVBInfo->RefIndex = (struct XGI_Ext2Struct *) XGI330_RefIndex; - pVBInfo->XGINEWUB_CRT1Table - = (struct XGI_CRT1TableStruct *) XGI_CRT1Table; - - pVBInfo->MCLKData = (struct SiS_MCLKData *) XGI340New_MCLKData; - pVBInfo->ECLKData = (struct XGI_ECLKDataStruct *) XGI340_ECLKData; - pVBInfo->VCLKData = (struct SiS_VCLKData *) XGI_VCLKData; - pVBInfo->VBVCLKData = (struct SiS_VBVCLKData *) XGI_VBVCLKData; + pVBInfo->StandTable = &XGI330_StandTable; + pVBInfo->EModeIDTable = XGI330_EModeIDTable; + pVBInfo->RefIndex = XGI330_RefIndex; + pVBInfo->XGINEWUB_CRT1Table = XGI_CRT1Table; + + pVBInfo->MCLKData = XGI340New_MCLKData; + pVBInfo->ECLKData = XGI340_ECLKData; + pVBInfo->VCLKData = XGI_VCLKData; + pVBInfo->VBVCLKData = XGI_VBVCLKData; pVBInfo->ScreenOffset = XGI330_ScreenOffset; - pVBInfo->StResInfo = (struct SiS_StResInfo_S *) XGI330_StResInfo; - pVBInfo->ModeResInfo - = (struct SiS_ModeResInfo_S *) XGI330_ModeResInfo; + pVBInfo->StResInfo = XGI330_StResInfo; + pVBInfo->ModeResInfo = XGI330_ModeResInfo; pVBInfo->LCDResInfo = 0; pVBInfo->LCDTypeInfo = 0; @@ -56,24 +54,9 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) pVBInfo->SR21 = 0xa3; pVBInfo->SR22 = 0xfb; - pVBInfo->NTSCTiming = XGI330_NTSCTiming; - pVBInfo->PALTiming = XGI330_PALTiming; - pVBInfo->HiTVExtTiming = XGI330_HiTVExtTiming; - pVBInfo->HiTVSt1Timing = XGI330_HiTVSt1Timing; - pVBInfo->HiTVSt2Timing = XGI330_HiTVSt2Timing; - pVBInfo->HiTVTextTiming = XGI330_HiTVTextTiming; - pVBInfo->YPbPr750pTiming = XGI330_YPbPr750pTiming; - pVBInfo->YPbPr525pTiming = XGI330_YPbPr525pTiming; - pVBInfo->YPbPr525iTiming = XGI330_YPbPr525iTiming; - pVBInfo->HiTVGroup3Data = XGI330_HiTVGroup3Data; - pVBInfo->HiTVGroup3Simu = XGI330_HiTVGroup3Simu; - pVBInfo->HiTVGroup3Text = XGI330_HiTVGroup3Text; - pVBInfo->Ren525pGroup3 = XGI330_Ren525pGroup3; - pVBInfo->Ren750pGroup3 = XGI330_Ren750pGroup3; - - pVBInfo->TimingH = (struct XGI_TimingHStruct *) XGI_TimingH; - pVBInfo->TimingV = (struct XGI_TimingVStruct *) XGI_TimingV; - pVBInfo->UpdateCRT1 = (struct XGI_XG21CRT1Struct *) XGI_UpdateCRT1Table; + pVBInfo->TimingH = XGI_TimingH; + pVBInfo->TimingV = XGI_TimingV; + pVBInfo->UpdateCRT1 = XGI_UpdateCRT1Table; /* 310 customization related */ if ((pVBInfo->VBType & VB_SIS301LV) || (pVBInfo->VBType & VB_SIS302LV)) @@ -86,8 +69,7 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) if (ChipType == XG27) { unsigned char temp; - pVBInfo->MCLKData - = (struct SiS_MCLKData *) XGI27New_MCLKData; + pVBInfo->MCLKData = XGI27New_MCLKData; pVBInfo->CR40 = XGI27_cr41; pVBInfo->XGINew_CR97 = 0xc1; pVBInfo->SR15 = XG27_SR13; @@ -116,11 +98,9 @@ static void XGI_SetSeqRegs(unsigned short ModeNo, i = XGI_SetCRT2ToLCDA; if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { tempah |= 0x01; - } else { - if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) { - if (pVBInfo->VBInfo & SetInSlaveMode) - tempah |= 0x01; - } + } else if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) { + if (pVBInfo->VBInfo & SetInSlaveMode) + tempah |= 0x01; } tempah |= 0x20; /* screen off */ @@ -165,10 +145,9 @@ static void XGI_SetATTRegs(unsigned short ModeNo, if ((modeflag & Charx8Dot) && i == 0x13) { /* ifndef Dot9 */ if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { ARdata = 0; - } else { - if ((pVBInfo->VBInfo & + } else if ((pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) && - (pVBInfo->VBInfo & SetInSlaveMode)) + (pVBInfo->VBInfo & SetInSlaveMode)) { ARdata = 0; } } @@ -258,59 +237,45 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo, } if (pVBInfo->VBInfo & SetCRT2ToHiVision) { /* for HiTV */ - if ((pVBInfo->VBType & VB_SIS301LV) && - (pVBInfo->VBExtInfo == VB_YPbPr1080i)) { - tempax |= SupportYPbPr750p; - if ((pVBInfo->VBInfo & SetInSlaveMode) && - ((resinfo == 3) || - (resinfo == 4) || - (resinfo > 7))) + tempax |= SupportHiVision; + if ((pVBInfo->VBInfo & SetInSlaveMode) && + ((resinfo == 4) || + (resinfo == 3 && + (pVBInfo->SetFlag & TVSimuMode)) || + (resinfo > 7))) return 0; - } else { - tempax |= SupportHiVision; - if ((pVBInfo->VBInfo & SetInSlaveMode) && - ((resinfo == 4) || - (resinfo == 3 && - (pVBInfo->SetFlag & TVSimuMode)) || - (resinfo > 7))) - return 0; - } - } else { - if (pVBInfo->VBInfo & (SetCRT2ToAVIDEO | + } else if (pVBInfo->VBInfo & (SetCRT2ToAVIDEO | SetCRT2ToSVIDEO | SetCRT2ToSCART | SetCRT2ToYPbPr525750 | SetCRT2ToHiVision)) { - tempax |= SupportTV; - - if (pVBInfo->VBType & (VB_SIS301B | - VB_SIS302B | - VB_SIS301LV | - VB_SIS302LV | - VB_XGI301C)) - tempax |= SupportTV1024; - - if (!(pVBInfo->VBInfo & TVSetPAL) && - (modeflag & NoSupportSimuTV) && - (pVBInfo->VBInfo & SetInSlaveMode) && - (!(pVBInfo->VBInfo & SetNotSimuMode))) - return 0; - } + tempax |= SupportTV; + + if (pVBInfo->VBType & (VB_SIS301B | + VB_SIS302B | + VB_SIS301LV | + VB_SIS302LV | + VB_XGI301C)) + tempax |= SupportTV1024; + + if (!(pVBInfo->VBInfo & TVSetPAL) && + (modeflag & NoSupportSimuTV) && + (pVBInfo->VBInfo & SetInSlaveMode) && + (!(pVBInfo->VBInfo & SetNotSimuMode))) + return 0; } - } else { /* for LVDS */ - if (pVBInfo->VBInfo & SetCRT2ToLCD) { - tempax |= SupportLCD; + } else if (pVBInfo->VBInfo & SetCRT2ToLCD) { /* for LVDS */ + tempax |= SupportLCD; - if (resinfo > 0x08) - return 0; /* 1024x768 */ + if (resinfo > 0x08) + return 0; /* 1024x768 */ - if (pVBInfo->LCDResInfo < Panel_1024x768) { - if (resinfo > 0x07) - return 0; /* 800x600 */ + if (pVBInfo->LCDResInfo < Panel_1024x768) { + if (resinfo > 0x07) + return 0; /* 800x600 */ - if (resinfo == 0x04) - return 0; /* 512x384 */ - } + if (resinfo == 0x04) + return 0; /* 512x384 */ } } @@ -969,13 +934,8 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, } /* 301lv */ - if ((pVBInfo->VBType & VB_SIS301LV) && - !(pVBInfo->VBExtInfo == VB_YPbPr1080i)) { - if (pVBInfo->VBExtInfo == YPbPr750p) - VCLKIndex = XGI_YPbPr750pVCLK; - else if (pVBInfo->VBExtInfo == YPbPr525p) - VCLKIndex = YPbPr525pVCLK; - else if (pVBInfo->SetFlag & RPLLDIV2XO) + if (pVBInfo->VBType & VB_SIS301LV) { + if (pVBInfo->SetFlag & RPLLDIV2XO) VCLKIndex = YPbPr525iVCLK_2; else VCLKIndex = YPbPr525iVCLK; @@ -991,13 +951,11 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, Ext_CRTVCLK; VCLKIndex &= IndexMask; } - } else { /* LVDS */ - if ((pVBInfo->LCDResInfo == Panel_800x600) || - (pVBInfo->LCDResInfo == Panel_320x480)) - VCLKIndex = VCLK40; /* LVDSXlat1VCLK */ - else - VCLKIndex = VCLK65_315 + 2; /* LVDSXlat2VCLK, - LVDSXlat3VCLK */ + } else if ((pVBInfo->LCDResInfo == Panel_800x600) || + (pVBInfo->LCDResInfo == Panel_320x480)) { /* LVDS */ + VCLKIndex = VCLK40; /* LVDSXlat1VCLK */ + } else { + VCLKIndex = VCLK65_315 + 2; /* LVDSXlat2VCLK, LVDSXlat3VCLK */ } return VCLKIndex; @@ -1352,7 +1310,7 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - unsigned short i, tempdx, tempcx, tempbx, tempal, modeflag, table; + unsigned short i, tempdx, tempbx, tempal, modeflag, table; struct XGI330_LCDDataTablStruct *tempdi = NULL; @@ -1377,15 +1335,6 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, tempal = (tempal & 0x0f); } - tempcx = LCDLenList[tempbx]; - - if (pVBInfo->LCDInfo & EnableScalingLCD) { /* ScaleLCD */ - if ((tempbx == 5) || (tempbx) == 7) - tempcx = LCDDesDataLen2; - else if ((tempbx == 3) || (tempbx == 8)) - tempcx = LVDSDesDataLen2; - } - switch (tempbx) { case 0: case 1: @@ -1403,14 +1352,6 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, case 5: tempdi = XGI_LCDDesDataTable; break; - case 6: - tempdi = XGI_EPLCHLCDRegPtr; - break; - case 7: - case 8: - case 9: - tempdi = NULL; - break; default: break; } @@ -1764,62 +1705,20 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, default: break; } - } else if (table == 6) { - switch (tempdi[i].DATAPTR) { - case 0: - return &XGI_CH7017LV1024x768[tempal]; - break; - case 1: - return &XGI_CH7017LV1400x1050[tempal]; - break; - default: - break; - } } return NULL; } -static void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo, +static struct SiS_TVData const *XGI_GetTVPtr(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) { - unsigned short i, tempdx, tempbx, tempal, modeflag, table; - struct XGI330_TVDataTablStruct *tempdi = NULL; + unsigned short i, tempdx, tempal, modeflag; - tempbx = BX; modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; tempal = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; tempal = tempal & 0x3f; - table = tempbx; - - switch (tempbx) { - case 0: - tempdi = NULL; - break; - case 1: - tempdi = NULL; - break; - case 2: - case 6: - tempdi = xgifb_chrontel_tv; - break; - case 3: - tempdi = NULL; - break; - case 4: - tempdi = XGI_TVDataTable; - break; - case 5: - tempdi = NULL; - break; - default: - break; - } - - if (tempdi == NULL) /* OEMUtil */ - return NULL; - tempdx = pVBInfo->TVInfo; if (pVBInfo->VBInfo & SetInSlaveMode) @@ -1830,78 +1729,14 @@ static void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo, i = 0; - while (tempdi[i].MASK != 0xffff) { - if ((tempdx & tempdi[i].MASK) == tempdi[i].CAP) + while (XGI_TVDataTable[i].MASK != 0xffff) { + if ((tempdx & XGI_TVDataTable[i].MASK) == + XGI_TVDataTable[i].CAP) break; i++; } - if (table == 0x04) { - switch (tempdi[i].DATAPTR) { - case 0: - return &XGI_ExtPALData[tempal]; - break; - case 1: - return &XGI_ExtNTSCData[tempal]; - break; - case 2: - return &XGI_StPALData[tempal]; - break; - case 3: - return &XGI_StNTSCData[tempal]; - break; - case 4: - return &XGI_ExtHiTVData[tempal]; - break; - case 5: - return &XGI_St2HiTVData[tempal]; - break; - case 6: - return &XGI_ExtYPbPr525iData[tempal]; - break; - case 7: - return &XGI_ExtYPbPr525pData[tempal]; - break; - case 8: - return &XGI_ExtYPbPr750pData[tempal]; - break; - case 9: - return &XGI_StYPbPr525iData[tempal]; - break; - case 10: - return &XGI_StYPbPr525pData[tempal]; - break; - case 11: - return &XGI_StYPbPr750pData[tempal]; - break; - case 12: /* avoid system hang */ - return &XGI_ExtNTSCData[tempal]; - break; - case 13: - return &XGI_St1HiTVData[tempal]; - break; - default: - break; - } - } else if (table == 0x02) { - switch (tempdi[i].DATAPTR) { - case 0: - return &XGI_CHTVUNTSCData[tempal]; - break; - case 1: - return &XGI_CHTVONTSCData[tempal]; - break; - case 2: - return &XGI_CHTVUPALData[tempal]; - break; - case 3: - return &XGI_CHTVOPALData[tempal]; - break; - default: - break; - } - } - return NULL; + return &XGI_TVDataTable[i].DATAPTR[tempal]; } static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, @@ -1914,9 +1749,8 @@ static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, tempbx = 2; if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { - LCDPtr = (struct SiS_LVDSData *)XGI_GetLcdPtr(tempbx, - ModeNo, ModeIdIndex, RefreshRateTableIndex, - pVBInfo); + LCDPtr = XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, + RefreshRateTableIndex, pVBInfo); pVBInfo->VGAHT = LCDPtr->VGAHT; pVBInfo->VGAVT = LCDPtr->VGAVT; pVBInfo->HT = LCDPtr->LCDHT; @@ -1962,11 +1796,8 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, tempbx = 0; if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { - LCDPtr = (struct XGI_LVDSCRT1HDataStruct *) - XGI_GetLcdPtr(tempbx, ModeNo, - ModeIdIndex, - RefreshRateTableIndex, - pVBInfo); + LCDPtr = XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, + RefreshRateTableIndex, pVBInfo); for (i = 0; i < 8; i++) pVBInfo->TimingH[0].data[i] = LCDPtr[0].Reg[i]; @@ -1977,13 +1808,8 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, tempbx = 1; if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { - LCDPtr1 = (struct XGI_LVDSCRT1VDataStruct *) - XGI_GetLcdPtr( - tempbx, - ModeNo, - ModeIdIndex, - RefreshRateTableIndex, - pVBInfo); + LCDPtr1 = XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, + RefreshRateTableIndex, pVBInfo); for (i = 0; i < 7; i++) pVBInfo->TimingV[0].data[i] = LCDPtr1[0].Reg[i]; } @@ -2075,23 +1901,11 @@ static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex, modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; tempbx = 3; if (pVBInfo->LCDInfo & EnableScalingLCD) - LCDPtr1 = - (struct XGI330_LCDDataDesStruct2 *) - XGI_GetLcdPtr( - tempbx, - ModeNo, - ModeIdIndex, - RefreshRateTableIndex, - pVBInfo); + LCDPtr1 = XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, + RefreshRateTableIndex, pVBInfo); else - LCDPtr = - (struct XGI_LCDDesStruct *) - XGI_GetLcdPtr( - tempbx, - ModeNo, - ModeIdIndex, - RefreshRateTableIndex, - pVBInfo); + LCDPtr = XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, + RefreshRateTableIndex, pVBInfo); XGI_GetLCDSync(&tempax, &tempbx, pVBInfo); push1 = tempbx; @@ -2438,8 +2252,8 @@ static void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0, | VB_SIS301LV | VB_SIS302LV | VB_XGI301C)) { if ((!(pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) && (pVBInfo->SetFlag & ProgrammingCRT2)) { - *di_0 = (unsigned char) XGI_VBVCLKData[tempal].SR2B; - *di_1 = XGI_VBVCLKData[tempal].SR2C; + *di_0 = XGI_VBVCLKData[tempal].Part4_A; + *di_1 = XGI_VBVCLKData[tempal].Part4_B; } } else { *di_0 = XGI_VCLKData[tempal].SR2B; @@ -2634,21 +2448,16 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); - if (pVBInfo->IF_DEF_LCDA == 1) { - - if (((HwDeviceExtension->jChipType >= XG20) || - (HwDeviceExtension->jChipType >= XG40)) && - (pVBInfo->IF_DEF_LVDS == 0)) { - if (pVBInfo->VBType & - (VB_SIS302B | - VB_SIS301LV | - VB_SIS302LV | - VB_XGI301C)) { - if (temp & EnableDualEdge) { - tempbx |= SetCRT2ToDualEdge; - if (temp & SetToLCDA) - tempbx |= XGI_SetCRT2ToLCDA; - } + if (pVBInfo->IF_DEF_LVDS == 0) { + if (pVBInfo->VBType & + (VB_SIS302B | + VB_SIS301LV | + VB_SIS302LV | + VB_XGI301C)) { + if (temp & EnableDualEdge) { + tempbx |= SetCRT2ToDualEdge; + if (temp & SetToLCDA) + tempbx |= XGI_SetCRT2ToLCDA; } } } @@ -2687,11 +2496,10 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, temp = 0x09FC; else temp = 0x097C; + } else if (pVBInfo->IF_DEF_HiVision == 1) { + temp = 0x01FC; } else { - if (pVBInfo->IF_DEF_HiVision == 1) - temp = 0x01FC; - else - temp = 0x017C; + temp = 0x017C; } } else { /* 3nd party chip */ temp = SetCRT2ToLCD; @@ -2702,19 +2510,17 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, tempbx = 0; } - if (pVBInfo->IF_DEF_LCDA == 1) { /* Select Display Device */ - if (!(pVBInfo->VBType & VB_NoLCD)) { - if (tempbx & XGI_SetCRT2ToLCDA) { - if (tempbx & SetSimuScanMode) - tempbx &= (~(SetCRT2ToLCD | - SetCRT2ToRAMDAC | - SwitchCRT2)); - else - tempbx &= (~(SetCRT2ToLCD | - SetCRT2ToRAMDAC | - SetCRT2ToTV | - SwitchCRT2)); - } + if (!(pVBInfo->VBType & VB_NoLCD)) { + if (tempbx & XGI_SetCRT2ToLCDA) { + if (tempbx & SetSimuScanMode) + tempbx &= (~(SetCRT2ToLCD | + SetCRT2ToRAMDAC | + SwitchCRT2)); + else + tempbx &= (~(SetCRT2ToLCD | + SetCRT2ToRAMDAC | + SetCRT2ToTV | + SwitchCRT2)); } } @@ -2777,11 +2583,9 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, if (!(tempbx & DisableCRT2Display)) { if ((!(tempbx & DriverMode)) || (!(modeflag & CRT2Mode))) { - if (pVBInfo->IF_DEF_LCDA == 1) { - if (!(tempbx & XGI_SetCRT2ToLCDA)) - tempbx |= (SetInSlaveMode | - SetSimuScanMode); - } + if (!(tempbx & XGI_SetCRT2ToLCDA)) + tempbx |= (SetInSlaveMode | + SetSimuScanMode); } /* LCD+TV can't support in slave mode @@ -2867,19 +2671,17 @@ static void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, if (pVBInfo->VBInfo & SetCRT2ToHiVision) { if (pVBInfo->VBInfo & SetInSlaveMode) tempbx &= (~RPLLDIV2XO); - } else { - if (tempbx & - (TVSetYPbPr525p | TVSetYPbPr750p)) + } else if (tempbx & + (TVSetYPbPr525p | TVSetYPbPr750p)) { tempbx &= (~RPLLDIV2XO); - else if (!(pVBInfo->VBType & + } else if (!(pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV | VB_SIS302LV | VB_XGI301C))) { - if (tempbx & TVSimuMode) - tempbx &= (~RPLLDIV2XO); - } + if (tempbx & TVSimuMode) + tempbx &= (~RPLLDIV2XO); } } } @@ -2960,20 +2762,6 @@ static unsigned char XGI_GetLCDInfo(unsigned short ModeNo, tempbx |= SetLCDtoNonExpanding; } - if (pVBInfo->IF_DEF_ExpLink == 1) { - if (modeflag & HalfDCLK) { - if (!(tempbx & SetLCDtoNonExpanding)) { - tempbx |= XGI_EnableLVDSDDA; - } else { - if (pVBInfo->LCDResInfo == Panel_1024x768) { - if (resinfo == 4) {/* 512x384 */ - tempbx |= XGI_EnableLVDSDDA; - } - } - } - } - } - if (pVBInfo->VBInfo & SetInSlaveMode) { if (pVBInfo->VBInfo & SetNotSimuMode) tempbx |= XGI_LCDVESATiming; @@ -3122,33 +2910,6 @@ static void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, xgifb_reg_and_or(pVBInfo->P3d4, 0x48, ~tempbh, tempbl); } -/* --------------------------------------------------------------------- */ -/* Function : XGI_XG21SetPanelDelay */ -/* Input : */ -/* Output : */ -/* Description : */ -/* I/P : bl : 1 ; T1 : the duration between CPL on and signal on */ -/* : bl : 2 ; T2 : the duration signal on and Vdd on */ -/* : bl : 3 ; T3 : the duration between CPL off and signal off */ -/* : bl : 4 ; T4 : the duration signal off and Vdd off */ -/* --------------------------------------------------------------------- */ -static void XGI_XG21SetPanelDelay(struct xgifb_video_info *xgifb_info, - unsigned short tempbl, - struct vb_device_info *pVBInfo) -{ - if (tempbl == 1) - mdelay(xgifb_info->lvds_data.PSC_S1); - - if (tempbl == 2) - mdelay(xgifb_info->lvds_data.PSC_S2); - - if (tempbl == 3) - mdelay(xgifb_info->lvds_data.PSC_S3); - - if (tempbl == 4) - mdelay(xgifb_info->lvds_data.PSC_S4); -} - static void XGI_DisplayOn(struct xgifb_video_info *xgifb_info, struct xgi_hw_device_info *pXGIHWDE, struct vb_device_info *pVBInfo) @@ -3160,12 +2921,12 @@ static void XGI_DisplayOn(struct xgifb_video_info *xgifb_info, if (!(XGI_XG21GetPSCValue(pVBInfo) & 0x1)) { /* LVDS VDD on */ XGI_XG21BLSignalVDD(0x01, 0x01, pVBInfo); - XGI_XG21SetPanelDelay(xgifb_info, 2, pVBInfo); + mdelay(xgifb_info->lvds_data.PSC_S2); } if (!(XGI_XG21GetPSCValue(pVBInfo) & 0x20)) /* LVDS signal on */ XGI_XG21BLSignalVDD(0x20, 0x20, pVBInfo); - XGI_XG21SetPanelDelay(xgifb_info, 3, pVBInfo); + mdelay(xgifb_info->lvds_data.PSC_S3); /* LVDS backlight on */ XGI_XG21BLSignalVDD(0x02, 0x02, pVBInfo); } else { @@ -3180,12 +2941,12 @@ static void XGI_DisplayOn(struct xgifb_video_info *xgifb_info, if (!(XGI_XG27GetPSCValue(pVBInfo) & 0x1)) { /* LVDS VDD on */ XGI_XG27BLSignalVDD(0x01, 0x01, pVBInfo); - XGI_XG21SetPanelDelay(xgifb_info, 2, pVBInfo); + mdelay(xgifb_info->lvds_data.PSC_S2); } if (!(XGI_XG27GetPSCValue(pVBInfo) & 0x20)) /* LVDS signal on */ XGI_XG27BLSignalVDD(0x20, 0x20, pVBInfo); - XGI_XG21SetPanelDelay(xgifb_info, 3, pVBInfo); + mdelay(xgifb_info->lvds_data.PSC_S3); /* LVDS backlight on */ XGI_XG27BLSignalVDD(0x02, 0x02, pVBInfo); } else { @@ -3205,7 +2966,7 @@ void XGI_DisplayOff(struct xgifb_video_info *xgifb_info, if (pVBInfo->IF_DEF_LVDS == 1) { /* LVDS backlight off */ XGI_XG21BLSignalVDD(0x02, 0x00, pVBInfo); - XGI_XG21SetPanelDelay(xgifb_info, 3, pVBInfo); + mdelay(xgifb_info->lvds_data.PSC_S3); } else { /* DVO/DVI signal off */ XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); @@ -3216,7 +2977,7 @@ void XGI_DisplayOff(struct xgifb_video_info *xgifb_info, if ((XGI_XG27GetPSCValue(pVBInfo) & 0x2)) { /* LVDS backlight off */ XGI_XG27BLSignalVDD(0x02, 0x00, pVBInfo); - XGI_XG21SetPanelDelay(xgifb_info, 3, pVBInfo); + mdelay(xgifb_info->lvds_data.PSC_S3); } if (pVBInfo->IF_DEF_LVDS == 0) @@ -3378,7 +3139,6 @@ static void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short tempax = 0, tempbx, modeflag, resinfo; struct SiS_LCDData *LCDPtr = NULL; - struct SiS_TVData *TVPtr = NULL; /* si+Ext_ResInfo */ modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; @@ -3395,9 +3155,8 @@ static void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex, tempbx = 4; if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { - LCDPtr = (struct SiS_LCDData *) XGI_GetLcdPtr(tempbx, - ModeNo, ModeIdIndex, RefreshRateTableIndex, - pVBInfo); + LCDPtr = XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, + RefreshRateTableIndex, pVBInfo); pVBInfo->RVBHCMAX = LCDPtr->RVBHCMAX; pVBInfo->RVBHCFACT = LCDPtr->RVBHCFACT; @@ -3479,10 +3238,10 @@ static void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex, } if (pVBInfo->VBInfo & (SetCRT2ToTV)) { - tempbx = 4; - TVPtr = (struct SiS_TVData *) XGI_GetTVPtr(tempbx, - ModeNo, ModeIdIndex, RefreshRateTableIndex, - pVBInfo); + struct SiS_TVData const *TVPtr; + + TVPtr = XGI_GetTVPtr(ModeNo, ModeIdIndex, RefreshRateTableIndex, + pVBInfo); pVBInfo->RVBHCMAX = TVPtr->RVBHCMAX; pVBInfo->RVBHCFACT = TVPtr->RVBHCFACT; @@ -3882,16 +3641,9 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, | VB_SIS302LV | VB_XGI301C))) temp += 2; - if (pVBInfo->VBInfo & SetCRT2ToHiVision) { - if (pVBInfo->VBType & VB_SIS301LV) { - if (pVBInfo->VBExtInfo == VB_YPbPr1080i) { - if (resinfo == 7) - temp -= 2; - } - } else if (resinfo == 7) { + if ((pVBInfo->VBInfo & SetCRT2ToHiVision) && + !(pVBInfo->VBType & VB_SIS301LV) && (resinfo == 7)) temp -= 2; - } - } } /* 0x05 Horizontal Display Start */ @@ -4061,18 +3813,16 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, } else { tempbx -= 10; } - } else { - if (pVBInfo->TVInfo & TVSimuMode) { - if (pVBInfo->TVInfo & TVSetPAL) { - if (pVBInfo->VBType & VB_SIS301LV) { - if (!(pVBInfo->TVInfo & - (TVSetYPbPr525p | - TVSetYPbPr750p | - TVSetHiVision))) - tempbx += 40; - } else { + } else if (pVBInfo->TVInfo & TVSimuMode) { + if (pVBInfo->TVInfo & TVSetPAL) { + if (pVBInfo->VBType & VB_SIS301LV) { + if (!(pVBInfo->TVInfo & + (TVSetYPbPr525p | + TVSetYPbPr750p | + TVSetHiVision))) tempbx += 40; - } + } else { + tempbx += 40; } } } @@ -4154,7 +3904,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, { unsigned short i, j, tempax, tempbx, tempcx, temp, push1, push2, modeflag, resinfo, crt2crtc; - unsigned char *TimingPoint; + unsigned char const *TimingPoint; unsigned long longtemp, tempeax, tempebx, temp2, tempecx; @@ -4186,33 +3936,33 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, tempax = (tempax & 0xff00) >> 8; xgifb_reg_set(pVBInfo->Part2Port, 0x0, tempax); - TimingPoint = pVBInfo->NTSCTiming; + TimingPoint = XGI330_NTSCTiming; if (pVBInfo->TVInfo & TVSetPAL) - TimingPoint = pVBInfo->PALTiming; + TimingPoint = XGI330_PALTiming; if (pVBInfo->VBInfo & SetCRT2ToHiVision) { - TimingPoint = pVBInfo->HiTVExtTiming; + TimingPoint = XGI330_HiTVExtTiming; if (pVBInfo->VBInfo & SetInSlaveMode) - TimingPoint = pVBInfo->HiTVSt2Timing; + TimingPoint = XGI330_HiTVSt2Timing; if (pVBInfo->SetFlag & TVSimuMode) - TimingPoint = pVBInfo->HiTVSt1Timing; + TimingPoint = XGI330_HiTVSt1Timing; if (!(modeflag & Charx8Dot)) - TimingPoint = pVBInfo->HiTVTextTiming; + TimingPoint = XGI330_HiTVTextTiming; } if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { if (pVBInfo->TVInfo & TVSetYPbPr525i) - TimingPoint = pVBInfo->YPbPr525iTiming; + TimingPoint = XGI330_YPbPr525iTiming; if (pVBInfo->TVInfo & TVSetYPbPr525p) - TimingPoint = pVBInfo->YPbPr525pTiming; + TimingPoint = XGI330_YPbPr525pTiming; if (pVBInfo->TVInfo & TVSetYPbPr750p) - TimingPoint = pVBInfo->YPbPr750pTiming; + TimingPoint = XGI330_YPbPr750pTiming; } for (i = 0x01, j = 0; i <= 0x2D; i++, j++) @@ -4385,11 +4135,9 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, temp += 1; } } - } else { - if (pVBInfo->VBInfo & SetInSlaveMode) { - if (ModeNo == 0x2f) - temp += 1; - } + } else if (pVBInfo->VBInfo & SetInSlaveMode) { + if (ModeNo == 0x2f) + temp += 1; } } @@ -4644,8 +4392,8 @@ static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex, /* Customized LCDB Des no add */ tempbx = 5; - LCDBDesPtr = (struct XGI_LCDDesStruct *) XGI_GetLcdPtr(tempbx, ModeNo, - ModeIdIndex, RefreshRateTableIndex, pVBInfo); + LCDBDesPtr = XGI_GetLcdPtr(tempbx, ModeNo, ModeIdIndex, + RefreshRateTableIndex, pVBInfo); tempah = pVBInfo->LCDResInfo; tempah &= PanelResInfo; @@ -4876,7 +4624,7 @@ static void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) { unsigned short i; - unsigned char *tempdi; + unsigned char const *tempdi; unsigned short modeflag; /* si+Ext_ResInfo */ @@ -4905,18 +4653,18 @@ static void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex, if (pVBInfo->TVInfo & TVSetYPbPr525i) return; - tempdi = pVBInfo->HiTVGroup3Data; + tempdi = XGI330_HiTVGroup3Data; if (pVBInfo->SetFlag & TVSimuMode) { - tempdi = pVBInfo->HiTVGroup3Simu; + tempdi = XGI330_HiTVGroup3Simu; if (!(modeflag & Charx8Dot)) - tempdi = pVBInfo->HiTVGroup3Text; + tempdi = XGI330_HiTVGroup3Text; } if (pVBInfo->TVInfo & TVSetYPbPr525p) - tempdi = pVBInfo->Ren525pGroup3; + tempdi = XGI330_Ren525pGroup3; if (pVBInfo->TVInfo & TVSetYPbPr750p) - tempdi = pVBInfo->Ren750pGroup3; + tempdi = XGI330_Ren750pGroup3; for (i = 0; i <= 0x3E; i++) xgifb_reg_set(pVBInfo->Part3Port, i, tempdi[i]); @@ -5054,13 +4802,11 @@ static void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex, if (pVBInfo->VBInfo & SetCRT2ToLCD) { if (tempax > 800) tempax -= 800; - } else { - if (pVBInfo->VGAHDE > 800) { - if (pVBInfo->VGAHDE == 1024) - tempax = (tempax * 25 / 32) - 1; - else - tempax = (tempax * 20 / 32) - 1; - } + } else if (pVBInfo->VGAHDE > 800) { + if (pVBInfo->VGAHDE == 1024) + tempax = (tempax * 25 / 32) - 1; + else + tempax = (tempax * 20 / 32) - 1; } tempax -= 1; @@ -5101,9 +4847,7 @@ static void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex, } /* end 301b */ - if (pVBInfo->ISXPDOS == 0) - XGI_SetCRT2VCLK(ModeNo, ModeIdIndex, RefreshRateTableIndex, - pVBInfo); + XGI_SetCRT2VCLK(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); } static void XGINew_EnableCRT2(struct vb_device_info *pVBInfo) @@ -6414,12 +6158,10 @@ static void XGI_EnableBridge(struct xgifb_video_info *xgifb_info, if (pVBInfo->SetFlag & EnableChA) { /* Power on */ xgifb_reg_set(pVBInfo->Part1Port, 0x1E, 0x20); - } else { - if (pVBInfo->VBInfo & SetCRT2ToDualEdge) { - /* Power on */ - xgifb_reg_set(pVBInfo->Part1Port, - 0x1E, 0x20); - } + } else if (pVBInfo->VBInfo & SetCRT2ToDualEdge) { + /* Power on */ + xgifb_reg_set(pVBInfo->Part1Port, + 0x1E, 0x20); } } @@ -6607,7 +6349,6 @@ unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, struct vb_device_info *pVBInfo = &VBINF; pVBInfo->BaseAddr = xgifb_info->vga_base; pVBInfo->IF_DEF_LVDS = 0; - pVBInfo->IF_DEF_LCDA = 1; if (HwDeviceExtension->jChipType >= XG20) { pVBInfo->IF_DEF_YPbPr = 0; @@ -6678,16 +6419,14 @@ unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, XGI_SetLCDAGroup(ModeNo, ModeIdIndex, HwDeviceExtension, pVBInfo); } - } else { - if (!(pVBInfo->VBInfo & SwitchCRT2)) { - XGI_SetCRT1Group(xgifb_info, - HwDeviceExtension, ModeNo, - ModeIdIndex, pVBInfo); - if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { - XGI_SetLCDAGroup(ModeNo, ModeIdIndex, - HwDeviceExtension, - pVBInfo); - } + } else if (!(pVBInfo->VBInfo & SwitchCRT2)) { + XGI_SetCRT1Group(xgifb_info, + HwDeviceExtension, ModeNo, + ModeIdIndex, pVBInfo); + if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { + XGI_SetLCDAGroup(ModeNo, ModeIdIndex, + HwDeviceExtension, + pVBInfo); } } diff --git a/drivers/staging/xgifb/vb_struct.h b/drivers/staging/xgifb/vb_struct.h index 22c8eb9..70158c2 100644 --- a/drivers/staging/xgifb/vb_struct.h +++ b/drivers/staging/xgifb/vb_struct.h @@ -43,13 +43,6 @@ struct XGI_LCDDesStruct { unsigned short LCDVRS; }; -struct XGI_LCDDataTablStruct { - unsigned char PANELID; - unsigned short MASK; - unsigned short CAP; - unsigned short DATAPTR; -}; - struct XGI330_LCDDataDesStruct2 { unsigned short LCDHDES; unsigned short LCDHRS; @@ -59,19 +52,6 @@ struct XGI330_LCDDataDesStruct2 { unsigned short LCDVSync; }; - -struct XGI330_TVDataStruct { - unsigned short RVBHCMAX; - unsigned short RVBHCFACT; - unsigned short VGAHT; - unsigned short VGAVT; - unsigned short TVHDE; - unsigned short TVVDE; - unsigned short RVBHRS; - unsigned char FlickerMode; - unsigned short HALFRVBHRS; -}; - struct XGI330_LCDDataTablStruct { unsigned char PANELID; unsigned short MASK; @@ -82,7 +62,7 @@ struct XGI330_LCDDataTablStruct { struct XGI330_TVDataTablStruct { unsigned short MASK; unsigned short CAP; - unsigned short DATAPTR; + struct SiS_TVData const *DATAPTR; }; @@ -137,10 +117,10 @@ struct XGI21_LVDSCapStruct { unsigned short LVDSVSYNC; unsigned char VCLKData1; unsigned char VCLKData2; - unsigned char PSC_S1; - unsigned char PSC_S2; - unsigned char PSC_S3; - unsigned char PSC_S4; + unsigned char PSC_S1; /* Duration between CPL on and signal on */ + unsigned char PSC_S2; /* Duration signal on and Vdd on */ + unsigned char PSC_S3; /* Duration between CPL off and signal off */ + unsigned char PSC_S4; /* Duration signal off and Vdd off */ unsigned char PSC_S5; }; @@ -155,7 +135,6 @@ struct XGI301C_Tap4TimingStruct { }; struct vb_device_info { - unsigned char ISXPDOS; unsigned long P3c4, P3d4, P3c0, P3ce, P3c2, P3cc; unsigned long P3ca, P3c6, P3c7, P3c8, P3c9, P3da; unsigned long Part0Port, Part1Port, Part2Port; @@ -168,12 +147,10 @@ struct vb_device_info { unsigned short ModeType; unsigned short IF_DEF_LVDS, IF_DEF_TRUMPION, IF_DEF_DSTN; unsigned short IF_DEF_CRT2Monitor; - unsigned short IF_DEF_LCDA, IF_DEF_YPbPr; - unsigned short IF_DEF_ExpLink; + unsigned short IF_DEF_YPbPr; unsigned short IF_DEF_HiVision; unsigned short LCDResInfo, LCDTypeInfo, VBType;/*301b*/ unsigned short VBInfo, TVInfo, LCDInfo; - unsigned short VBExtInfo;/*301lv*/ unsigned short SetFlag; unsigned short NewFlickerMode; unsigned short SelectCRT2Rate; @@ -197,20 +174,6 @@ struct vb_device_info { struct SiS_MCLKData *MCLKData; struct XGI_ECLKDataStruct *ECLKData; - unsigned char *NTSCTiming; - unsigned char *PALTiming; - unsigned char *HiTVExtTiming; - unsigned char *HiTVSt1Timing; - unsigned char *HiTVSt2Timing; - unsigned char *HiTVTextTiming; - unsigned char *YPbPr750pTiming; - unsigned char *YPbPr525pTiming; - unsigned char *YPbPr525iTiming; - unsigned char *HiTVGroup3Data; - unsigned char *HiTVGroup3Simu; - unsigned char *HiTVGroup3Text; - unsigned char *Ren525pGroup3; - unsigned char *Ren750pGroup3; unsigned char *ScreenOffset; unsigned char *pXGINew_DRAMTypeDefinition; unsigned char XGINew_CR97; diff --git a/drivers/staging/xgifb/vb_table.h b/drivers/staging/xgifb/vb_table.h index 1c16846..180aae0 100644 --- a/drivers/staging/xgifb/vb_table.h +++ b/drivers/staging/xgifb/vb_table.h @@ -403,13 +403,6 @@ static struct XGI_CRT1TableStruct XGI_CRT1Table[] = { 0x03, 0xDE, 0xC0, 0x84, 0xBF, 0x04, 0x90} } /* 0x47 */ }; -static unsigned char XGI_CH7017LV1024x768[] = { - 0x60, 0x02, 0x00, 0x07, 0x40, 0xED, - 0xA3, 0xC8, 0xC7, 0xAC, 0xE0, 0x02}; -static unsigned char XGI_CH7017LV1400x1050[] = { - 0x60, 0x03, 0x11, 0x00, 0x40, 0xE3, - 0xAD, 0xDB, 0xF6, 0xAC, 0xE0, 0x02}; - /*add for new UNIVGABIOS*/ static struct SiS_LCDData XGI_StLCD1024x768Data[] = { {62, 25, 800, 546, 1344, 806}, @@ -525,18 +518,7 @@ static struct SiS_LCDData XGI_StLCD1600x1200Data[] = { {1, 1, 2160, 1250, 2160, 1250} /* 09 (1600x1200) */ }; -static struct SiS_LCDData XGI_CetLCD1400x1050Data[] = { - {1, 1, 1688, 1066, 1688, 1066}, /* 00 (320x200,320x400, - 640x200,640x400) */ - {1, 1, 1688, 1066, 1688, 1066}, /* 01 (320x350,640x350) */ - {1, 1, 1688, 1066, 1688, 1066}, /* 02 (360x400,720x400) */ - {1, 1, 1688, 1066, 1688, 1066}, /* 03 (720x350) */ - {1, 1, 1688, 1066, 1688, 1066}, /* 04 (640x480x60Hz) */ - {1, 1, 1688, 1066, 1688, 1066}, /* 05 (800x600x60Hz) */ - {1, 1, 1688, 1066, 1688, 1066}, /* 06 (1024x768x60Hz) */ - {1, 1, 1688, 1066, 1688, 1066}, /* 07 (1280x1024x60Hz) */ - {1, 1, 1688, 1066, 1688, 1066} /* 08 (1400x1050x60Hz) */ -}; +#define XGI_CetLCD1400x1050Data XGI_CetLCD1280x1024Data static struct SiS_LCDData XGI_NoScalingData[] = { {1, 1, 800, 449, 800, 449}, @@ -583,17 +565,7 @@ static struct SiS_LCDData xgifb_lcd_1280x1024x75[] = { {1, 1, 1688, 1066, 1688, 1066} /* ; 07 (1280x1024x75Hz) */ }; -static struct SiS_LCDData XGI_CetLCD1280x1024x75Data[] = { - {1, 1, 1688, 1066, 1688, 1066}, /* ; 00 (320x200,320x400, - 640x200,640x400) */ - {1, 1, 1688, 1066, 1688, 1066}, /* ; 01 (320x350,640x350) */ - {1, 1, 1688, 1066, 1688, 1066}, /* ; 02 (360x400,720x400) */ - {1, 1, 1688, 1066, 1688, 1066}, /* ; 03 (720x350) */ - {1, 1, 1688, 1066, 1688, 1066}, /* ; 04 (640x480x75Hz) */ - {1, 1, 1688, 1066, 1688, 1066}, /* ; 05 (800x600x75Hz) */ - {1, 1, 1688, 1066, 1688, 1066}, /* ; 06 (1024x768x75Hz) */ - {1, 1, 1688, 1066, 1688, 1066} /* ; 07 (1280x1024x75Hz) */ -}; +#define XGI_CetLCD1280x1024x75Data XGI_CetLCD1280x1024Data static struct SiS_LCDData XGI_NoScalingDatax75[] = { {1, 1, 800, 449, 800, 449}, /* ; 00 (320x200, 320x400, @@ -903,7 +875,7 @@ static struct XGI330_LCDDataDesStruct2 XGI_NoScalingDesDatax75[] = { {9, 1337, 0, 771, 112, 6} /* ; 0A (1280x768x60Hz) */ }; -static struct XGI330_TVDataStruct XGI_StPALData[] = { +static const struct SiS_TVData XGI_StPALData[] = { {1, 1, 864, 525, 1270, 400, 100, 0, 760}, {1, 1, 864, 525, 1270, 350, 100, 0, 760}, {1, 1, 864, 525, 1270, 400, 0, 0, 720}, @@ -912,7 +884,7 @@ static struct XGI330_TVDataStruct XGI_StPALData[] = { {1, 1, 864, 525, 1270, 600, 50, 0, 0} }; -static struct XGI330_TVDataStruct XGI_ExtPALData[] = { +static const struct SiS_TVData XGI_ExtPALData[] = { {2, 1, 1080, 463, 1270, 500, 50, 0, 50}, {15, 7, 1152, 413, 1270, 500, 50, 0, 50}, {2, 1, 1080, 463, 1270, 500, 50, 0, 50}, @@ -923,7 +895,7 @@ static struct XGI330_TVDataStruct XGI_ExtPALData[] = { {3, 2, 1080, 619, 1270, 540, 438, 0, 438} }; -static struct XGI330_TVDataStruct XGI_StNTSCData[] = { +static const struct SiS_TVData XGI_StNTSCData[] = { {1, 1, 858, 525, 1270, 400, 50, 0, 760}, {1, 1, 858, 525, 1270, 350, 50, 0, 640}, {1, 1, 858, 525, 1270, 400, 0, 0, 720}, @@ -931,7 +903,7 @@ static struct XGI330_TVDataStruct XGI_StNTSCData[] = { {1, 1, 858, 525, 1270, 480, 0, 0, 760} }; -static struct XGI330_TVDataStruct XGI_ExtNTSCData[] = { +static const struct SiS_TVData XGI_ExtNTSCData[] = { {9, 5, 1001, 453, 1270, 420, 171, 0, 171}, {12, 5, 858, 403, 1270, 420, 171, 0, 171}, {9, 5, 1001, 453, 1270, 420, 171, 0, 171}, @@ -943,7 +915,7 @@ static struct XGI330_TVDataStruct XGI_ExtNTSCData[] = { {3, 2, 1001, 533, 1270, 420, 0, 0, 0} }; -static struct XGI330_TVDataStruct XGI_St1HiTVData[] = { +static const struct SiS_TVData XGI_St1HiTVData[] = { {1, 1, 892, 563, 690, 800, 0, 0, 0}, /* 00 (320x200,320x400, 640x200,640x400) */ {1, 1, 892, 563, 690, 700, 0, 0, 0}, /* 01 (320x350,640x350) */ @@ -953,7 +925,7 @@ static struct XGI330_TVDataStruct XGI_St1HiTVData[] = { {8, 5, 1050, 683, 1648, 960, 0x150, 1, 0} /* 05 (400x300,800x600) */ }; -static struct XGI330_TVDataStruct XGI_St2HiTVData[] = { +static const struct SiS_TVData XGI_St2HiTVData[] = { {3, 1, 840, 483, 1648, 960, 0x032, 0, 0}, /* 00 (320x200,320x400, 640x200,640x400) */ {1, 1, 892, 563, 690, 700, 0, 0, 0}, /* 01 (320x350,640x350) */ @@ -963,7 +935,7 @@ static struct XGI330_TVDataStruct XGI_St2HiTVData[] = { {8, 5, 1050, 683, 1648, 960, 0x17C, 1, 0} /* 05 (400x300,800x600) */ }; -static struct XGI330_TVDataStruct XGI_ExtHiTVData[] = { +static const struct SiS_TVData XGI_ExtHiTVData[] = { {6, 1, 840, 563, 1632, 960, 0, 0, 0}, /* 00 (320x200,320x400, 640x200,640x400) */ {3, 1, 960, 563, 1632, 960, 0, 0, 0}, /* 01 (320x350,640x350) */ @@ -978,7 +950,7 @@ static struct XGI330_TVDataStruct XGI_ExtHiTVData[] = { {8, 5, 1750, 803, 1648, 960, 0x128, 0, 0} /* 0A (1280x720) */ }; -static struct XGI330_TVDataStruct XGI_ExtYPbPr525iData[] = { +static const struct SiS_TVData XGI_ExtYPbPr525iData[] = { { 9, 5, 1001, 453, 1270, 420, 171, 0, 171}, { 12, 5, 858, 403, 1270, 420, 171, 0, 171}, { 9, 5, 1001, 453, 1270, 420, 171, 0, 171}, @@ -990,7 +962,7 @@ static struct XGI330_TVDataStruct XGI_ExtYPbPr525iData[] = { { 3, 2, 1001, 533, 1250, 420, 0, 0, 0} }; -static struct XGI330_TVDataStruct XGI_StYPbPr525iData[] = { +static const struct SiS_TVData XGI_StYPbPr525iData[] = { {1, 1, 858, 525, 1270, 400, 50, 0, 760}, {1, 1, 858, 525, 1270, 350, 50, 0, 640}, {1, 1, 858, 525, 1270, 400, 0, 0, 720}, @@ -998,7 +970,7 @@ static struct XGI330_TVDataStruct XGI_StYPbPr525iData[] = { {1, 1, 858, 525, 1270, 480, 0, 0, 760}, }; -static struct XGI330_TVDataStruct XGI_ExtYPbPr525pData[] = { +static const struct SiS_TVData XGI_ExtYPbPr525pData[] = { { 9, 5, 1001, 453, 1270, 420, 171, 0, 171}, { 12, 5, 858, 403, 1270, 420, 171, 0, 171}, { 9, 5, 1001, 453, 1270, 420, 171, 0, 171}, @@ -1010,7 +982,7 @@ static struct XGI330_TVDataStruct XGI_ExtYPbPr525pData[] = { { 3, 2, 1001, 533, 1270, 420, 0, 0, 0} }; -static struct XGI330_TVDataStruct XGI_StYPbPr525pData[] = { +static const struct SiS_TVData XGI_StYPbPr525pData[] = { {1, 1, 1716, 525, 1270, 400, 50, 0, 760}, {1, 1, 1716, 525, 1270, 350, 50, 0, 640}, {1, 1, 1716, 525, 1270, 400, 0, 0, 720}, @@ -1018,7 +990,7 @@ static struct XGI330_TVDataStruct XGI_StYPbPr525pData[] = { {1, 1, 1716, 525, 1270, 480, 0, 0, 760}, }; -static struct XGI330_TVDataStruct XGI_ExtYPbPr750pData[] = { +static const struct SiS_TVData XGI_ExtYPbPr750pData[] = { { 3, 1, 935, 470, 1130, 680, 50, 0, 0}, /* 00 (320x200,320x400, 640x200,640x400) */ {24, 7, 935, 420, 1130, 680, 50, 0, 0}, /* 01 (320x350,640x350) */ @@ -1033,7 +1005,7 @@ static struct XGI330_TVDataStruct XGI_ExtYPbPr750pData[] = { {10, 9, 1320, 830, 1130, 640, 50, 0, 0} }; -static struct XGI330_TVDataStruct XGI_StYPbPr750pData[] = { +static const struct SiS_TVData XGI_StYPbPr750pData[] = { {1, 1, 1650, 750, 1280, 400, 50, 0, 760}, {1, 1, 1650, 750, 1280, 350, 50, 0, 640}, {1, 1, 1650, 750, 1280, 400, 0, 0, 720}, @@ -1041,7 +1013,7 @@ static struct XGI330_TVDataStruct XGI_StYPbPr750pData[] = { {1, 1, 1650, 750, 1280, 480, 0, 0, 760}, }; -static unsigned char XGI330_NTSCTiming[] = { +static const unsigned char XGI330_NTSCTiming[] = { 0x17, 0x1d, 0x03, 0x09, 0x05, 0x06, 0x0c, 0x0c, 0x94, 0x49, 0x01, 0x0a, 0x06, 0x0d, 0x04, 0x0a, 0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x1b, @@ -1052,7 +1024,7 @@ static unsigned char XGI330_NTSCTiming[] = { 0x00, 0x40, 0x44, 0x00, 0xdb, 0x02, 0x3b, 0x00 }; -static unsigned char XGI330_PALTiming[] = { +static const unsigned char XGI330_PALTiming[] = { 0x21, 0x5A, 0x35, 0x6e, 0x04, 0x38, 0x3d, 0x70, 0x94, 0x49, 0x01, 0x12, 0x06, 0x3e, 0x35, 0x6d, 0x06, 0x14, 0x3e, 0x35, 0x6d, 0x00, 0x45, 0x2b, @@ -1063,7 +1035,7 @@ static unsigned char XGI330_PALTiming[] = { 0x00, 0x40, 0x3e, 0x00, 0xe1, 0x02, 0x28, 0x00 }; -static unsigned char XGI330_HiTVExtTiming[] = { +static const unsigned char XGI330_HiTVExtTiming[] = { 0x2D, 0x60, 0x2C, 0x5F, 0x08, 0x31, 0x3A, 0x64, 0x28, 0x02, 0x01, 0x3D, 0x06, 0x3E, 0x35, 0x6D, 0x06, 0x14, 0x3E, 0x35, 0x6D, 0x00, 0xC5, 0x3F, @@ -1075,7 +1047,7 @@ static unsigned char XGI330_HiTVExtTiming[] = { 0x27, 0x00, 0xfc, 0xff, 0x6a, 0x00 }; -static unsigned char XGI330_HiTVSt1Timing[] = { +static const unsigned char XGI330_HiTVSt1Timing[] = { 0x32, 0x65, 0x2C, 0x5F, 0x08, 0x31, 0x3A, 0x65, 0x28, 0x02, 0x01, 0x3D, 0x06, 0x3E, 0x35, 0x6D, 0x06, 0x14, 0x3E, 0x35, 0x6D, 0x00, 0xC5, 0x3F, @@ -1087,7 +1059,7 @@ static unsigned char XGI330_HiTVSt1Timing[] = { 0x0E, 0x00, 0xfc, 0xff, 0x2d, 0x00 }; -static unsigned char XGI330_HiTVSt2Timing[] = { +static const unsigned char XGI330_HiTVSt2Timing[] = { 0x32, 0x65, 0x2C, 0x5F, 0x08, 0x31, 0x3A, 0x64, 0x28, 0x02, 0x01, 0x3D, 0x06, 0x3E, 0x35, 0x6D, 0x06, 0x14, 0x3E, 0x35, 0x6D, 0x00, 0xC5, 0x3F, @@ -1099,7 +1071,7 @@ static unsigned char XGI330_HiTVSt2Timing[] = { 0x27, 0x00, 0xFC, 0xff, 0x6a, 0x00 }; -static unsigned char XGI330_HiTVTextTiming[] = { +static const unsigned char XGI330_HiTVTextTiming[] = { 0x32, 0x65, 0x2C, 0x5F, 0x08, 0x31, 0x3A, 0x65, 0x28, 0x02, 0x01, 0x3D, 0x06, 0x3E, 0x35, 0x6D, 0x06, 0x14, 0x3E, 0x35, 0x6D, 0x00, 0xC5, 0x3F, @@ -1111,7 +1083,7 @@ static unsigned char XGI330_HiTVTextTiming[] = { 0x11, 0x00, 0xFC, 0xFF, 0x32, 0x00 }; -static unsigned char XGI330_YPbPr750pTiming[] = { +static const unsigned char XGI330_YPbPr750pTiming[] = { 0x30, 0x1d, 0xe8, 0x09, 0x09, 0xed, 0x0c, 0x0c, 0x98, 0x0a, 0x01, 0x0c, 0x06, 0x0d, 0x04, 0x0a, 0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f, @@ -1123,7 +1095,7 @@ static unsigned char XGI330_YPbPr750pTiming[] = { 0x11, 0x00, 0xfc, 0xff, 0x32, 0x00 }; -static unsigned char XGI330_YPbPr525pTiming[] = { +static const unsigned char XGI330_YPbPr525pTiming[] = { 0x3E, 0x11, 0x06, 0x09, 0x0b, 0x0c, 0x0c, 0x0c, 0x98, 0x0a, 0x01, 0x0d, 0x06, 0x0d, 0x04, 0x0a, 0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f, @@ -1135,7 +1107,7 @@ static unsigned char XGI330_YPbPr525pTiming[] = { 0x11, 0x00, 0xFC, 0xFF, 0x32, 0x00 }; -static unsigned char XGI330_YPbPr525iTiming[] = { +static const unsigned char XGI330_YPbPr525iTiming[] = { 0x1B, 0x21, 0x03, 0x09, 0x05, 0x06, 0x0C, 0x0C, 0x94, 0x49, 0x01, 0x0A, 0x06, 0x0D, 0x04, 0x0A, 0x06, 0x14, 0x0D, 0x04, 0x0A, 0x00, 0x85, 0x1B, @@ -1147,7 +1119,7 @@ static unsigned char XGI330_YPbPr525iTiming[] = { 0x44, 0x00, 0xDB, 0x02, 0x3B, 0x00 }; -static unsigned char XGI330_HiTVGroup3Data[] = { +static const unsigned char XGI330_HiTVGroup3Data[] = { 0x00, 0x1A, 0x22, 0x63, 0x62, 0x22, 0x08, 0x5F, 0x05, 0x21, 0xB2, 0xB2, 0x55, 0x77, 0x2A, 0xA6, 0x25, 0x2F, 0x47, 0xFA, 0xC8, 0xFF, 0x8E, 0x20, @@ -1158,7 +1130,7 @@ static unsigned char XGI330_HiTVGroup3Data[] = { 0x18, 0x05, 0x18, 0x05, 0x4C, 0xA8, 0x01 }; -static unsigned char XGI330_HiTVGroup3Simu[] = { +static const unsigned char XGI330_HiTVGroup3Simu[] = { 0x00, 0x1A, 0x22, 0x63, 0x62, 0x22, 0x08, 0x95, 0xDB, 0x20, 0xB8, 0xB8, 0x55, 0x47, 0x2A, 0xA6, 0x25, 0x2F, 0x47, 0xFA, 0xC8, 0xFF, 0x8E, 0x20, @@ -1169,7 +1141,7 @@ static unsigned char XGI330_HiTVGroup3Simu[] = { 0x18, 0x05, 0x18, 0x05, 0x4C, 0xA8, 0x01 }; -static unsigned char XGI330_HiTVGroup3Text[] = { +static const unsigned char XGI330_HiTVGroup3Text[] = { 0x00, 0x1A, 0x22, 0x63, 0x62, 0x22, 0x08, 0xA7, 0xF5, 0x20, 0xCE, 0xCE, 0x55, 0x47, 0x2A, 0xA6, 0x25, 0x2F, 0x47, 0xFA, 0xC8, 0xFF, 0x8E, 0x20, @@ -1180,7 +1152,7 @@ static unsigned char XGI330_HiTVGroup3Text[] = { 0x18, 0x05, 0x18, 0x05, 0x4C, 0xA8, 0x01 }; -static unsigned char XGI330_Ren525pGroup3[] = { +static const unsigned char XGI330_Ren525pGroup3[] = { 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x13, 0xB1, 0x41, 0x62, 0x62, 0xFF, 0xF4, 0x45, 0xa6, 0x25, 0x2F, 0x67, 0xF6, 0xbf, 0xFF, 0x8E, 0x20, @@ -1191,7 +1163,7 @@ static unsigned char XGI330_Ren525pGroup3[] = { 0x1a, 0x1F, 0x25, 0x2a, 0x4C, 0xAA, 0x01 }; -static unsigned char XGI330_Ren750pGroup3[] = { +static const unsigned char XGI330_Ren750pGroup3[] = { 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x7a, 0x54, 0x41, 0xE7, 0xE7, 0xFF, 0xF4, 0x45, 0xa6, 0x25, 0x2F, 0x67, 0xF6, 0xbf, 0xFF, 0x8E, 0x20, @@ -1236,17 +1208,7 @@ static struct SiS_LVDSData XGI_LVDS1280x1024Data_1[] = { {1688, 1066, 1688, 1066} }; -static struct SiS_LVDSData XGI_LVDS1280x1024Data_2[] = { - {1344, 806, 1344, 806}, - {1344, 806, 1344, 806}, - {1344, 806, 1344, 806}, - {1344, 806, 1344, 806}, - {1344, 806, 1344, 806}, - {1344, 806, 1344, 806}, - {1344, 806, 1344, 806}, - {800, 449, 1280, 801}, - {800, 525, 1280, 813} -}; +#define XGI_LVDS1280x1024Data_2 XGI_LVDS1024x768Data_2 static struct SiS_LVDSData XGI_LVDS1400x1050Data_1[] = { {928, 416, 1688, 1066}, @@ -1532,42 +1494,6 @@ static struct XGI330_LCDDataDesStruct2 XGI_LVDSNoScalingDesDatax75[] = { {0, 1328, 0, 771, 112, 6} /* ; 0A (1280x768x75Hz) */ }; -static struct SiS_LVDSData XGI_CHTVUNTSCData[] = { - { 840, 600, 840, 600}, - { 840, 600, 840, 600}, - { 840, 600, 840, 600}, - { 840, 600, 840, 600}, - { 784, 600, 784, 600}, - {1064, 750, 1064, 750} -}; - -static struct SiS_LVDSData XGI_CHTVONTSCData[] = { - { 840, 525, 840, 525}, - { 840, 525, 840, 525}, - { 840, 525, 840, 525}, - { 840, 525, 840, 525}, - { 784, 525, 784, 525}, - {1040, 700, 1040, 700} -}; - -static struct SiS_LVDSData XGI_CHTVUPALData[] = { - {1008, 625, 1008, 625}, - {1008, 625, 1008, 625}, - {1008, 625, 1008, 625}, - {1008, 625, 1008, 625}, - { 840, 750, 840, 750}, - { 936, 836, 936, 836} -}; - -static struct SiS_LVDSData XGI_CHTVOPALData[] = { - {1008, 625, 1008, 625}, - {1008, 625, 1008, 625}, - {1008, 625, 1008, 625}, - {1008, 625, 1008, 625}, - {840, 625, 840, 625}, - {960, 750, 960, 750} -}; - /* CR00,CR02,CR03,CR04,CR05,SR0B,SR0C,SR0E */ static struct XGI_LVDSCRT1HDataStruct XGI_LVDSCRT11024x768_1_H[] = { { {0x4B, 0x27, 0x8F, 0x32, 0x1B, 0x00, 0x45, 0x00} }, /* 00 (320x) */ @@ -1933,49 +1859,21 @@ static struct XGI330_LCDDataTablStruct XGI_EPLLCDDesDataPtr[] = { {0xFF, 0x0000, 0x0000, 0} }; -static struct XGI330_LCDDataTablStruct XGI_EPLCHLCDRegPtr[] = { - {Panel_1024x768, 0x0000, 0x0000, 0}, /* XGI_CH7017LV1024x768 */ - {Panel_1400x1050, 0x0000, 0x0000, 1}, /* XGI_CH7017LV1400x1050 */ - {0xFF, 0x0000, 0x0000, 0} -}; - -static struct XGI330_TVDataTablStruct XGI_TVDataTable[] = { - {0x09E1, 0x0001, 0}, /* XGI_ExtPALData */ - {0x09E1, 0x0000, 1}, /* XGI_ExtNTSCData */ - {0x09E1, 0x0801, 2}, /* XGI_StPALData */ - {0x09E1, 0x0800, 3}, /* XGI_StNTSCData */ - {0x49E0, 0x0100, 4}, /* XGI_ExtHiTVData */ - {0x49E0, 0x4100, 5}, /* XGI_St2HiTVData */ - {0x49E0, 0x4900, 13}, /* XGI_St1HiTVData */ - {0x09E0, 0x0020, 6}, /* XGI_ExtYPbPr525iData */ - {0x09E0, 0x0040, 7}, /* XGI_ExtYPbPr525pData */ - {0x09E0, 0x0080, 8}, /* XGI_ExtYPbPr750pData */ - {0x09E0, 0x0820, 9}, /* XGI_StYPbPr525iData */ - {0x09E0, 0x0840, 10}, /* XGI_StYPbPr525pData */ - {0x09E0, 0x0880, 11}, /* XGI_StYPbPr750pData */ - {0xffff, 0x0000, 12} /* END */ -}; - -/* Chrontel 7017 TV List */ -static struct XGI330_TVDataTablStruct xgifb_chrontel_tv[] = { - {0x0011, 0x0000, 0}, /* UNTSC */ - {0x0011, 0x0010, 1}, /* ONTSC */ - {0x0011, 0x0001, 2}, /* UPAL */ - {0x0011, 0x0011, 3}, /* OPAL */ - {0xFFFF, 0x0000, 4} -}; - -static unsigned short LCDLenList[] = { - LVDSCRT1Len_H, - LVDSCRT1Len_V, - LVDSDataLen, - LCDDesDataLen, - LCDDataLen, - LCDDesDataLen, - 0, - LCDDesDataLen, - LCDDesDataLen, - 0 +static const struct XGI330_TVDataTablStruct XGI_TVDataTable[] = { + {0x09E1, 0x0001, XGI_ExtPALData}, + {0x09E1, 0x0000, XGI_ExtNTSCData}, + {0x09E1, 0x0801, XGI_StPALData}, + {0x09E1, 0x0800, XGI_StNTSCData}, + {0x49E0, 0x0100, XGI_ExtHiTVData}, + {0x49E0, 0x4100, XGI_St2HiTVData}, + {0x49E0, 0x4900, XGI_St1HiTVData}, + {0x09E0, 0x0020, XGI_ExtYPbPr525iData}, + {0x09E0, 0x0040, XGI_ExtYPbPr525pData}, + {0x09E0, 0x0080, XGI_ExtYPbPr750pData}, + {0x09E0, 0x0820, XGI_StYPbPr525iData}, + {0x09E0, 0x0840, XGI_StYPbPr525pData}, + {0x09E0, 0x0880, XGI_StYPbPr750pData}, + {0xffff, 0x0000, XGI_ExtNTSCData}, }; /* Dual link only */ @@ -2336,7 +2234,7 @@ static struct SiS_VCLKData XGI_VCLKData[] = { {0xFF, 0x00, 0} /* End mark */ }; -static struct SiS_VCLKData XGI_VBVCLKData[] = { +static struct SiS_VBVCLKData XGI_VBVCLKData[] = { {0x1B, 0xE1, 25}, /* 00 (25.175MHz) */ {0x4E, 0xE4, 28}, /* 01 (28.322MHz) */ {0x57, 0xE4, 31}, /* 02 (31.500MHz) */ |