diff options
author | George Sapountzis <gsap7@yahoo.gr> | 2007-02-24 21:25:13 +0200 |
---|---|---|
committer | George Sapountzis <gsap7@yahoo.gr> | 2007-02-25 11:38:47 +0200 |
commit | 4374895d393bf170134ccffc188521fe515d5a77 (patch) | |
tree | 1753fea980461989a409bf056df613cc9b4b645f /src | |
parent | 8b9a4ec8af90b2f9f0d0a3a7f6627061df7e01b3 (diff) |
[mach64] Consolidate adjustments of mode timings, part 3.
Cosmetic.
Diffstat (limited to 'src')
-rw-r--r-- | src/atimach64.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/atimach64.c b/src/atimach64.c index e740003..c7b0ecc 100644 --- a/src/atimach64.c +++ b/src/atimach64.c @@ -82,12 +82,6 @@ ATIMach64PreInit ATIHWPtr pATIHW ) { - CARD32 bus_cntl, config_cntl; - - { - pATIHW->crtc_off_pitch = SetBits(pATI->displayWidth >> 3, CRTC_PITCH); - } - if ((pATI->LockData.crtc_gen_cntl & CRTC_CSYNC_EN) && !pATI->OptionCSync) { xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE, @@ -95,7 +89,7 @@ ATIMach64PreInit pATI->OptionCSync = TRUE; } - pATIHW->bus_cntl = bus_cntl = inr(BUS_CNTL); + pATIHW->bus_cntl = inr(BUS_CNTL); if (pATI->Chip < ATI_CHIP_264VT4) pATIHW->bus_cntl = (pATIHW->bus_cntl & ~BUS_HOST_ERR_INT_EN) | BUS_HOST_ERR_INT; @@ -142,7 +136,7 @@ ATIMach64PreInit if (pATI->DAC == ATI_DAC_IBMRGB514) pATIHW->gen_test_cntl |= GEN_OVR_OUTPUT_EN; - pATIHW->config_cntl = config_cntl = inr(CONFIG_CNTL); + pATIHW->config_cntl = inr(CONFIG_CNTL); #ifndef AVOID_CPIO @@ -212,6 +206,9 @@ ATIMach64PreInit /* Draw engine setup */ if (pATI->Block0Base) { + CARD32 bus_cntl = inr(BUS_CNTL); + CARD32 config_cntl = inr(CONFIG_CNTL); + /* Ensure apertures are enabled */ outr(BUS_CNTL, pATIHW->bus_cntl); outr(CONFIG_CNTL, pATIHW->config_cntl); @@ -595,27 +592,27 @@ ATIMach64ModeAdjust int VDisplay; /* Clobber mode timings */ - if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0) && - !pMode->CrtcHAdjusted && !pMode->CrtcVAdjusted && - (!pATI->OptionLCDSync || (pMode->type & M_T_BUILTIN))) + if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0)) { + if (!pMode->CrtcHAdjusted && !pMode->CrtcVAdjusted && + (!pATI->OptionLCDSync || (pMode->type & M_T_BUILTIN))) + { int VScan; pMode->Clock = pATI->LCDClock; pMode->Flags &= ~(V_DBLSCAN | V_INTERLACE | V_CLKDIV2); + pMode->VScan = 0; + /* * Use doublescanning or multiscanning to get around vertical blending * limitations. */ VScan = pATI->LCDVertical / pMode->VDisplay; + if (VScan > 1) { - pMode->VScan = 0; - if (VScan > 1) - { - VScan = 2; - pMode->Flags |= V_DBLSCAN; - } + VScan = 2; + pMode->Flags |= V_DBLSCAN; } pMode->HSyncStart = pMode->HDisplay + pATI->LCDHSyncStart; @@ -628,6 +625,7 @@ ATIMach64ModeAdjust ATIDivide(pATI->LCDVSyncWidth, VScan, 0, 1); pMode->VTotal = pMode->VDisplay + ATIDivide(pATI->LCDVBlankWidth, VScan, 0, 0); + } } /* If not already done adjust horizontal timings */ @@ -731,27 +729,28 @@ ATIMach64Calculate /* Build register contents */ pATIHW->crtc_h_total_disp = SetBits(pMode->CrtcHTotal, CRTC_H_TOTAL) | - SetBits(pMode->CrtcHDisplay, CRTC_H_DISP); + 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 - pMode->CrtcHSyncStart, - CRTC_H_SYNC_WID); + SetBits(pMode->CrtcHSkew, CRTC_H_SYNC_DLY) | /* ? */ + SetBits(GetBits(pMode->CrtcHSyncStart, 0x0100U), CRTC_H_SYNC_STRT_HI) | + SetBits(pMode->CrtcHSyncEnd - pMode->CrtcHSyncStart, 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); + SetBits(pMode->CrtcVDisplay, CRTC_V_DISP); + pATIHW->crtc_v_sync_strt_wid = SetBits(pMode->CrtcVSyncStart, CRTC_V_SYNC_STRT) | - SetBits(pMode->CrtcVSyncEnd - pMode->CrtcVSyncStart, - CRTC_V_SYNC_WID); + SetBits(pMode->CrtcVSyncEnd - pMode->CrtcVSyncStart, CRTC_V_SYNC_WID); if (pMode->Flags & V_NVSYNC) pATIHW->crtc_v_sync_strt_wid |= CRTC_V_SYNC_POL; + pATIHW->crtc_off_pitch = SetBits(pATI->displayWidth >> 3, CRTC_PITCH); + pATIHW->crtc_gen_cntl = inr(CRTC_GEN_CNTL) & ~(CRTC_DBL_SCAN_EN | CRTC_INTERLACE_EN | CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | CRTC_CSYNC_EN | |