diff options
Diffstat (limited to 'src/radeon_crtc.c')
-rw-r--r-- | src/radeon_crtc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index c78ac43b..3899064f 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -230,7 +230,11 @@ 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); + if (flags & RADEON_PLL_PREFER_CLOSEST_LOWER) { + error = freq - current_freq; + error = error < 0 ? 0xffffffff : error; + } else + error = abs(current_freq - freq); vco_diff = abs(vco - best_vco); if ((best_vco == 0 && error < best_error) || |