From 831fc4a009841f68fe161b6e0db5b212d7d8079b Mon Sep 17 00:00:00 2001 From: Henry Zhao Date: Sun, 15 Oct 2006 17:12:06 -0400 Subject: fix bug 6966 (Henry Zhao, Shem Multinymous) --- src/radeon_mergedfb.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c index 3e64e940..94ac942a 100644 --- a/src/radeon_mergedfb.c +++ b/src/radeon_mergedfb.c @@ -211,18 +211,14 @@ RADEONCopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest, mode->VSyncEnd += dy; mode->VTotal += dy; - /* This is needed for not generating negative refesh rates in xrandr with the - faked DotClock below - */ - if (!(mode->VRefresh)) - mode->VRefresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal; - - /* Provide a sophisticated fake DotClock in order to trick the vidmode + /* Provide a fake VRefresh/DotClock in order to trick the vidmode * extension to allow selecting among a number of modes whose merged result * looks identical but consists of different modes for CRT1 and CRT2 */ - mode->Clock = (((i->Clock >> 3) + i->HTotal) << 16) | ((j->Clock >> 2) + j->HTotal); - mode->Clock ^= ((i->VTotal << 19) | (j->VTotal << 3)); + mode->VRefresh = (i->Clock * 1000.0 / i->HTotal / i->VTotal) * 100 + + (j->Clock * 1000.0 / j->HTotal / j->VTotal); + + mode->Clock = (int)(mode->VRefresh * 0.001 * mode->HTotal * mode->VTotal); if( ((mode->HDisplay * ((pScrn->bitsPerPixel + 7) / 8) * mode->VDisplay) > (pScrn->videoRam * 1024)) || -- cgit v1.2.3