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

staging: xgifb: delete Win9xDOSMode

Delete another useless flag.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d2de85c5
...@@ -149,7 +149,6 @@ ...@@ -149,7 +149,6 @@
#define ProgrammingCRT2 0x0001 /* Set Flag */ #define ProgrammingCRT2 0x0001 /* Set Flag */
#define ReserveTVOption 0x0008 #define ReserveTVOption 0x0008
#define Win9xDOSMode 0x0020
#define GatingCRT 0x0800 #define GatingCRT 0x0800
#define DisableChB 0x1000 #define DisableChB 0x1000
#define EnableChB 0x2000 #define EnableChB 0x2000
......
...@@ -2612,284 +2612,282 @@ static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -2612,284 +2612,282 @@ static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
else else
modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
if (!(pVBInfo->SetFlag & Win9xDOSMode)) { if (pVBInfo->IF_DEF_OEMUtil == 1) {
if (pVBInfo->IF_DEF_OEMUtil == 1) { tempbx = 8;
tempbx = 8; LCDPtr = (struct XGI330_LCDDataDesStruct *)
LCDPtr = (struct XGI330_LCDDataDesStruct *) XGI_GetLcdPtr(tempbx,
XGI_GetLcdPtr(tempbx, ModeNo,
ModeNo, ModeIdIndex,
ModeIdIndex, RefreshRateTableIndex,
RefreshRateTableIndex, pVBInfo);
pVBInfo); }
}
if ((pVBInfo->IF_DEF_OEMUtil == 0) ||
if ((pVBInfo->IF_DEF_OEMUtil == 0) || (LCDPtr == NULL)) {
(LCDPtr == NULL)) { tempbx = 3;
tempbx = 3; if (pVBInfo->LCDInfo & EnableScalingLCD)
if (pVBInfo->LCDInfo & EnableScalingLCD) LCDPtr1 =
LCDPtr1 = (struct XGI330_LCDDataDesStruct2 *)
(struct XGI330_LCDDataDesStruct2 *) XGI_GetLcdPtr(
XGI_GetLcdPtr( tempbx,
tempbx, ModeNo,
ModeNo, ModeIdIndex,
ModeIdIndex, RefreshRateTableIndex,
RefreshRateTableIndex, pVBInfo);
pVBInfo); else
else LCDPtr =
LCDPtr = (struct XGI330_LCDDataDesStruct *)
(struct XGI330_LCDDataDesStruct *) XGI_GetLcdPtr(
XGI_GetLcdPtr(
tempbx, tempbx,
ModeNo, ModeNo,
ModeIdIndex, ModeIdIndex,
RefreshRateTableIndex, RefreshRateTableIndex,
pVBInfo); pVBInfo);
} }
XGI_GetLCDSync(&tempax, &tempbx, pVBInfo); XGI_GetLCDSync(&tempax, &tempbx, pVBInfo);
push1 = tempbx; push1 = tempbx;
push2 = tempax; push2 = tempax;
/* GetLCDResInfo */
if ((pVBInfo->LCDResInfo == Panel1024x768) ||
(pVBInfo->LCDResInfo == Panel1024x768x75)) {
tempax = 1024;
tempbx = 768;
} else if ((pVBInfo->LCDResInfo == Panel1280x1024) ||
(pVBInfo->LCDResInfo == Panel1280x1024x75)) {
tempax = 1280;
tempbx = 1024;
} else if (pVBInfo->LCDResInfo == Panel1400x1050) {
tempax = 1400;
tempbx = 1050;
} else {
tempax = 1600;
tempbx = 1200;
}
/* GetLCDResInfo */ if (pVBInfo->LCDInfo & SetLCDtoNonExpanding) {
if ((pVBInfo->LCDResInfo == Panel1024x768) || pVBInfo->HDE = tempax;
(pVBInfo->LCDResInfo == Panel1024x768x75)) { pVBInfo->VDE = tempbx;
tempax = 1024; pVBInfo->VGAHDE = tempax;
tempbx = 768; pVBInfo->VGAVDE = tempbx;
} else if ((pVBInfo->LCDResInfo == Panel1280x1024) || }
(pVBInfo->LCDResInfo == Panel1280x1024x75)) {
tempax = 1280;
tempbx = 1024;
} else if (pVBInfo->LCDResInfo == Panel1400x1050) {
tempax = 1400;
tempbx = 1050;
} else {
tempax = 1600;
tempbx = 1200;
}
if (pVBInfo->LCDInfo & SetLCDtoNonExpanding) { if ((pVBInfo->IF_DEF_ScaleLCD == 1) &&
pVBInfo->HDE = tempax; (pVBInfo->LCDInfo & EnableScalingLCD)) {
pVBInfo->VDE = tempbx; tempax = pVBInfo->HDE;
pVBInfo->VGAHDE = tempax; tempbx = pVBInfo->VDE;
pVBInfo->VGAVDE = tempbx; }
}
if ((pVBInfo->IF_DEF_ScaleLCD == 1) && tempax = pVBInfo->HT;
(pVBInfo->LCDInfo & EnableScalingLCD)) {
tempax = pVBInfo->HDE;
tempbx = pVBInfo->VDE;
}
tempax = pVBInfo->HT; if (pVBInfo->LCDInfo & EnableScalingLCD)
tempbx = LCDPtr1->LCDHDES;
else
tempbx = LCDPtr->LCDHDES;
if (pVBInfo->LCDInfo & EnableScalingLCD) tempcx = pVBInfo->HDE;
tempbx = LCDPtr1->LCDHDES; tempbx = tempbx & 0x0fff;
else tempcx += tempbx;
tempbx = LCDPtr->LCDHDES;
tempcx = pVBInfo->HDE; if (tempcx >= tempax)
tempbx = tempbx & 0x0fff; tempcx -= tempax;
tempcx += tempbx;
if (tempcx >= tempax) xgifb_reg_set(pVBInfo->Part1Port, 0x1A, tempbx & 0x07);
tempcx -= tempax;
xgifb_reg_set(pVBInfo->Part1Port, 0x1A, tempbx & 0x07); tempcx = tempcx >> 3;
tempbx = tempbx >> 3;
tempcx = tempcx >> 3; xgifb_reg_set(pVBInfo->Part1Port, 0x16,
tempbx = tempbx >> 3; (unsigned short) (tempbx & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x17,
(unsigned short) (tempcx & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x16, tempax = pVBInfo->HT;
(unsigned short) (tempbx & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x17,
(unsigned short) (tempcx & 0xff));
tempax = pVBInfo->HT; if (pVBInfo->LCDInfo & EnableScalingLCD)
tempbx = LCDPtr1->LCDHRS;
else
tempbx = LCDPtr->LCDHRS;
if (pVBInfo->LCDInfo & EnableScalingLCD) tempcx = push2;
tempbx = LCDPtr1->LCDHRS;
else
tempbx = LCDPtr->LCDHRS;
tempcx = push2; if (pVBInfo->LCDInfo & EnableScalingLCD)
tempcx = LCDPtr1->LCDHSync;
if (pVBInfo->LCDInfo & EnableScalingLCD) tempcx += tempbx;
tempcx = LCDPtr1->LCDHSync;
tempcx += tempbx; if (tempcx >= tempax)
tempcx -= tempax;
if (tempcx >= tempax) tempax = tempbx & 0x07;
tempcx -= tempax; tempax = tempax >> 5;
tempcx = tempcx >> 3;
tempbx = tempbx >> 3;
tempax = tempbx & 0x07; tempcx &= 0x1f;
tempax = tempax >> 5; tempax |= tempcx;
tempcx = tempcx >> 3;
tempbx = tempbx >> 3;
tempcx &= 0x1f; xgifb_reg_set(pVBInfo->Part1Port, 0x15, tempax);
tempax |= tempcx; xgifb_reg_set(pVBInfo->Part1Port, 0x14,
(unsigned short) (tempbx & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x15, tempax); tempax = pVBInfo->VT;
xgifb_reg_set(pVBInfo->Part1Port, 0x14, if (pVBInfo->LCDInfo & EnableScalingLCD)
(unsigned short) (tempbx & 0xff)); tempbx = LCDPtr1->LCDVDES;
else
tempbx = LCDPtr->LCDVDES;
tempcx = pVBInfo->VDE;
tempax = pVBInfo->VT; tempbx = tempbx & 0x0fff;
if (pVBInfo->LCDInfo & EnableScalingLCD) tempcx += tempbx;
tempbx = LCDPtr1->LCDVDES; if (tempcx >= tempax)
else tempcx -= tempax;
tempbx = LCDPtr->LCDVDES;
tempcx = pVBInfo->VDE;
tempbx = tempbx & 0x0fff; xgifb_reg_set(pVBInfo->Part1Port, 0x1b,
tempcx += tempbx; (unsigned short) (tempbx & 0xff));
if (tempcx >= tempax) xgifb_reg_set(pVBInfo->Part1Port, 0x1c,
tempcx -= tempax; (unsigned short) (tempcx & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x1b, tempbx = (tempbx >> 8) & 0x07;
(unsigned short) (tempbx & 0xff)); tempcx = (tempcx >> 8) & 0x07;
xgifb_reg_set(pVBInfo->Part1Port, 0x1c,
(unsigned short) (tempcx & 0xff));
tempbx = (tempbx >> 8) & 0x07; xgifb_reg_set(pVBInfo->Part1Port, 0x1d,
tempcx = (tempcx >> 8) & 0x07; (unsigned short) ((tempcx << 3)
| tempbx));
xgifb_reg_set(pVBInfo->Part1Port, 0x1d, tempax = pVBInfo->VT;
(unsigned short) ((tempcx << 3) if (pVBInfo->LCDInfo & EnableScalingLCD)
| tempbx)); tempbx = LCDPtr1->LCDVRS;
else
tempbx = LCDPtr->LCDVRS;
tempax = pVBInfo->VT; /* tempbx = tempbx >> 4; */
if (pVBInfo->LCDInfo & EnableScalingLCD) tempcx = push1;
tempbx = LCDPtr1->LCDVRS;
else
tempbx = LCDPtr->LCDVRS;
/* tempbx = tempbx >> 4; */ if (pVBInfo->LCDInfo & EnableScalingLCD)
tempcx = push1; tempcx = LCDPtr1->LCDVSync;
if (pVBInfo->LCDInfo & EnableScalingLCD) tempcx += tempbx;
tempcx = LCDPtr1->LCDVSync; if (tempcx >= tempax)
tempcx -= tempax;
tempcx += tempbx; xgifb_reg_set(pVBInfo->Part1Port, 0x18,
if (tempcx >= tempax) (unsigned short) (tempbx & 0xff));
tempcx -= tempax; xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f,
(unsigned short) (tempcx & 0x0f));
xgifb_reg_set(pVBInfo->Part1Port, 0x18, tempax = ((tempbx >> 8) & 0x07) << 3;
(unsigned short) (tempbx & 0xff));
xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f,
(unsigned short) (tempcx & 0x0f));
tempax = ((tempbx >> 8) & 0x07) << 3; tempbx = pVBInfo->VGAVDE;
if (tempbx != pVBInfo->VDE)
tempax |= 0x40;
tempbx = pVBInfo->VGAVDE; if (pVBInfo->LCDInfo & EnableLVDSDDA)
if (tempbx != pVBInfo->VDE) tempax |= 0x40;
tempax |= 0x40;
if (pVBInfo->LCDInfo & EnableLVDSDDA) xgifb_reg_and_or(pVBInfo->Part1Port, 0x1a, 0x07,
tempax |= 0x40; tempax);
xgifb_reg_and_or(pVBInfo->Part1Port, 0x1a, 0x07, tempcx = pVBInfo->VGAVT;
tempax); tempbx = pVBInfo->VDE;
tempax = pVBInfo->VGAVDE;
tempcx -= tempax;
tempcx = pVBInfo->VGAVT; temp = tempax; /* 0430 ylshieh */
tempbx = pVBInfo->VDE; temp1 = (temp << 18) / tempbx;
tempax = pVBInfo->VGAVDE;
tempcx -= tempax; tempdx = (unsigned short) ((temp << 18) % tempbx);
temp = tempax; /* 0430 ylshieh */ if (tempdx != 0)
temp1 = (temp << 18) / tempbx; temp1 += 1;
tempdx = (unsigned short) ((temp << 18) % tempbx); temp2 = temp1;
push3 = temp2;
if (tempdx != 0) xgifb_reg_set(pVBInfo->Part1Port, 0x37,
temp1 += 1; (unsigned short) (temp2 & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x36,
(unsigned short) ((temp2 >> 8) & 0xff));
temp2 = temp1; tempbx = (unsigned short) (temp2 >> 16);
push3 = temp2; tempax = tempbx & 0x03;
tempbx = pVBInfo->VGAVDE;
if (tempbx == pVBInfo->VDE)
tempax |= 0x04;
xgifb_reg_set(pVBInfo->Part1Port, 0x37, xgifb_reg_set(pVBInfo->Part1Port, 0x35, tempax);
(unsigned short) (temp2 & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x36,
(unsigned short) ((temp2 >> 8) & 0xff));
if (pVBInfo->VBType & VB_XGI301C) {
temp2 = push3;
xgifb_reg_set(pVBInfo->Part4Port,
0x3c,
(unsigned short) (temp2 & 0xff));
xgifb_reg_set(pVBInfo->Part4Port,
0x3b,
(unsigned short) ((temp2 >> 8) &
0xff));
tempbx = (unsigned short) (temp2 >> 16); tempbx = (unsigned short) (temp2 >> 16);
tempax = tempbx & 0x03; xgifb_reg_and_or(pVBInfo->Part4Port, 0x3a,
~0xc0,
tempbx = pVBInfo->VGAVDE; (unsigned short) ((tempbx &
if (tempbx == pVBInfo->VDE) 0xff) << 6));
tempax |= 0x04;
tempcx = pVBInfo->VGAVDE;
xgifb_reg_set(pVBInfo->Part1Port, 0x35, tempax); if (tempcx == pVBInfo->VDE)
xgifb_reg_and_or(pVBInfo->Part4Port,
if (pVBInfo->VBType & VB_XGI301C) { 0x30, ~0x0c, 0x00);
temp2 = push3; else
xgifb_reg_set(pVBInfo->Part4Port, xgifb_reg_and_or(pVBInfo->Part4Port,
0x3c, 0x30, ~0x0c, 0x08);
(unsigned short) (temp2 & 0xff)); }
xgifb_reg_set(pVBInfo->Part4Port,
0x3b,
(unsigned short) ((temp2 >> 8) &
0xff));
tempbx = (unsigned short) (temp2 >> 16);
xgifb_reg_and_or(pVBInfo->Part4Port, 0x3a,
~0xc0,
(unsigned short) ((tempbx &
0xff) << 6));
tempcx = pVBInfo->VGAVDE;
if (tempcx == pVBInfo->VDE)
xgifb_reg_and_or(pVBInfo->Part4Port,
0x30, ~0x0c, 0x00);
else
xgifb_reg_and_or(pVBInfo->Part4Port,
0x30, ~0x0c, 0x08);
}
tempcx = pVBInfo->VGAHDE; tempcx = pVBInfo->VGAHDE;
tempbx = pVBInfo->HDE; tempbx = pVBInfo->HDE;
temp1 = tempcx << 16; temp1 = tempcx << 16;
tempax = (unsigned short) (temp1 / tempbx); tempax = (unsigned short) (temp1 / tempbx);
if ((tempbx & 0xffff) == (tempcx & 0xffff)) if ((tempbx & 0xffff) == (tempcx & 0xffff))
tempax = 65535; tempax = 65535;
temp3 = tempax; temp3 = tempax;
temp1 = pVBInfo->VGAHDE << 16; temp1 = pVBInfo->VGAHDE << 16;
temp1 /= temp3; temp1 /= temp3;
temp3 = temp3 << 16; temp3 = temp3 << 16;
temp1 -= 1; temp1 -= 1;
temp3 = (temp3 & 0xffff0000) + (temp1 & 0xffff); temp3 = (temp3 & 0xffff0000) + (temp1 & 0xffff);
tempax = (unsigned short) (temp3 & 0xff); tempax = (unsigned short) (temp3 & 0xff);
xgifb_reg_set(pVBInfo->Part1Port, 0x1f, tempax); xgifb_reg_set(pVBInfo->Part1Port, 0x1f, tempax);
temp1 = pVBInfo->VGAVDE << 18; temp1 = pVBInfo->VGAVDE << 18;
temp1 = temp1 / push3; temp1 = temp1 / push3;
tempbx = (unsigned short) (temp1 & 0xffff); tempbx = (unsigned short) (temp1 & 0xffff);
if (pVBInfo->LCDResInfo == Panel1024x768) if (pVBInfo->LCDResInfo == Panel1024x768)
tempbx -= 1; tempbx -= 1;
tempax = ((tempbx >> 8) & 0xff) << 3; tempax = ((tempbx >> 8) & 0xff) << 3;
tempax |= (unsigned short) ((temp3 >> 8) & 0x07); tempax |= (unsigned short) ((temp3 >> 8) & 0x07);
xgifb_reg_set(pVBInfo->Part1Port, 0x20, xgifb_reg_set(pVBInfo->Part1Port, 0x20,
(unsigned short) (tempax & 0xff)); (unsigned short) (tempax & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x21, xgifb_reg_set(pVBInfo->Part1Port, 0x21,
(unsigned short) (tempbx & 0xff)); (unsigned short) (tempbx & 0xff));
temp3 = temp3 >> 16; temp3 = temp3 >> 16;
if (modeflag & HalfDCLK) if (modeflag & HalfDCLK)
temp3 = temp3 >> 1; temp3 = temp3 >> 1;
xgifb_reg_set(pVBInfo->Part1Port, 0x22, xgifb_reg_set(pVBInfo->Part1Port, 0x22,
(unsigned short) ((temp3 >> 8) & 0xff)); (unsigned short) ((temp3 >> 8) & 0xff));
xgifb_reg_set(pVBInfo->Part1Port, 0x23, xgifb_reg_set(pVBInfo->Part1Port, 0x23,
(unsigned short) (temp3 & 0xff)); (unsigned short) (temp3 & 0xff));
}
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
...@@ -3857,8 +3855,7 @@ static void XGI_WaitDisply(struct vb_device_info *pVBInfo) ...@@ -3857,8 +3855,7 @@ static void XGI_WaitDisply(struct vb_device_info *pVBInfo)
static void XGI_AutoThreshold(struct vb_device_info *pVBInfo) static void XGI_AutoThreshold(struct vb_device_info *pVBInfo)
{ {
if (!(pVBInfo->SetFlag & Win9xDOSMode)) xgifb_reg_or(pVBInfo->Part1Port, 0x01, 0x40);
xgifb_reg_or(pVBInfo->Part1Port, 0x01, 0x40);
} }
static void XGI_SaveCRT2Info(unsigned short ModeNo, static void XGI_SaveCRT2Info(unsigned short ModeNo,
...@@ -6448,9 +6445,6 @@ void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension, ...@@ -6448,9 +6445,6 @@ void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension,
{ {
unsigned short tempah = 0; unsigned short tempah = 0;
if (pVBInfo->SetFlag == Win9xDOSMode)
return;
if (pVBInfo->VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV if (pVBInfo->VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV
| VB_XGI302LV | VB_XGI301C)) { | VB_XGI302LV | VB_XGI301C)) {
tempah = 0x3F; tempah = 0x3F;
...@@ -6988,9 +6982,6 @@ static void XGI_OEM310Setting(unsigned short ModeNo, ...@@ -6988,9 +6982,6 @@ static void XGI_OEM310Setting(unsigned short ModeNo,
unsigned short ModeIdIndex, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo) struct vb_device_info *pVBInfo)
{ {
if (pVBInfo->SetFlag & Win9xDOSMode)
return;
/* GetPart1IO(); */ /* GetPart1IO(); */
XGI_SetDelayComp(pVBInfo); XGI_SetDelayComp(pVBInfo);
...@@ -7588,16 +7579,6 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, ...@@ -7588,16 +7579,6 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension,
{ {
unsigned short tempah; unsigned short tempah;
if (pVBInfo->SetFlag == Win9xDOSMode) {
if (pVBInfo->VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV
| VB_XGI302LV | VB_XGI301C)) {
XGI_DisplayOn(HwDeviceExtension, pVBInfo);
return;
} else
/* LVDS or CH7017 */
return;
}
if (pVBInfo->VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV if (pVBInfo->VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV
| VB_XGI302LV | VB_XGI301C)) { | VB_XGI302LV | VB_XGI301C)) {
if (!(pVBInfo->SetFlag & DisableChA)) { if (!(pVBInfo->SetFlag & DisableChA)) {
...@@ -7698,11 +7679,6 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, ...@@ -7698,11 +7679,6 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension,
/* EnablePart4_1F */ /* EnablePart4_1F */
xgifb_reg_or(pVBInfo->Part4Port, 0x1F, tempah); xgifb_reg_or(pVBInfo->Part4Port, 0x1F, tempah);
if (pVBInfo->SetFlag & Win9xDOSMode) {
XGI_DisplayOn(HwDeviceExtension, pVBInfo);
return;
}
if (!(pVBInfo->SetFlag & DisableChA)) { if (!(pVBInfo->SetFlag & DisableChA)) {
XGI_VBLongWait(pVBInfo); XGI_VBLongWait(pVBInfo);
if (!(pVBInfo->SetFlag & GatingCRT)) { if (!(pVBInfo->SetFlag & GatingCRT)) {
......
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