staging: xgifb: delete Win9xDOSMode
[pandora-kernel.git] / drivers / staging / xgifb / vb_setmode.c
index 0e1833a..15eb00d 100644 (file)
@@ -1902,10 +1902,8 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
 
        switch (tempbx) {
        case 0:
-               tempdi = XGI_EPLLCDCRT1Ptr_H;
-               break;
        case 1:
-               tempdi = XGI_EPLLCDCRT1Ptr_V;
+               tempdi = xgifb_epllcd_crt1;
                break;
        case 2:
                tempdi = XGI_EPLLCDDataPtr;
@@ -2327,7 +2325,8 @@ static void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo,
                tempdi = NULL; /*EPLCHTVCRT1Ptr_V;*/
                break;
        case 2:
-               tempdi = XGI_EPLCHTVDataPtr;
+       case 6:
+               tempdi = xgifb_chrontel_tv;
                break;
        case 3:
                tempdi = NULL;
@@ -2338,9 +2337,6 @@ static void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo,
        case 5:
                tempdi = NULL;
                break;
-       case 6:
-               tempdi = XGI_EPLCHTVRegPtr;
-               break;
        default:
                break;
        }
@@ -2616,284 +2612,282 @@ static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
        else
                modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
 
-       if (!(pVBInfo->SetFlag & Win9xDOSMode)) {
-               if (pVBInfo->IF_DEF_OEMUtil == 1) {
-                       tempbx = 8;
-                       LCDPtr = (struct XGI330_LCDDataDesStruct *)
-                               XGI_GetLcdPtr(tempbx,
-                                             ModeNo,
-                                             ModeIdIndex,
-                                             RefreshRateTableIndex,
-                                             pVBInfo);
-               }
+       if (pVBInfo->IF_DEF_OEMUtil == 1) {
+               tempbx = 8;
+               LCDPtr = (struct XGI330_LCDDataDesStruct *)
+                       XGI_GetLcdPtr(tempbx,
+                                     ModeNo,
+                                     ModeIdIndex,
+                                     RefreshRateTableIndex,
+                                     pVBInfo);
+       }
 
-               if ((pVBInfo->IF_DEF_OEMUtil == 0) ||
-                   (LCDPtr == NULL)) {
-                       tempbx = 3;
-                       if (pVBInfo->LCDInfo & EnableScalingLCD)
-                               LCDPtr1 =
-                                   (struct XGI330_LCDDataDesStruct2 *)
-                                               XGI_GetLcdPtr(
-                                                 tempbx,
-                                                 ModeNo,
-                                                 ModeIdIndex,
-                                                 RefreshRateTableIndex,
-                                                 pVBInfo);
-                       else
-                               LCDPtr =
-                                   (struct XGI330_LCDDataDesStruct *)
-                                               XGI_GetLcdPtr(
+       if ((pVBInfo->IF_DEF_OEMUtil == 0) ||
+           (LCDPtr == NULL)) {
+               tempbx = 3;
+               if (pVBInfo->LCDInfo & EnableScalingLCD)
+                       LCDPtr1 =
+                           (struct XGI330_LCDDataDesStruct2 *)
+                                       XGI_GetLcdPtr(
+                                         tempbx,
+                                         ModeNo,
+                                         ModeIdIndex,
+                                         RefreshRateTableIndex,
+                                         pVBInfo);
+               else
+                       LCDPtr =
+                           (struct XGI330_LCDDataDesStruct *)
+                                       XGI_GetLcdPtr(
                                                  tempbx,
                                                  ModeNo,
                                                  ModeIdIndex,
                                                  RefreshRateTableIndex,
                                                  pVBInfo);
-               }
+       }
 
-               XGI_GetLCDSync(&tempax, &tempbx, pVBInfo);
-               push1 = tempbx;
-               push2 = tempax;
+       XGI_GetLCDSync(&tempax, &tempbx, pVBInfo);
+       push1 = tempbx;
+       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->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;
-               }
+       if (pVBInfo->LCDInfo & SetLCDtoNonExpanding) {
+               pVBInfo->HDE = tempax;
+               pVBInfo->VDE = tempbx;
+               pVBInfo->VGAHDE = tempax;
+               pVBInfo->VGAVDE = tempbx;
+       }
 
-               if (pVBInfo->LCDInfo & SetLCDtoNonExpanding) {
-                       pVBInfo->HDE = tempax;
-                       pVBInfo->VDE = tempbx;
-                       pVBInfo->VGAHDE = tempax;
-                       pVBInfo->VGAVDE = tempbx;
-               }
+       if ((pVBInfo->IF_DEF_ScaleLCD == 1) &&
+           (pVBInfo->LCDInfo & EnableScalingLCD)) {
+               tempax = pVBInfo->HDE;
+               tempbx = pVBInfo->VDE;
+       }
 
-               if ((pVBInfo->IF_DEF_ScaleLCD == 1) &&
-                   (pVBInfo->LCDInfo & EnableScalingLCD)) {
-                       tempax = pVBInfo->HDE;
-                       tempbx = pVBInfo->VDE;
-               }
+       tempax = pVBInfo->HT;
 
-               tempax = pVBInfo->HT;
+       if (pVBInfo->LCDInfo & EnableScalingLCD)
+               tempbx = LCDPtr1->LCDHDES;
+       else
+               tempbx = LCDPtr->LCDHDES;
 
-               if (pVBInfo->LCDInfo & EnableScalingLCD)
-                       tempbx = LCDPtr1->LCDHDES;
-               else
-                       tempbx = LCDPtr->LCDHDES;
+       tempcx = pVBInfo->HDE;
+       tempbx = tempbx & 0x0fff;
+       tempcx += tempbx;
 
-               tempcx = pVBInfo->HDE;
-               tempbx = tempbx & 0x0fff;
-               tempcx += tempbx;
+       if (tempcx >= tempax)
+               tempcx -= tempax;
 
-               if (tempcx >= tempax)
-                       tempcx -= tempax;
+       xgifb_reg_set(pVBInfo->Part1Port, 0x1A, tempbx & 0x07);
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x1A, tempbx & 0x07);
+       tempcx = tempcx >> 3;
+       tempbx = tempbx >> 3;
 
