Commit a39325d2 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: eliminate pVBInfo->RefIndex

Access XGI330_RefIndex directly and make it const.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b397992e
...@@ -73,7 +73,7 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr, ...@@ -73,7 +73,7 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr,
RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo, RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo,
ModeIdIndex, XGI_Pr); ModeIdIndex, XGI_Pr);
ClockIndex = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; ClockIndex = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
Clock = XGI_Pr->VCLKData[ClockIndex].CLOCK * 1000; Clock = XGI_Pr->VCLKData[ClockIndex].CLOCK * 1000;
...@@ -101,7 +101,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr, ...@@ -101,7 +101,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
return 0; return 0;
RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo, RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo,
ModeIdIndex, XGI_Pr); ModeIdIndex, XGI_Pr);
index = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
sr_data = XGI_Pr->XGINEWUB_CRT1Table[index].CR[5]; sr_data = XGI_Pr->XGINEWUB_CRT1Table[index].CR[5];
...@@ -111,7 +111,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr, ...@@ -111,7 +111,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
HT = (cr_data & 0xff) | ((unsigned short) (sr_data & 0x03) << 8); HT = (cr_data & 0xff) | ((unsigned short) (sr_data & 0x03) << 8);
A = HT + 5; A = HT + 5;
HDE = (XGI_Pr->RefIndex[RefreshRateTableIndex].XRes >> 3) - 1; HDE = (XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3) - 1;
E = HDE + 1; E = HDE + 1;
cr_data = XGI_Pr->XGINEWUB_CRT1Table[index].CR[3]; cr_data = XGI_Pr->XGINEWUB_CRT1Table[index].CR[3];
...@@ -162,7 +162,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr, ...@@ -162,7 +162,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
| ((unsigned short) (sr_data & 0x01) << 10); | ((unsigned short) (sr_data & 0x01) << 10);
A = VT + 2; A = VT + 2;
VDE = XGI_Pr->RefIndex[RefreshRateTableIndex].YRes - 1; VDE = XGI330_RefIndex[RefreshRateTableIndex].YRes - 1;
E = VDE + 1; E = VDE + 1;
cr_data = XGI_Pr->XGINEWUB_CRT1Table[index].CR[10]; cr_data = XGI_Pr->XGINEWUB_CRT1Table[index].CR[10];
...@@ -202,24 +202,24 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr, ...@@ -202,24 +202,24 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
*lower_margin = F; *lower_margin = F;
*vsync_len = C; *vsync_len = C;
if (XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x8000) if (XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x8000)
*sync &= ~FB_SYNC_VERT_HIGH_ACT; *sync &= ~FB_SYNC_VERT_HIGH_ACT;
else else
*sync |= FB_SYNC_VERT_HIGH_ACT; *sync |= FB_SYNC_VERT_HIGH_ACT;
if (XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x4000) if (XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x4000)
*sync &= ~FB_SYNC_HOR_HIGH_ACT; *sync &= ~FB_SYNC_HOR_HIGH_ACT;
else else
*sync |= FB_SYNC_HOR_HIGH_ACT; *sync |= FB_SYNC_HOR_HIGH_ACT;
*vmode = FB_VMODE_NONINTERLACED; *vmode = FB_VMODE_NONINTERLACED;
if (XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x0080) if (XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x0080)
*vmode = FB_VMODE_INTERLACED; *vmode = FB_VMODE_INTERLACED;
else { else {
j = 0; j = 0;
while (XGI330_EModeIDTable[j].Ext_ModeID != 0xff) { while (XGI330_EModeIDTable[j].Ext_ModeID != 0xff) {
if (XGI330_EModeIDTable[j].Ext_ModeID == if (XGI330_EModeIDTable[j].Ext_ModeID ==
XGI_Pr->RefIndex[RefreshRateTableIndex].ModeID) { XGI330_RefIndex[RefreshRateTableIndex].ModeID) {
if (XGI330_EModeIDTable[j].Ext_ModeFlag & if (XGI330_EModeIDTable[j].Ext_ModeFlag &
DoubleScanMode) { DoubleScanMode) {
*vmode = FB_VMODE_DOUBLE; *vmode = FB_VMODE_DOUBLE;
......
...@@ -260,5 +260,6 @@ ...@@ -260,5 +260,6 @@
#define XGI330_SR33 0 #define XGI330_SR33 0
extern const struct XGI_ExtStruct XGI330_EModeIDTable[]; extern const struct XGI_ExtStruct XGI330_EModeIDTable[];
extern const struct XGI_Ext2Struct XGI330_RefIndex[];
#endif #endif
...@@ -23,7 +23,6 @@ static const unsigned short XGINew_VGA_DAC[] = { ...@@ -23,7 +23,6 @@ static const unsigned short XGINew_VGA_DAC[] = {
void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo)
{ {
pVBInfo->RefIndex = XGI330_RefIndex;
pVBInfo->XGINEWUB_CRT1Table = XGI_CRT1Table; pVBInfo->XGINEWUB_CRT1Table = XGI_CRT1Table;
pVBInfo->MCLKData = XGI340New_MCLKData; pVBInfo->MCLKData = XGI340New_MCLKData;
...@@ -210,7 +209,7 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo, ...@@ -210,7 +209,7 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;
tempbx = pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].ModeID; tempbx = XGI330_RefIndex[RefreshRateTableIndex + (*i)].ModeID;
tempax = 0; tempax = 0;
if (pVBInfo->IF_DEF_LVDS == 0) { if (pVBInfo->IF_DEF_LVDS == 0) {
...@@ -275,9 +274,9 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo, ...@@ -275,9 +274,9 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
} }
} }
for (; pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].ModeID == for (; XGI330_RefIndex[RefreshRateTableIndex + (*i)].ModeID ==
tempbx; (*i)--) { tempbx; (*i)--) {
infoflag = pVBInfo->RefIndex[RefreshRateTableIndex + (*i)]. infoflag = XGI330_RefIndex[RefreshRateTableIndex + (*i)].
Ext_InfoFlag; Ext_InfoFlag;
if (infoflag & tempax) if (infoflag & tempax)
return 1; return 1;
...@@ -287,9 +286,9 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo, ...@@ -287,9 +286,9 @@ static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
} }
for ((*i) = 0;; (*i)++) { for ((*i) = 0;; (*i)++) {
infoflag = pVBInfo->RefIndex[RefreshRateTableIndex + (*i)]. infoflag = XGI330_RefIndex[RefreshRateTableIndex + (*i)].
Ext_InfoFlag; Ext_InfoFlag;
if (pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].ModeID if (XGI330_RefIndex[RefreshRateTableIndex + (*i)].ModeID
!= tempbx) { != tempbx) {
return 0; return 0;
} }
...@@ -306,7 +305,7 @@ static void XGI_SetSync(unsigned short RefreshRateTableIndex, ...@@ -306,7 +305,7 @@ static void XGI_SetSync(unsigned short RefreshRateTableIndex,
unsigned short sync, temp; unsigned short sync, temp;
/* di+0x00 */ /* di+0x00 */
sync = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag >> 8; sync = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag >> 8;
sync &= 0xC0; sync &= 0xC0;
temp = 0x2F; temp = 0x2F;
temp |= sync; temp |= sync;
...@@ -426,7 +425,7 @@ static void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -426,7 +425,7 @@ static void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short i; unsigned short i;
/* Get index */ /* Get index */
index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
index = index & IndexMask; index = index & IndexMask;
data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11); data = (unsigned char) xgifb_reg_get(pVBInfo->P3d4, 0x11);
...@@ -462,7 +461,7 @@ static void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -462,7 +461,7 @@ static void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned char index, Tempax, Tempbx, Tempcx, Tempdx; unsigned char index, Tempax, Tempbx, Tempcx, Tempdx;
unsigned short Temp1, Temp2, Temp3; unsigned short Temp1, Temp2, Temp3;
index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
/* Tempax: CR4 HRS */ /* Tempax: CR4 HRS */
Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[3]; Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[3];
Tempcx = Tempax; /* Tempcx: HRS */ Tempcx = Tempax; /* Tempcx: HRS */
...@@ -559,7 +558,7 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo, ...@@ -559,7 +558,7 @@ static void XGI_SetXG27CRTC(unsigned short ModeNo,
{ {
unsigned short index, Tempax, Tempbx, Tempcx; unsigned short index, Tempax, Tempbx, Tempcx;
index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
/* Tempax: CR4 HRS */ /* Tempax: CR4 HRS */
Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[3]; Tempax = pVBInfo->XGINEWUB_CRT1Table[index].CR[3];
Tempbx = Tempax; /* Tempbx: HRS[7:0] */ Tempbx = Tempax; /* Tempbx: HRS[7:0] */
...@@ -694,7 +693,7 @@ static void xgifb_set_lcd(int chip_id, ...@@ -694,7 +693,7 @@ static void xgifb_set_lcd(int chip_id,
xgifb_reg_and(pVBInfo->P3c4, 0x30, ~0x20); /* Hsync polarity */ xgifb_reg_and(pVBInfo->P3c4, 0x30, ~0x20); /* Hsync polarity */
xgifb_reg_and(pVBInfo->P3c4, 0x35, ~0x80); /* Vsync polarity */ xgifb_reg_and(pVBInfo->P3c4, 0x35, ~0x80); /* Vsync polarity */
Data = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag; Data = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
if (Data & 0x4000) if (Data & 0x4000)
/* Hsync polarity */ /* Hsync polarity */
xgifb_reg_or(pVBInfo->P3c4, 0x30, 0x20); xgifb_reg_or(pVBInfo->P3c4, 0x30, 0x20);
...@@ -717,10 +716,10 @@ static void XGI_UpdateXG21CRTC(unsigned short ModeNo, ...@@ -717,10 +716,10 @@ static void XGI_UpdateXG21CRTC(unsigned short ModeNo,
xgifb_reg_and(pVBInfo->P3d4, 0x11, 0x7F); /* Unlock CR0~7 */ xgifb_reg_and(pVBInfo->P3d4, 0x11, 0x7F); /* Unlock CR0~7 */
if (ModeNo == 0x2E && if (ModeNo == 0x2E &&
(pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC == (XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC ==
RES640x480x60)) RES640x480x60))
index = 12; index = 12;
else if (ModeNo == 0x2E && (pVBInfo->RefIndex[RefreshRateTableIndex]. else if (ModeNo == 0x2E && (XGI330_RefIndex[RefreshRateTableIndex].
Ext_CRT1CRTC == RES640x480x72)) Ext_CRT1CRTC == RES640x480x72))
index = 13; index = 13;
else if (ModeNo == 0x2F) else if (ModeNo == 0x2F)
...@@ -763,7 +762,7 @@ static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension, ...@@ -763,7 +762,7 @@ static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension,
if (modeflag & HalfDCLK) if (modeflag & HalfDCLK)
tempax = tempax << 1; tempax = tempax << 1;
temp = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag; temp = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
if (temp & InterlaceMode) if (temp & InterlaceMode)
tempbx = tempbx >> 1; tempbx = tempbx >> 1;
...@@ -819,7 +818,7 @@ static void XGI_SetCRT1Offset(unsigned short ModeNo, ...@@ -819,7 +818,7 @@ static void XGI_SetCRT1Offset(unsigned short ModeNo,
temp = temp >> 8; temp = temp >> 8;
temp = pVBInfo->ScreenOffset[temp]; temp = pVBInfo->ScreenOffset[temp];
temp2 = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag; temp2 = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
temp2 &= InterlaceMode; temp2 &= InterlaceMode;
if (temp2) if (temp2)
...@@ -870,7 +869,7 @@ static void XGI_SetCRT1Offset(unsigned short ModeNo, ...@@ -870,7 +869,7 @@ static void XGI_SetCRT1Offset(unsigned short ModeNo,
xgifb_reg_set(pVBInfo->P3d4, 0x13, temp); xgifb_reg_set(pVBInfo->P3d4, 0x13, temp);
/* SetDisplayUnit */ /* SetDisplayUnit */
temp2 = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag; temp2 = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
temp2 &= InterlaceMode; temp2 &= InterlaceMode;
if (temp2) if (temp2)
DisplayUnit >>= 1; DisplayUnit >>= 1;
...@@ -902,7 +901,7 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, ...@@ -902,7 +901,7 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
/* si+Ext_ResInfo */ /* si+Ext_ResInfo */
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;
CRT2Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; CRT2Index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
if (pVBInfo->IF_DEF_LVDS == 0) { if (pVBInfo->IF_DEF_LVDS == 0) {
CRT2Index = CRT2Index >> 6; /* for LCD */ CRT2Index = CRT2Index >> 6; /* for LCD */
...@@ -943,7 +942,7 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, ...@@ -943,7 +942,7 @@ static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
VCLKIndex = TVCLKBASE_315_25 + TVVCLK; VCLKIndex = TVCLKBASE_315_25 + TVVCLK;
} else { /* for CRT2 */ } else { /* for CRT2 */
/* di+Ext_CRTVCLK */ /* di+Ext_CRTVCLK */
VCLKIndex = pVBInfo->RefIndex[RefreshRateTableIndex]. VCLKIndex = XGI330_RefIndex[RefreshRateTableIndex].
Ext_CRTVCLK; Ext_CRTVCLK;
VCLKIndex &= IndexMask; VCLKIndex &= IndexMask;
} }
...@@ -967,7 +966,7 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo, ...@@ -967,7 +966,7 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo,
unsigned short vclkindex; unsigned short vclkindex;
if (pVBInfo->IF_DEF_LVDS == 1) { if (pVBInfo->IF_DEF_LVDS == 1) {
index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF; data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF;
xgifb_reg_set(pVBInfo->P3c4, 0x31, data); xgifb_reg_set(pVBInfo->P3c4, 0x31, data);
xgifb_reg_set(pVBInfo->P3c4, 0x2B, xgifb_reg_set(pVBInfo->P3c4, 0x2B,
...@@ -989,7 +988,7 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo, ...@@ -989,7 +988,7 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo,
xgifb_reg_set(pVBInfo->P3c4, 0x2C, data); xgifb_reg_set(pVBInfo->P3c4, 0x2C, data);
xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01); xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01);
} else { } else {
index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF; data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF;
xgifb_reg_set(pVBInfo->P3c4, 0x31, data); xgifb_reg_set(pVBInfo->P3c4, 0x31, data);
xgifb_reg_set(pVBInfo->P3c4, 0x2B, xgifb_reg_set(pVBInfo->P3c4, 0x2B,
...@@ -1060,7 +1059,7 @@ static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, ...@@ -1060,7 +1059,7 @@ static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension,
unsigned char index; unsigned char index;
index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
index &= IndexMask; index &= IndexMask;
VCLK = pVBInfo->VCLKData[index].CLOCK; VCLK = pVBInfo->VCLKData[index].CLOCK;
...@@ -1099,7 +1098,7 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, ...@@ -1099,7 +1098,7 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
xres; xres;
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
infoflag = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag; infoflag = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
if (xgifb_reg_get(pVBInfo->P3d4, 0x31) & 0x01) if (xgifb_reg_get(pVBInfo->P3d4, 0x31) & 0x01)
xgifb_reg_and_or(pVBInfo->P3c4, 0x1F, 0x3F, 0x00); xgifb_reg_and_or(pVBInfo->P3c4, 0x1F, 0x3F, 0x00);
...@@ -1350,7 +1349,7 @@ static struct SiS_TVData const *XGI_GetTVPtr(unsigned short ModeNo, ...@@ -1350,7 +1349,7 @@ static struct SiS_TVData const *XGI_GetTVPtr(unsigned short ModeNo,
unsigned short i, tempdx, tempal, modeflag; unsigned short i, tempdx, tempal, modeflag;
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
tempal = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; tempal = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
tempal = tempal & 0x3f; tempal = tempal & 0x3f;
tempdx = pVBInfo->TVInfo; tempdx = pVBInfo->TVInfo;
...@@ -1418,7 +1417,7 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -1418,7 +1417,7 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
struct XGI_LVDSCRT1HDataStruct const *LCDPtr = NULL; struct XGI_LVDSCRT1HDataStruct const *LCDPtr = NULL;
struct XGI_LVDSCRT1VDataStruct const *LCDPtr1 = NULL; struct XGI_LVDSCRT1VDataStruct const *LCDPtr1 = NULL;
index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
index = index & IndexMask; index = index & IndexMask;
if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) {
...@@ -1867,7 +1866,7 @@ static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex, ...@@ -1867,7 +1866,7 @@ static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
if ((pVBInfo->LCDInfo & EnableScalingLCD) && (modeflag & Charx8Dot)) if ((pVBInfo->LCDInfo & EnableScalingLCD) && (modeflag & Charx8Dot))
tempal = tempal ^ tempal; /* ; set to VCLK25MHz always */ tempal = tempal ^ tempal; /* ; set to VCLK25MHz always */
tempal = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; tempal = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
return tempal; return tempal;
} }
...@@ -2726,7 +2725,7 @@ static void XGI_GetRAMDAC2DATA(unsigned short ModeNo, ...@@ -2726,7 +2725,7 @@ static void XGI_GetRAMDAC2DATA(unsigned short ModeNo,
pVBInfo->RVBHCMAX = 1; pVBInfo->RVBHCMAX = 1;
pVBInfo->RVBHCFACT = 1; pVBInfo->RVBHCFACT = 1;
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; CRT1Index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
CRT1Index &= IndexMask; CRT1Index &= IndexMask;
temp1 = (unsigned short) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[0]; temp1 = (unsigned short) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[0];
temp2 = (unsigned short) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[5]; temp2 = (unsigned short) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[5];
...@@ -2988,7 +2987,7 @@ static unsigned short XGI_GetOffset(unsigned short ModeNo, ...@@ -2988,7 +2987,7 @@ static unsigned short XGI_GetOffset(unsigned short ModeNo,
ColorDepth[] = { 0x01, 0x02, 0x04 }; ColorDepth[] = { 0x01, 0x02, 0x04 };
modeinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeInfo; modeinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeInfo;
infoflag = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag; infoflag = XGI330_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
index = (modeinfo >> 8) & 0xFF; index = (modeinfo >> 8) & 0xFF;
...@@ -3048,7 +3047,7 @@ static void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -3048,7 +3047,7 @@ static void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
{ {
unsigned short tempcx = 0, CRT1Index = 0, resinfo = 0; unsigned short tempcx = 0, CRT1Index = 0, resinfo = 0;
CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; CRT1Index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
CRT1Index &= IndexMask; CRT1Index &= IndexMask;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;
...@@ -3071,7 +3070,7 @@ static void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -3071,7 +3070,7 @@ static void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short temp = 0, tempax = 0, tempbx = 0, tempcx = 0, unsigned short temp = 0, tempax = 0, tempbx = 0, tempcx = 0,
pushbx = 0, CRT1Index = 0, modeflag, resinfo = 0; pushbx = 0, CRT1Index = 0, modeflag, resinfo = 0;
CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; CRT1Index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
CRT1Index &= IndexMask; CRT1Index &= IndexMask;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
...@@ -3235,7 +3234,7 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -3235,7 +3234,7 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
/* si+Ext_ResInfo */ /* si+Ext_ResInfo */
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;
CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; CRT1Index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
CRT1Index &= IndexMask; CRT1Index &= IndexMask;
if (!(pVBInfo->VBInfo & SetInSlaveMode)) if (!(pVBInfo->VBInfo & SetInSlaveMode))
...@@ -3535,7 +3534,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -3535,7 +3534,7 @@ static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
/* si+Ext_ResInfo */ /* si+Ext_ResInfo */
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;
crt2crtc = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; crt2crtc = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
tempax = 0; tempax = 0;
...@@ -3974,7 +3973,7 @@ static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -3974,7 +3973,7 @@ static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
/* si+Ext_ResInfo */ /* si+Ext_ResInfo */
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag; modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO; resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;
CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; CRT1Index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
CRT1Index &= IndexMask; CRT1Index &= IndexMask;
if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) if (!(pVBInfo->VBInfo & SetCRT2ToLCD))
...@@ -5578,30 +5577,29 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, ...@@ -5578,30 +5577,29 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE,
} }
RefreshRateTableIndex = XGI330_EModeIDTable[ModeIdIndex].REFindex; RefreshRateTableIndex = XGI330_EModeIDTable[ModeIdIndex].REFindex;
ModeNo = pVBInfo->RefIndex[RefreshRateTableIndex].ModeID; ModeNo = XGI330_RefIndex[RefreshRateTableIndex].ModeID;
if (pXGIHWDE->jChipType >= XG20) { /* for XG20, XG21, XG27 */ if (pXGIHWDE->jChipType >= XG20) { /* for XG20, XG21, XG27 */
if ((pVBInfo->RefIndex[RefreshRateTableIndex].XRes == 800) && if ((XGI330_RefIndex[RefreshRateTableIndex].XRes == 800) &&
(pVBInfo->RefIndex[RefreshRateTableIndex].YRes == 600)) { (XGI330_RefIndex[RefreshRateTableIndex].YRes == 600)) {
index++; index++;
} }
/* do the similar adjustment like XGISearchCRT1Rate() */ /* do the similar adjustment like XGISearchCRT1Rate() */
if ((pVBInfo->RefIndex[RefreshRateTableIndex].XRes == 1024) && if ((XGI330_RefIndex[RefreshRateTableIndex].XRes == 1024) &&
(pVBInfo->RefIndex[RefreshRateTableIndex].YRes == 768)) { (XGI330_RefIndex[RefreshRateTableIndex].YRes == 768)) {
index++; index++;
} }
if ((pVBInfo->RefIndex[RefreshRateTableIndex].XRes == 1280) && if ((XGI330_RefIndex[RefreshRateTableIndex].XRes == 1280) &&
(pVBInfo->RefIndex[RefreshRateTableIndex].YRes == 1024)) { (XGI330_RefIndex[RefreshRateTableIndex].YRes == 1024)) {
index++; index++;
} }
} }
i = 0; i = 0;
do { do {
if (pVBInfo->RefIndex[RefreshRateTableIndex + i]. if (XGI330_RefIndex[RefreshRateTableIndex + i].
ModeID != ModeNo) ModeID != ModeNo)
break; break;
temp = pVBInfo->RefIndex[RefreshRateTableIndex + i]. temp = XGI330_RefIndex[RefreshRateTableIndex + i].Ext_InfoFlag;
Ext_InfoFlag;
temp &= ModeTypeMask; temp &= ModeTypeMask;
if (temp < pVBInfo->ModeType) if (temp < pVBInfo->ModeType)
break; break;
...@@ -5611,7 +5609,7 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, ...@@ -5611,7 +5609,7 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE,
} while (index != 0xFFFF); } while (index != 0xFFFF);
if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) { if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) {
if (pVBInfo->VBInfo & SetInSlaveMode) { if (pVBInfo->VBInfo & SetInSlaveMode) {
temp = pVBInfo->RefIndex[RefreshRateTableIndex + i - 1]. temp = XGI330_RefIndex[RefreshRateTableIndex + i - 1].
Ext_InfoFlag; Ext_InfoFlag;
if (temp & InterlaceMode) if (temp & InterlaceMode)
i++; i++;
......
...@@ -183,7 +183,6 @@ struct vb_device_info { ...@@ -183,7 +183,6 @@ struct vb_device_info {
struct XGI_TimingHStruct TimingH; struct XGI_TimingHStruct TimingH;
struct XGI_TimingVStruct TimingV; struct XGI_TimingVStruct TimingV;
struct XGI_Ext2Struct *RefIndex;
struct XGI_CRT1TableStruct *XGINEWUB_CRT1Table; struct XGI_CRT1TableStruct *XGINEWUB_CRT1Table;
struct SiS_VCLKData *VCLKData; struct SiS_VCLKData *VCLKData;
struct SiS_VBVCLKData *VBVCLKData; struct SiS_VBVCLKData *VBVCLKData;
......
...@@ -1969,7 +1969,7 @@ static const struct XGI330_LCDCapStruct XGI_LCDCapList[] = { ...@@ -1969,7 +1969,7 @@ static const struct XGI330_LCDCapStruct XGI_LCDCapList[] = {
0x30, 0x10, 0x5A, 0x10, 0x10, 0x0A, 0xC0, 0x28, 0x10} 0x30, 0x10, 0x5A, 0x10, 0x10, 0x0A, 0xC0, 0x28, 0x10}
}; };
static struct XGI_Ext2Struct XGI330_RefIndex[] = { const struct XGI_Ext2Struct XGI330_RefIndex[] = {
{Mode32Bpp + SupportAllCRT2 + SyncPN, RES320x200, VCLK25_175, {Mode32Bpp + SupportAllCRT2 + SyncPN, RES320x200, VCLK25_175,
0x00, 0x10, 0x59, 320, 200},/* 00 */ 0x00, 0x10, 0x59, 320, 200},/* 00 */
{Mode32Bpp + SupportAllCRT2 + SyncPN, RES320x200, VCLK25_175, {Mode32Bpp + SupportAllCRT2 + SyncPN, RES320x200, VCLK25_175,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment