From patchwork Tue Feb 8 21:20:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 541971 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 p18LKlKV016394 for ; Tue, 8 Feb 2011 21:21:08 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD1929EFCE for ; Tue, 8 Feb 2011 13:20:46 -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 D62B69E811 for ; Tue, 8 Feb 2011 13:20:36 -0800 (PST) Received: by fxm19 with SMTP id 19so6737700fxm.36 for ; Tue, 08 Feb 2011 13:20:35 -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=mKv/XbKiSMNPpb7dHmJj3rfkhVac2+JMpz8gMQ0C1L0=; b=kmSRscM9iHqp/E2hgsuuHFQAnS3jWuyCi+oNBMpuzIsj56EquCPYI52z8bYtUXdf53 N4I0xSa4Dvm2ylAW6Y2BXgenxfLogvmRWvpORYFN+ZRHQIXC0CBqrWTdzMT9CjmSluY5 /BFk2tnvDn31ooTHzjVUXWa72NFW9jgYEYY7c= 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=JGLBKRPxuvsLltq0G9iu7lpJsuPRm+wCptnJPSJlqej8mnx+N2Lv1+8R+x8I3CE19B nHAXpTAhD+Sw/uah2FTs1Xr7Kf4V6lfwVsifO17erl1pRWR5GHL9mokdHX3MQt4oAFAE Jbr/Cp2zNjmU0cd8AFIQbnej+DWDGEZJPIhBM= MIME-Version: 1.0 Received: by 10.223.53.68 with SMTP id l4mr1966597fag.44.1297200035763; Tue, 08 Feb 2011 13:20:35 -0800 (PST) Received: by 10.223.114.68 with HTTP; Tue, 8 Feb 2011 13:20:35 -0800 (PST) In-Reply-To: <4D51AD03.7030401@gmail.com> References: <4D51AD03.7030401@gmail.com> Date: Tue, 8 Feb 2011 16:20:35 -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]); Tue, 08 Feb 2011 21:21:08 +0000 (UTC) From 1fce058d7f063b481a274b0a653ffad94f5e9b23 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 8 Feb 2011 16:13:27 -0500 Subject: [PATCH] drm/radeon/kms: fix pll algo quirk function I'm sick of fighting this. Just add a new pick_pll_algo() function and quirk specific boards as they are reported. Add a quirk for the pll algo selection on the MacBookPro2,2. Reported-by: Justin P. Mattock Signed-off-by: Alex Deucher Cc: stable@kernel.org --- drivers/gpu/drm/radeon/atombios_crtc.c | 39 +++++++++++++++++++++++++++----- 1 files changed, 33 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index dd4e3ac..4a505ba 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c @@ -839,6 +839,32 @@ 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) +{ + struct drm_device *dev = crtc->dev; + struct radeon_device *rdev = dev->dev_private; + + /* board specific quirks */ + /* funky macbooks */ + 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) + return RADEON_PLL_ALGO_LEGACY; + else if (ASIC_IS_AVIVO(rdev)) + return RADEON_PLL_ALGO_AVIVO; + + return RADEON_PLL_ALGO_LEGACY; +} + static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) { struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); @@ -957,16 +983,17 @@ 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) + switch (atombios_crtc_pick_pll_algo(crtc, mode)) { + case RADEON_PLL_ALGO_LEGACY: + default: radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div); - else if (ASIC_IS_AVIVO(rdev)) + break; + case RADEON_PLL_ALGO_AVIVO: radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div); - else - radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, - &ref_div, &post_div); + break; + }; atombios_crtc_program_ss(crtc, ATOM_DISABLE, radeon_crtc->pll_id, &ss); -- 1.7.1.1