-               tempcx = tempcx >> 3;
-               tempbx = tempbx >> 3;
+       xgifb_reg_set(pVBInfo->Part1Port, 0x16,
+                       (unsigned short) (tempbx & 0xff));
+       xgifb_reg_set(pVBInfo->Part1Port, 0x17,
+                       (unsigned short) (tempcx & 0xff));
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x16,
-                               (unsigned short) (tempbx & 0xff));
-               xgifb_reg_set(pVBInfo->Part1Port, 0x17,
-                               (unsigned short) (tempcx & 0xff));
+       tempax = pVBInfo->HT;
 
-               tempax = pVBInfo->HT;
+       if (pVBInfo->LCDInfo & EnableScalingLCD)
+               tempbx = LCDPtr1->LCDHRS;
+       else
+               tempbx = LCDPtr->LCDHRS;
 
-               if (pVBInfo->LCDInfo & EnableScalingLCD)
-                       tempbx = LCDPtr1->LCDHRS;
-               else
-                       tempbx = LCDPtr->LCDHRS;
+       tempcx = push2;
 
-               tempcx = push2;
+       if (pVBInfo->LCDInfo & EnableScalingLCD)
+               tempcx = LCDPtr1->LCDHSync;
 
-               if (pVBInfo->LCDInfo & EnableScalingLCD)
-                       tempcx = LCDPtr1->LCDHSync;
+       tempcx += tempbx;
 
-               tempcx += tempbx;
+       if (tempcx >= tempax)
+               tempcx -= tempax;
 
-               if (tempcx >= tempax)
-                       tempcx -= tempax;
+       tempax = tempbx & 0x07;
+       tempax = tempax >> 5;
+       tempcx = tempcx >> 3;
+       tempbx = tempbx >> 3;
 
