From patchwork Wed Feb 9 22:09:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 544961 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 p19M9XIl032129 for ; Wed, 9 Feb 2011 22:09:53 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E17349E93E for ; Wed, 9 Feb 2011 14:09:32 -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 31ACF9E75B for ; Wed, 9 Feb 2011 14:09:20 -0800 (PST) Received: by fxm19 with SMTP id 19so712079fxm.36 for ; Wed, 09 Feb 2011 14:09:19 -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=t95G1XfqHLsnHMpEDpVgzBULajoFzpHLi5qolSmtnBg=; b=UKUdDDiQnxo/WaJqvSOmoEvHU5+/3RQN/wvAsh5iook6MFMipYzvk0kuRMtJFM2Zs5 FMUZRJM/odkDcF7a1bGzIL/qlYjYpLaDmgnR45Aidf11RlAJXQ2wQMRRU/k8C6nOPjJ5 x5lcx+4nnWnsWQmxgXjeYT9oRlObnVvZDdaaE= 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=KvF8oBeXQQxzqBPqq8zpJ+D/K70D7lFYQYEt0+IuqQrPC1scVL1sgUTJ2W+6Gpzvt0 /hFTjpQDCKZ6bpU0HVtL/xtFwmTn4OWitlFFda5FypAyU1QTHtiqNiMz4rmpZgKySROc f5N2fuY4nbYaUG/8U6ACOlDyf9uAqIVUkJsjQ= MIME-Version: 1.0 Received: by 10.223.96.199 with SMTP id i7mr8749551fan.101.1297289358974; Wed, 09 Feb 2011 14:09:18 -0800 (PST) Received: by 10.223.114.68 with HTTP; Wed, 9 Feb 2011 14:09:18 -0800 (PST) In-Reply-To: References: <4D51AD03.7030401@gmail.com> Date: Wed, 9 Feb 2011 17:09:18 -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 P. 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]); Wed, 09 Feb 2011 22:09:54 +0000 (UTC) From c88cf9c2463629ab0cef7df8ade34750cde9b40a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 9 Feb 2011 17:05:07 -0500 Subject: [PATCH] drm/radeon/kms: pll quirk cleanup Default to legacy pll algo, add quirks for specific regressions. Fixes regressions reported in: https://bugzilla.kernel.org/show_bug.cgi?id=26552 Signed-off-by: Alex Deucher Cc: stable@kernel.org --- drivers/gpu/drm/radeon/atombios_crtc.c | 52 +++++++++++++++++++++++++------ drivers/gpu/drm/radeon/radeon_mode.h | 8 +++++ 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 4a505ba..cc6bdd8 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c @@ -31,6 +31,11 @@ #include "atom.h" #include "atom-bits.h" +static enum radeon_pll_algo +atombios_crtc_pick_pll_algo(struct drm_crtc *crtc, + struct drm_display_mode *mode, + uint32_t active_device); + static void atombios_overscan_setup(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) @@ -519,6 +524,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, /* reset the pll flags */ pll->flags = 0; + pll->algo = RADEON_PLL_ALGO_LEGACY; if (ASIC_IS_AVIVO(rdev)) { if ((rdev->family == CHIP_RS600) || @@ -584,6 +590,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, if (encoder->encoder_type == DRM_MODE_ENCODER_LVDS) pll->flags |= RADEON_PLL_USE_REF_DIV; } + pll->algo = atombios_crtc_pick_pll_algo(crtc, mode, radeon_encoder->active_device); break; } } @@ -839,29 +846,54 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc, atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); } -#define RADEON_PLL_ALGO_LEGACY 0 -#define RADEON_PLL_ALGO_AVIVO 1 -static int atombios_crtc_pick_pll_algo(struct drm_crtc *crtc, struct drm_display_mode *mode) +static enum radeon_pll_algo +atombios_crtc_pick_pll_algo(struct drm_crtc *crtc, + struct drm_display_mode *mode, + uint32_t active_device) { struct drm_device *dev = crtc->dev; - struct radeon_device *rdev = dev->dev_private; /* board specific quirks */ - /* funky macbooks */ + + /* legacy algo */ + /* macbookpro2,2 */ if ((dev->pdev->device == 0x71C5) && (dev->pdev->subsystem_vendor == 0x106b) && (dev->pdev->subsystem_device == 0x0080)) { return RADEON_PLL_ALGO_LEGACY; } - /* defaults */ - /* rv515 seems happier with the old algo */ - if (rdev->family == CHIP_RV515) + /* Thinkpad T60 */ + if ((dev->pdev->device == 0x7145) && + (dev->pdev->subsystem_vendor == 0x17aa) && + (dev->pdev->subsystem_device == 0x2006)) { return RADEON_PLL_ALGO_LEGACY; - else if (ASIC_IS_AVIVO(rdev)) + } + + /* Acer RS880 */ + if ((dev->pdev->device == 0x9712) && + (dev->pdev->subsystem_vendor == 0x1025) && + (dev->pdev->subsystem_device == 0x027d)) { + return RADEON_PLL_ALGO_LEGACY; + } + + /* avivo algo */ + /* PC Partner RV630 */ + if ((dev->pdev->device == 0x9589) && + (dev->pdev->subsystem_vendor == 0x174b) && + (dev->pdev->subsystem_device == 0xe410)) { return RADEON_PLL_ALGO_AVIVO; + } + + /* Toshiba Satellite A100 */ + if ((dev->pdev->device == 0x71C5) && + (dev->pdev->subsystem_vendor == 0x1179) && + (dev->pdev->subsystem_device == 0xff10)) { + return RADEON_PLL_ALGO_AVIVO; + } + /* default to the legacy algo */ return RADEON_PLL_ALGO_LEGACY; } @@ -983,7 +1015,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); - switch (atombios_crtc_pick_pll_algo(crtc, mode)) { + switch (pll->algo) { case RADEON_PLL_ALGO_LEGACY: default: radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index a670caa..1d760c6 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h @@ -151,6 +151,12 @@ struct radeon_tmds_pll { #define RADEON_PLL_IS_LCD (1 << 13) #define RADEON_PLL_PREFER_MINM_OVER_MAXP (1 << 14) +/* pll algo */ +enum radeon_pll_algo { + RADEON_PLL_ALGO_LEGACY, + RADEON_PLL_ALGO_AVIVO +}; + struct radeon_pll { /* reference frequency */ uint32_t reference_freq; @@ -183,6 +189,8 @@ struct radeon_pll { /* pll id */ uint32_t id; + /* pll algo */ + enum radeon_pll_algo algo; }; struct radeon_i2c_chan { -- 1.7.1.1