diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index c78ac43..a34849a 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -159,6 +159,7 @@ RADEONComputePLL(RADEONPLLPtr pll, freq = freq * 1000; ErrorF("freq: %lu\n", freq); + flags |= RADEON_PLL_USE_FRAC_FB_DIV; if (flags & RADEON_PLL_USE_REF_DIV) min_ref_div = max_ref_div = pll->reference_div; @@ -230,7 +231,8 @@ RADEONComputePLL(RADEONPLLPtr pll, tmp += (CARD64)pll->reference_freq * 1000 * frac_feedback_div; current_freq = RADEONDiv(tmp, ref_div * post_div); - error = abs(current_freq - freq); + error = freq - current_freq; + error = error < 0 ? 0xFFFFFFFF : error; vco_diff = abs(vco - best_vco); if ((best_vco == 0 && error < best_error) ||