-               tempax = tempbx & 0x07;
-               tempax = tempax >> 5;
-               tempcx = tempcx >> 3;
-               tempbx = tempbx >> 3;
+       tempcx &= 0x1f;
+       tempax |= tempcx;
 
-               tempcx &= 0x1f;
-               tempax |= tempcx;
+       xgifb_reg_set(pVBInfo->Part1Port, 0x15, tempax);
+       xgifb_reg_set(pVBInfo->Part1Port, 0x14,
+                       (unsigned short) (tempbx & 0xff));
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x15, tempax);
-               xgifb_reg_set(pVBInfo->Part1Port, 0x14,
-                               (unsigned short) (tempbx & 0xff));
+       tempax = pVBInfo->VT;
+       if (pVBInfo->LCDInfo & EnableScalingLCD)
+               tempbx = LCDPtr1->LCDVDES;
+       else
+               tempbx = LCDPtr->LCDVDES;
+       tempcx = pVBInfo->VDE;
 
-               tempax = pVBInfo->VT;
-               if (pVBInfo->LCDInfo & EnableScalingLCD)
-                       tempbx = LCDPtr1->LCDVDES;
-               else
-                       tempbx = LCDPtr->LCDVDES;
-               tempcx = pVBInfo->VDE;
+       tempbx = tempbx & 0x0fff;
+       tempcx += tempbx;
+       if (tempcx >= tempax)
+               tempcx -= tempax;
 
-               tempbx = tempbx & 0x0fff;
-               tempcx += tempbx;
-               if (tempcx >= tempax)
-                       tempcx -= tempax;
+       xgifb_reg_set(pVBInfo->Part1Port, 0x1b,
+                       (unsigned short) (tempbx & 0xff));
+       xgifb_reg_set(pVBInfo->Part1Port, 0x1c,
+                       (unsigned short) (tempcx & 0xff));
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x1b,
-                               (unsigned short) (tempbx & 0xff));
-               xgifb_reg_set(pVBInfo->Part1Port, 0x1c,
-                               (unsigned short) (tempcx & 0xff));
+       tempbx = (tempbx >> 8) & 0x07;
+       tempcx = (tempcx >> 8) & 0x07;
 
-               tempbx = (tempbx >> 8) & 0x07;
-               tempcx = (tempcx >> 8) & 0x07;
+       xgifb_reg_set(pVBInfo->Part1Port, 0x1d,
+                       (unsigned short) ((tempcx << 3)
+                                       | tempbx));
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x1d,
-                               (unsigned short) ((tempcx << 3)
-                                               | tempbx));
+       tempax = pVBInfo->VT;
+       if (pVBInfo->LCDInfo & EnableScalingLCD)
+               tempbx = LCDPtr1->LCDVRS;
+       else
+               tempbx = LCDPtr->LCDVRS;
 
-               tempax = pVBInfo->VT;
-               if (pVBInfo->LCDInfo & EnableScalingLCD)
-                       tempbx = LCDPtr1->LCDVRS;
-               else
-                       tempbx = LCDPtr->LCDVRS;
+       /* tempbx = tempbx >> 4; */
+       tempcx = push1;
 
-               /* tempbx = tempbx >> 4; */
-               tempcx = push1;
+       if (pVBInfo->LCDInfo & EnableScalingLCD)
+               tempcx = LCDPtr1->LCDVSync;
 
-               if (pVBInfo->LCDInfo & EnableScalingLCD)
-                       tempcx = LCDPtr1->LCDVSync;
+       tempcx += tempbx;
+       if (tempcx >= tempax)
+               tempcx -= tempax;
 
-               tempcx += tempbx;
-               if (tempcx >= tempax)
-                       tempcx -= tempax;
+       xgifb_reg_set(pVBInfo->Part1Port, 0x18,
+                       (unsigned short) (tempbx & 0xff));
+       xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f,
+                       (unsigned short) (tempcx & 0x0f));
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x18,
-                               (unsigned short) (tempbx & 0xff));
-               xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f,
-                               (unsigned short) (tempcx & 0x0f));
+       tempax = ((tempbx >> 8) & 0x07) << 3;
 
