diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-07-13 11:08:18 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-07-15 03:13:22 -0400 |
commit | d0e275a90a81b37409a0cfbca77581e3d235f5cf (patch) | |
tree | 79a93ce519e39d1326bb23f38fa4549fc0950834 /drivers/gpu | |
parent | b995e4330de0d8b1b8b9e49ce10cc6dc78e2cbba (diff) |
drm/radeon/kms: add PLL flag to prefer frequencies <= the target freq
This is needed when using fractional feedback dividers on some IGP
chips.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 3efcf1a526be..bc312f3d9a0a 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -491,7 +491,11 @@ void radeon_compute_pll(struct radeon_pll *pll, | |||
491 | tmp += (uint64_t)pll->reference_freq * 1000 * frac_feedback_div; | 491 | tmp += (uint64_t)pll->reference_freq * 1000 * frac_feedback_div; |
492 | current_freq = radeon_div(tmp, ref_div * post_div); | 492 | current_freq = radeon_div(tmp, ref_div * post_div); |
493 | 493 | ||
494 | error = abs(current_freq - freq); | 494 | if (flags & RADEON_PLL_PREFER_CLOSEST_LOWER) { |
495 | error = freq - current_freq; | ||
496 | error = error < 0 ? 0xffffffff : error; | ||
497 | } else | ||
498 | error = abs(current_freq - freq); | ||
495 | vco_diff = abs(vco - best_vco); | 499 | vco_diff = abs(vco - best_vco); |
496 | 500 | ||
497 | if ((best_vco == 0 && error < best_error) || | 501 | if ((best_vco == 0 && error < best_error) || |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 86f766e868e7..38c1dd082441 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -124,6 +124,7 @@ struct radeon_tmds_pll { | |||
124 | #define RADEON_PLL_PREFER_LOW_POST_DIV (1 << 8) | 124 | #define RADEON_PLL_PREFER_LOW_POST_DIV (1 << 8) |
125 | #define RADEON_PLL_PREFER_HIGH_POST_DIV (1 << 9) | 125 | #define RADEON_PLL_PREFER_HIGH_POST_DIV (1 << 9) |
126 | #define RADEON_PLL_USE_FRAC_FB_DIV (1 << 10) | 126 | #define RADEON_PLL_USE_FRAC_FB_DIV (1 << 10) |
127 | #define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11) | ||
127 | 128 | ||
128 | struct radeon_pll { | 129 | struct radeon_pll { |
129 | uint16_t reference_freq; | 130 | uint16_t reference_freq; |