From patchwork Sat Feb 12 01:15:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 551181 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1C1GMqW004487 for ; Sat, 12 Feb 2011 01:16:43 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CCA929E819 for ; Fri, 11 Feb 2011 17:16:22 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-fx0-f49.google.com (mail-fx0-f49.google.com [209.85.161.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 766B49E79D for ; Fri, 11 Feb 2011 17:15:43 -0800 (PST) Received: by fxm19 with SMTP id 19so3429668fxm.36 for ; Fri, 11 Feb 2011 17:15:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=BjNHzHUGg3S+uADT/QFQ6hI0FjF/D3WOhoE3GkvVhDQ=; b=sw0eIU7cTRefeB67Kfl9/CC9q5OozNHGJFgy4MIuzwf9YyFlrbdYCOCkILoFzLu0Bj p3YlLQii+s4EnIC7XYc+IbbZU9YLMoIcoQn/thZa9gsbhTfFS+f1AOUkXIvb62/WXa66 6B8VoGih3WKEoLLFIUkqyp/W4sbZd2CbZvGmg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=QCUOLTlYzDdzJwIJoazucIkVpaS3WtccAfT599PTASyWbLyFUuiDXs1/zK+0EShKpS lue59tGRab/nEYFFiVxqCslGxWlnFjv8LGpBoYHSk+1hVg+Dc9P9BKBuAE5f7C59z3zP hEMeUGvca4L4sruzqotVuGpXxOVvGQb4IoFqI= MIME-Version: 1.0 Received: by 10.223.83.7 with SMTP id d7mr1300525fal.82.1297473342184; Fri, 11 Feb 2011 17:15:42 -0800 (PST) Received: by 10.223.114.68 with HTTP; Fri, 11 Feb 2011 17:15:42 -0800 (PST) In-Reply-To: References: <4D51AD03.7030401@gmail.com> Date: Fri, 11 Feb 2011 20:15:42 -0500 Message-ID: Subject: Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in From: Alex Deucher To: Justin Mattock Cc: airlied@redhat.com, "linux-kernel@vger.kernel.org" , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 12 Feb 2011 01:16:43 +0000 (UTC) From b92bf64a4fc181c6a783cc0d51a6881fc8a353a7 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 11 Feb 2011 20:10:11 -0500 Subject: [PATCH] drm/radeon/kms: hopefully fix pll issues for real (v2) The problematic boards have a recommended reference divider to be used when spread spectrum is enabled on the laptop panel. Enable the use of the recommended reference divider along with the new pll algo. This should hopefully fix the issues across the board. v2: add some options to uncomment and try Signed-off-by: Alex Deucher Cc: stable@kernel.org --- drivers/gpu/drm/radeon/atombios_crtc.c | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 1bf6122..afa4c34 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c @@ -531,6 +531,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; else pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV; + /*pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;*/ } else { pll->flags |= RADEON_PLL_LEGACY; @@ -555,29 +556,27 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, dp_clock = dig_connector->dp_clock; } } -/* this might work properly with the new pll algo */ -#if 0 /* doesn't work properly on some laptops */ + /* use recommended ref_div for ss */ if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { if (ss_enabled) { if (ss->refdiv) { pll->flags |= RADEON_PLL_USE_REF_DIV; pll->reference_div = ss->refdiv; + /*if (ASIC_IS_AVIVO(rdev)) + pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;*/ } } } -#endif + if (ASIC_IS_AVIVO(rdev)) { /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) adjusted_clock = mode->clock * 2; if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; - /* rv515 needs more testing with this option */ - if (rdev->family != CHIP_RV515) { - if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) - pll->flags |= RADEON_PLL_IS_LCD; - } + if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) + pll->flags |= RADEON_PLL_IS_LCD; } else { if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; @@ -957,11 +956,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode /* adjust pixel clock as needed */ adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss); - /* rv515 seems happier with the old algo */ - if (rdev->family == CHIP_RV515) - radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, - &ref_div, &post_div); - else if (ASIC_IS_AVIVO(rdev)) + if (ASIC_IS_AVIVO(rdev)) radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div); else -- 1.7.1.1