xf86-video-ati: Branch 'master' - 2 commits

Alex Deucher agd5f at kemper.freedesktop.org
Thu Jun 11 09:38:16 PDT 2009


 src/atombios_crtc.c |    1 +
 src/radeon.h        |    1 +
 src/radeon_crtc.c   |    6 +++++-
 3 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit d095bb3157faaee10b0130ea9b1032e0b533aaee
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Thu Jun 11 12:34:15 2009 -0400

    Re-enable frac feedback dividers on AVIVO hardware
    
    Preferring a freq <= target frequency seems to fix the
    previous issues with frac fb divs.  Appears to work fine
    on all hardware I've tested on.  See fdo bug 22229 for
    details.  Should fix bugs: 22229, 21553, 21413, and
    possibly other ones related to unstable images at certain
    resolutions.

diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index f331800..ae7e65e 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -276,6 +276,7 @@ atombios_crtc_set_pll(xf86CrtcPtr crtc, DisplayModePtr mode)
 
     memset(&spc_param, 0, sizeof(spc_param));
     if (IS_AVIVO_VARIANT) {
+	pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV | RADEON_PLL_PREFER_CLOSEST_LOWER;
 	if (IS_DCE3_VARIANT && mode->Clock > 200000) /* range limits??? */
 	    pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
 	else
commit 55fbdbae83d1563b472f49d0436c9298e390be66
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Thu Jun 11 12:31:53 2009 -0400

    Add PLL flag to prefer frequencies <= the target freq
    
    This appears to be needed when using fractional feedback
    dividers.  Based on a patch from Tom Hirst.  See fdo
    bug 22229 for more details.

diff --git a/src/radeon.h b/src/radeon.h
index d460401..2145de5 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -262,6 +262,7 @@ typedef struct {
 #define RADEON_PLL_PREFER_LOW_POST_DIV  (1 << 8)
 #define RADEON_PLL_PREFER_HIGH_POST_DIV (1 << 9)
 #define RADEON_PLL_USE_FRAC_FB_DIV      (1 << 10)
+#define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11)
 
 typedef struct {
     uint16_t          reference_freq;
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index c78ac43..3899064 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) ||


More information about the xorg-commit mailing list