All pastes #95213 Raw Edit

Something

public text v1 · immutable
#95213 ·published 2006-07-21 20:52 UTC
rendered paste body
--- a/src/radeon_mergedfb.c
+++ b/src/radeon_mergedfb.c
@@ -218,6 +218,12 @@ RADEONCopyModeNLink(ScrnInfoPtr pScrn, D
       */
     mode->Clock = (((i->Clock >> 3) + i->HTotal) << 16) | ((j->Clock >> 2) + j->HTotal);
     mode->Clock ^= ((i->VTotal << 19) | (j->VTotal << 3));
+    /* Make sure that the conversion from dotclock to refresh rates in
+     * xf86RandR.c/xf86RandRModeRefresh() gives <2^15 since xrandr represents
+     * refresh rate as short. Also, avoid blind trunctaion in the conversion.
+     */
+    mode->Clock %= 32749; /* largest prime smaller than 2^15 */
+    mode->Clock = (int)(mode->Clock * 0.001 * mode->HTotal * mode->VTotal);

     if( ((mode->HDisplay * ((pScrn->bitsPerPixel + 7) / 8) * mode->VDisplay) >
        (pScrn->videoRam * 1024)) ||