-               tempax = ((tempbx >> 8) & 0x07) << 3;
+       tempbx = pVBInfo->VGAVDE;
+       if (tempbx != pVBInfo->VDE)
+               tempax |= 0x40;
 
-               tempbx = pVBInfo->VGAVDE;
-               if (tempbx != pVBInfo->VDE)
-                       tempax |= 0x40;
+       if (pVBInfo->LCDInfo & EnableLVDSDDA)
+               tempax |= 0x40;
 
-               if (pVBInfo->LCDInfo & EnableLVDSDDA)
-                       tempax |= 0x40;
+       xgifb_reg_and_or(pVBInfo->Part1Port, 0x1a, 0x07,
+                               tempax);
 
-               xgifb_reg_and_or(pVBInfo->Part1Port, 0x1a, 0x07,
-                                       tempax);
+       tempcx = pVBInfo->VGAVT;
+       tempbx = pVBInfo->VDE;
+       tempax = pVBInfo->VGAVDE;
+       tempcx -= tempax;
 
-               tempcx = pVBInfo->VGAVT;
-               tempbx = pVBInfo->VDE;
-               tempax = pVBInfo->VGAVDE;
-               tempcx -= tempax;
+       temp = tempax; /* 0430 ylshieh */
+       temp1 = (temp << 18) / tempbx;
 
-               temp = tempax; /* 0430 ylshieh */
-               temp1 = (temp << 18) / tempbx;
+       tempdx = (unsigned short) ((temp << 18) % tempbx);
 
-               tempdx = (unsigned short) ((temp << 18) % tempbx);
+       if (tempdx != 0)
+               temp1 += 1;
 
-               if (tempdx != 0)
-                       temp1 += 1;
+       temp2 = temp1;
+       push3 = temp2;
 
-               temp2 = temp1;
-               push3 = temp2;
+       xgifb_reg_set(pVBInfo->Part1Port, 0x37,
+                       (unsigned short) (temp2 & 0xff));
+       xgifb_reg_set(pVBInfo->Part1Port, 0x36,
+                       (unsigned short) ((temp2 >> 8) & 0xff));
+
+       tempbx = (unsigned short) (temp2 >> 16);
+       tempax = tempbx & 0x03;
+
+       tempbx = pVBInfo->VGAVDE;
+       if (tempbx == pVBInfo->VDE)
+               tempax |= 0x04;
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x37,
-                               (unsigned short) (temp2 & 0xff));
-               xgifb_reg_set(pVBInfo->Part1Port, 0x36,
-                               (unsigned short) ((temp2 >> 8) & 0xff));
+       xgifb_reg_set(pVBInfo->Part1Port, 0x35, tempax);
 
+       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);
-               tempax = tempbx & 0x03;
-
-               tempbx = pVBInfo->VGAVDE;
-               if (tempbx == pVBInfo->VDE)
-                       tempax |= 0x04;
-
-               xgifb_reg_set(pVBInfo->Part1Port, 0x35, tempax);
-
-               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);
-                       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);
-               }
+               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;
-               tempbx = pVBInfo->HDE;
+       tempcx = pVBInfo->VGAHDE;
+       tempbx = pVBInfo->HDE;
 
-               temp1 = tempcx << 16;
+       temp1 = tempcx << 16;
 
-               tempax = (unsigned short) (temp1 / tempbx);
+       tempax = (unsigned short) (temp1 / tempbx);
 
-               if ((tempbx & 0xffff) == (tempcx & 0xffff))
-                       tempax = 65535;
+       if ((tempbx & 0xffff) == (tempcx & 0xffff))
+               tempax = 65535;
 
-               temp3 = tempax;
-               temp1 = pVBInfo->VGAHDE << 16;
+       temp3 = tempax;
+       temp1 = pVBInfo->VGAHDE << 16;
 
-               temp1 /= temp3;
-               temp3 = temp3 << 16;
-               temp1 -= 1;
+       temp1 /= temp3;
+       temp3 = temp3 << 16;
+       temp1 -= 1;
 
