diff options
author | Alex Deucher <alex@botch2.com> | 2007-08-02 02:37:16 -0400 |
---|---|---|
committer | Alex Deucher <alex@botch2.com> | 2007-08-02 02:37:16 -0400 |
commit | 288fa627274cb399059262d4f8bd844fc220a042 (patch) | |
tree | a15429240ce2d5ebaf54173f3ee2903c1c52c94e | |
parent | b66a1bc7994b33d349c1519761e431959311c85f (diff) |
RADEON: avoid a divide by 0 and only save tv out regs if the chip has them
-rw-r--r-- | src/radeon_driver.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c index a7f5831..c1f0c3c 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -4612,6 +4612,9 @@ static CARD8 RADEONComputePLLGain(CARD16 reference_freq, CARD16 ref_div, { unsigned vcoFreq; + if (!ref_div) + return 1; + vcoFreq = ((unsigned)reference_freq * fb_div) / ref_div; /* @@ -5417,6 +5420,8 @@ static void RADEONSavePalette(ScrnInfoPtr pScrn, RADEONSavePtr save) /* Save state that defines current video mode */ static void RADEONSaveMode(ScrnInfoPtr pScrn, RADEONSavePtr save) { + RADEONInfoPtr info = RADEONPTR(pScrn); + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "RADEONSaveMode(%p)\n", save); @@ -5428,7 +5433,8 @@ static void RADEONSaveMode(ScrnInfoPtr pScrn, RADEONSavePtr save) RADEONSaveDACRegisters(pScrn, save); RADEONSaveCrtc2Registers(pScrn, save); RADEONSavePLL2Registers(pScrn, save); - RADEONSaveTVRegisters(pScrn, save); + if (info->InternalTVOut) + RADEONSaveTVRegisters(pScrn, save); /*RADEONSavePalette(pScrn, save);*/ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, |