diff options
Diffstat (limited to 'src/atimode.c')
-rw-r--r-- | src/atimode.c | 169 |
1 files changed, 3 insertions, 166 deletions
diff --git a/src/atimode.c b/src/atimode.c index 17210de..3ac46d9 100644 --- a/src/atimode.c +++ b/src/atimode.c @@ -273,8 +273,6 @@ ATIModePreInit ATIVGAWonderPreInit(pATI, pATIHW); } - if (pATI->Chip >= ATI_CHIP_88800GXC) - #endif /* AVOID_CPIO */ { @@ -447,8 +445,6 @@ ATIModeSave ATIVGAWonderSave(pATI, pATIHW); } - if (pATI->Chip >= ATI_CHIP_88800GXC) - #endif /* AVOID_CPIO */ { @@ -507,27 +503,9 @@ ATIModeSave ATIRGB514Save(pATI, pATIHW); } -#ifndef AVOID_CPIO - - /* - * For some unknown reason, CLKDIV2 needs to be turned off to save the - * DAC's LUT reliably on VGA Wonder VLB adapters. - */ - if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U)) - PutReg(SEQX, 0x01U, pATIHW->seq[1] & ~0x08U); - -#endif /* AVOID_CPIO */ - /* Save RAMDAC state */ ATIDACSave(pATI, pATIHW); -#ifndef AVOID_CPIO - - if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U)) - PutReg(SEQX, 0x01U, pATIHW->seq[1]); - -#endif /* AVOID_CPIO */ - /* * The server has already saved video memory contents when switching out of * its virtual console, so don't do it again. @@ -588,29 +566,13 @@ ATIModeCalculate * limitations. */ VScan = pATI->LCDVertical / pMode->VDisplay; - switch (pATIHW->crtc) { - -#ifndef AVOID_CPIO - - case ATI_CRTC_VGA: - if (VScan > 64) - VScan = 64; - pMode->VScan = VScan; - break; - -#endif /* AVOID_CPIO */ - - case ATI_CRTC_MACH64: pMode->VScan = 0; - if (VScan <= 1) - break; + if (VScan > 1) + { VScan = 2; pMode->Flags |= V_DBLSCAN; - break; - - default: - break; + } } pMode->HSyncStart = pMode->HDisplay + pATI->LCDHSyncStart; @@ -625,132 +587,9 @@ ATIModeCalculate ATIDivide(pATI->LCDVBlankWidth, VScan, 0, 0); } - switch (pATIHW->crtc) { - -#ifndef AVOID_CPIO - - case ATI_CRTC_VGA: - /* Fill in VGA data */ - ATIVGACalculate(pATI, pATIHW, pMode); - - /* Fill in VGA Wonder data */ - if (pATI->CPIO_VGAWonder) - ATIVGAWonderCalculate(pATI, pATIHW, pMode); - - if (pATI->Chip >= ATI_CHIP_88800GXC) - { - if (pATI->Chip >= ATI_CHIP_264CT) - { - /* - * Selected bits of accelerator & VGA CRTC registers are - * actually copies of each other. - */ - pATIHW->crtc_h_total_disp = - SetBits(pMode->CrtcHTotal, CRTC_H_TOTAL) | - SetBits(pMode->CrtcHDisplay, CRTC_H_DISP); - pATIHW->crtc_h_sync_strt_wid = - SetBits(pMode->CrtcHSyncStart, CRTC_H_SYNC_STRT) | - SetBits(pMode->CrtcHSkew, CRTC_H_SYNC_DLY) | /* ? */ - SetBits(GetBits(pMode->CrtcHSyncStart, 0x0100U), - CRTC_H_SYNC_STRT_HI) | - SetBits(pMode->CrtcHSyncEnd, CRTC_H_SYNC_WID); - if (pMode->Flags & V_NHSYNC) - pATIHW->crtc_h_sync_strt_wid |= CRTC_H_SYNC_POL; - - pATIHW->crtc_v_total_disp = - SetBits(pMode->CrtcVTotal, CRTC_V_TOTAL) | - SetBits(pMode->CrtcVDisplay, CRTC_V_DISP); - pATIHW->crtc_v_sync_strt_wid = - SetBits(pMode->CrtcVSyncStart, CRTC_V_SYNC_STRT) | - SetBits(pMode->CrtcVSyncEnd, CRTC_V_SYNC_END_VGA); - if (pMode->Flags & V_NVSYNC) - pATIHW->crtc_v_sync_strt_wid |= CRTC_V_SYNC_POL; - } - - pATIHW->crtc_gen_cntl = inr(CRTC_GEN_CNTL) & - ~(CRTC_DBL_SCAN_EN | CRTC_INTERLACE_EN | - CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | CRTC_CSYNC_EN | - CRTC_PIX_BY_2_EN | CRTC_DISPLAY_DIS | - CRTC_VGA_XOVERSCAN | CRTC_PIX_WIDTH | - CRTC_BYTE_PIX_ORDER | CRTC_VGA_128KAP_PAGING | - CRTC_VFC_SYNC_TRISTATE | - CRTC_LOCK_REGS | /* Already off, but ... */ - CRTC_SYNC_TRISTATE | CRTC_EXT_DISP_EN | - CRTC_DISP_REQ_EN | CRTC_VGA_LINEAR | CRTC_VGA_TEXT_132 | - CRTC_CUR_B_TEST); - /* Some of these are not relevent, but that doesn't matter */ - switch (pATI->depth) - { - case 1: - pATIHW->crtc_gen_cntl |= - SetBits(PIX_WIDTH_1BPP, CRTC_PIX_WIDTH); - break; - - case 4: - pATIHW->crtc_gen_cntl |= - SetBits(PIX_WIDTH_4BPP, CRTC_PIX_WIDTH); - break; - - case 8: - pATIHW->crtc_gen_cntl |= - SetBits(PIX_WIDTH_8BPP, CRTC_PIX_WIDTH); - break; - - case 15: - pATIHW->crtc_gen_cntl |= - SetBits(PIX_WIDTH_15BPP, CRTC_PIX_WIDTH); - break; - - case 16: - pATIHW->crtc_gen_cntl |= - SetBits(PIX_WIDTH_16BPP, CRTC_PIX_WIDTH); - break; - - case 24: - if (pATI->bitsPerPixel == 24) - { - pATIHW->crtc_gen_cntl |= - SetBits(PIX_WIDTH_24BPP, CRTC_PIX_WIDTH); - break; - } - if (pATI->bitsPerPixel != 32) - break; - /* Fall through */ - - case 32: - pATIHW->crtc_gen_cntl |= - SetBits(PIX_WIDTH_32BPP, CRTC_PIX_WIDTH); - break; - - default: - break; - } -#if 0 /* This isn't needed, but is kept for reference */ - if (pMode->Flags & V_DBLSCAN) - pATIHW->crtc_gen_cntl |= CRTC_DBL_SCAN_EN; -#endif - if (pMode->Flags & V_INTERLACE) - pATIHW->crtc_gen_cntl |= CRTC_INTERLACE_EN; - if ((pMode->Flags & (V_CSYNC | V_PCSYNC)) || pATI->OptionCSync) - pATIHW->crtc_gen_cntl |= CRTC_CSYNC_EN; - if (pATI->depth <= 4) - pATIHW->crtc_gen_cntl |= CRTC_EN | CRTC_CNT_EN; - else - pATIHW->crtc_gen_cntl |= - CRTC_EN | CRTC_VGA_LINEAR | CRTC_CNT_EN; - } - break; - -#endif /* AVOID_CPIO */ - - case ATI_CRTC_MACH64: /* Fill in Mach64 data */ ATIMach64Calculate(pATI, pATIHW, pMode); - break; - - default: - break; } /* Set up LCD register values */ @@ -1070,7 +909,6 @@ ATIModeSet #endif /* AVOID_CPIO */ - if (pATI->Chip >= ATI_CHIP_88800GXC) { /* Stop CRTC */ outr(CRTC_GEN_CNTL, @@ -1154,7 +992,6 @@ ATIModeSet ATIVGASet(pATI, pATIHW); /* Load Mach64 registers */ - if (pATI->Chip >= ATI_CHIP_88800GXC) { /* Load MMIO registers */ if (pATI->Block0Base) |