-               temp3 = (temp3 & 0xffff0000) + (temp1 & 0xffff);
+       temp3 = (temp3 & 0xffff0000) + (temp1 & 0xffff);
 
-               tempax = (unsigned short) (temp3 & 0xff);
-               xgifb_reg_set(pVBInfo->Part1Port, 0x1f, tempax);
+       tempax = (unsigned short) (temp3 & 0xff);
+       xgifb_reg_set(pVBInfo->Part1Port, 0x1f, tempax);
 
-               temp1 = pVBInfo->VGAVDE << 18;
-               temp1 = temp1 / push3;
-               tempbx = (unsigned short) (temp1 & 0xffff);
+       temp1 = pVBInfo->VGAVDE << 18;
+       temp1 = temp1 / push3;
+       tempbx = (unsigned short) (temp1 & 0xffff);
 
-               if (pVBInfo->LCDResInfo == Panel1024x768)
-                       tempbx -= 1;
+       if (pVBInfo->LCDResInfo == Panel1024x768)
+               tempbx -= 1;
 
-               tempax = ((tempbx >> 8) & 0xff) << 3;
-               tempax |= (unsigned short) ((temp3 >> 8) & 0x07);
-               xgifb_reg_set(pVBInfo->Part1Port, 0x20,
-                               (unsigned short) (tempax & 0xff));
-               xgifb_reg_set(pVBInfo->Part1Port, 0x21,
-                               (unsigned short) (tempbx & 0xff));
+       tempax = ((tempbx >> 8) & 0xff) << 3;
+       tempax |= (unsigned short) ((temp3 >> 8) & 0x07);
+       xgifb_reg_set(pVBInfo->Part1Port, 0x20,
+                       (unsigned short) (tempax & 0xff));
+       xgifb_reg_set(pVBInfo->Part1Port, 0x21,
+                       (unsigned short) (tempbx & 0xff));
 
-               temp3 = temp3 >> 16;
+       temp3 = temp3 >> 16;
 
-               if (modeflag & HalfDCLK)
-                       temp3 = temp3 >> 1;
+       if (modeflag & HalfDCLK)
+               temp3 = temp3 >> 1;
 
-               xgifb_reg_set(pVBInfo->Part1Port, 0x22,
-                               (unsigned short) ((temp3 >> 8) & 0xff));
-               xgifb_reg_set(pVBInfo->Part1Port, 0x23,
-                               (unsigned short) (temp3 & 0xff));
-       }
+       xgifb_reg_set(pVBInfo->Part1Port, 0x22,
+                       (unsigned short) ((temp3 >> 8) & 0xff));
+       xgifb_reg_set(pVBInfo->Part1Port, 0x23,
+                       (unsigned short) (temp3 & 0xff));
 }
 
 /* --------------------------------------------------------------------- */
@@ -3383,34 +3377,6 @@ void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
                                                tempbx |= (SetInSlaveMode |
                                                           SetSimuScanMode);
                                }
-
-                               if (pVBInfo->IF_DEF_VideoCapture == 1) {
-                                       if (((HwDeviceExtension->jChipType ==
-                                             XG40) &&
-                                            (pVBInfo->Set_VGAType == XG40)) ||
-                                           ((HwDeviceExtension->jChipType ==
-                                             XG41) &&
-                                            (pVBInfo->Set_VGAType == XG41)) ||
-                                           ((HwDeviceExtension->jChipType ==
-                                             XG42) &&
-                                            (pVBInfo->Set_VGAType == XG42)) ||
-                                           ((HwDeviceExtension->jChipType ==
-                                             XG45) &&
-                                            (pVBInfo->Set_VGAType == XG45))) {
-                                               if (ModeNo <= 13) {
-                                                       if (!(tempbx &
-                                                            SetCRT2ToRAMDAC)) {
-                                                               /*CRT2 not need
-                                                                * to support*/
-                                                               tempbx &=
-                                                                 (0x00FF |
-                                                                 (~SetInSlaveMode));
-                                                               pVBInfo->SetFlag
-                                                                               |= EnableVCMode;
-                                                       }
-                                               }
-                                       }
-                               }
                        }
 
                        /* LCD+TV can't support in slave mode
@@ -3889,8 +3855,7 @@ static void XGI_WaitDisply(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,
@@ -5630,27 +5595,24 @@ static struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx,
                tempbx = pVBInfo->VDE;
        }
 
-       if (tempax < tempbx)
-               return &EnlargeTap4Timing[0];
-       else if (tempax == tempbx)
-               return &NoScaleTap4Timing[0]; /* 1:1 */
+       if (tempax <= tempbx)
+               return &xgifb_tap4_timing[0];
        else
-               Tap4TimingPtr = NTSCTap4Timing; /* NTSC */
+               Tap4TimingPtr = xgifb_ntsc_525_tap4_timing; /* NTSC */
 
        if (pVBInfo->TVInfo & SetPALTV)
                Tap4TimingPtr = PALTap4Timing;
 
        if (pVBInfo->VBInfo & SetCRT2ToYPbPr) {
-               if (pVBInfo->TVInfo & SetYPbPrMode525i)
-                       Tap4TimingPtr = YPbPr525iTap4Timing;
-               if (pVBInfo->TVInfo & SetYPbPrMode525p)
-                       Tap4TimingPtr = YPbPr525pTap4Timing;
+               if ((pVBInfo->TVInfo & SetYPbPrMode525i) ||
+                       (pVBInfo->TVInfo & SetYPbPrMode525p))
+                       Tap4TimingPtr = xgifb_ntsc_525_tap4_timing;
                if (pVBInfo->TVInfo & SetYPbPrMode750p)
                        Tap4TimingPtr = YPbPr750pTap4Timing;
        }
 
        if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
-               Tap4TimingPtr = HiTVTap4Timing;
+               Tap4TimingPtr = xgifb_tap4_timing;
 
        i = 0;
        while (Tap4TimingPtr[i].DE != 0xFFFF) {
@@ -6483,9 +6445,6 @@ void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension,
 {
        unsigned short tempah = 0;
 
-       if (pVBInfo->SetFlag == Win9xDOSMode)
-               return;
-
        if (pVBInfo->VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV
                        | VB_XGI302LV | VB_XGI301C)) {
                tempah = 0x3F;
@@ -7023,9 +6982,6 @@ static void XGI_OEM310Setting(unsigned short ModeNo,
                              unsigned short ModeIdIndex,
                              struct vb_device_info *pVBInfo)
 {
-       if (pVBInfo->SetFlag & Win9xDOSMode)
-               return;
-
        /* GetPart1IO(); */
        XGI_SetDelayComp(pVBInfo);
 
@@ -7623,16 +7579,6 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension,
 {
        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
                        | VB_XGI302LV | VB_XGI301C)) {
                if (!(pVBInfo->SetFlag & DisableChA)) {
@@ -7733,11 +7679,6 @@ void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension,
                /* EnablePart4_1F */
                xgifb_reg_or(pVBInfo->Part4Port, 0x1F, tempah);
 
-               if (pVBInfo->SetFlag & Win9xDOSMode) {
-                       XGI_DisplayOn(HwDeviceExtension, pVBInfo);
-                       return;
-               }
-
                if (!(pVBInfo->SetFlag & DisableChA)) {
                        XGI_VBLongWait(pVBInfo);
                        if (!(pVBInfo->SetFlag & GatingCRT)) {
@@ -7885,7 +7826,6 @@ unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension,
        pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress;
        pVBInfo->IF_DEF_LVDS = 0;
        pVBInfo->IF_DEF_LCDA = 1;
-       pVBInfo->IF_DEF_VideoCapture = 0;
        pVBInfo->IF_DEF_ScaleLCD = 0;
        pVBInfo->IF_DEF_OEMUtil = 0;
        pVBInfo->IF_DEF_PWD = 0;