From patchwork Tue Jun 25 20:08:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 2780011 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC30FC0AB1 for ; Tue, 25 Jun 2013 20:06:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76922203DB for ; Tue, 25 Jun 2013 20:06:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 328EA203C4 for ; Tue, 25 Jun 2013 20:06:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 143B3E6131 for ; Tue, 25 Jun 2013 13:06:27 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from oproxy14-pub.unifiedlayer.com (oproxy14-pub.unifiedlayer.com [67.222.51.224]) by gabe.freedesktop.org (Postfix) with SMTP id 28001E5C98 for ; Tue, 25 Jun 2013 13:06:17 -0700 (PDT) Received: (qmail 30348 invoked by uid 0); 25 Jun 2013 20:06:15 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by oproxy14.unifiedlayer.com with SMTP; 25 Jun 2013 20:06:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=Content-Transfer-Encoding:Content-Type:Mime-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=V7t+8kna3lcmfKN3p6ASsh+1DPdR6TVNfgWzT1pfbwA=; b=TyacUCOgGPESIog4ELjpjjjpte/yssBmU9ogNucIQB1ZioOiRoOzwgTsMjCRdKkYd7onVvaYhvkDZFeD2NJVctRgryHzZe+Spfq5isZhGHS1kB9hcaPNjSLJel+XIROP; Received: from [67.161.37.189] (port=54261 helo=jbarnes-desktop) by box514.bluehost.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1UrZVH-0006cP-AP; Tue, 25 Jun 2013 14:06:15 -0600 Date: Tue, 25 Jun 2013 13:08:16 -0700 From: Jesse Barnes To: Shuah Khan Message-ID: <20130625130816.55e6cb80@jbarnes-desktop> In-Reply-To: References: <20130625125437.6e7bb2d4@jbarnes-desktop> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Cc: Daniel Vetter , intel-gfx , Linux Kernel Mailing List , "shuahkhan@gmail.com" , Dave Airlie , Linus Torvalds Subject: Re: [Intel-gfx] Linux 3.10-rc7 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 25 Jun 2013 19:59:28 +0000 Shuah Khan wrote: > On 06/25/2013 01:52 PM, Jesse Barnes wrote: > > On Tue, 25 Jun 2013 21:37:37 +0200 > > Daniel Vetter wrote: > > > > >> > >> Adding more lists to cc + Jesse since he's the guilty one for the > >> vt-switchless state restore stuff. > > > > Yeah, looks like we don't fetch the PLL state on resume from hibernate, > > leading to this warning. The refcount is nonzero, indicating the pll > > is in use, but the active field is clear, which means we're missing an > > update somewhere. > > > > Shuah, just to confirm, does your resume actually work ok aside from > > the warning? I *think* it's harmless in this case, but does indicate a > > real bug in our state tracking... trying to come up with a patch now. > > > > Thanks, > > > > Resume works just fine. I see it take longer for it to suspend compared > to 3.9.7 and then resumes just fine. Suspend taking longer very well > could be because of this warn_on. Other than this warn_on I haven't > noticed any other problems. Here's the patch I'm testing now, can you give it a try? diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 56746dc..df0caf0 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9289,6 +9289,49 @@ void i915_redisable_vga(struct drm_device *dev) } } +static void ironlake_crtc_pll_get(struct intel_crtc *crtc) +{ + struct drm_device *dev = crtc->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + u32 dpll_sel; + + if (HAS_PCH_IBX(dev_priv->dev)) + crtc->pch_pll = &dev_priv->pch_plls[crtc->pipe]; + + if (HAS_PCH_CPT(dev_priv->dev)) { + dpll_sel = I915_READ(PCH_DPLL_SEL); + + switch (crtc->pipe) { + case PIPE_A: + if ((dpll_sel & TRANSA_DPLL_ENABLE) && + (dpll_sel & TRANSA_DPLLB_SEL)) + crtc->pch_pll = &dev_priv->pch_plls[1]; + else if (dpll_sel & TRANSA_DPLL_ENABLE) + crtc->pch_pll = &dev_priv->pch_plls[0]; + break; + case PIPE_B: + if ((dpll_sel & TRANSB_DPLL_ENABLE) && + (dpll_sel & TRANSB_DPLLB_SEL)) + crtc->pch_pll = &dev_priv->pch_plls[1]; + else if (dpll_sel & TRANSB_DPLL_ENABLE) + crtc->pch_pll = &dev_priv->pch_plls[0]; + break; + case PIPE_C: + if ((dpll_sel & TRANSC_DPLL_ENABLE) && + (dpll_sel & TRANSC_DPLLB_SEL)) + crtc->pch_pll = &dev_priv->pch_plls[1]; + else if (dpll_sel & TRANSC_DPLL_ENABLE) + crtc->pch_pll = &dev_priv->pch_plls[0]; + break; + default: + BUG(); + } + } + + crtc->pch_pll->refcount++; + crtc->pch_pll->active = 1; +} + /* Scan out the current hw modeset state, sanitizes it and maps it into the drm * and i915 state tracking structures. */ void intel_modeset_setup_hw_state(struct drm_device *dev, @@ -9346,6 +9389,9 @@ setup_pipes: crtc->base.enabled = crtc->active; + if (crtc->active && HAS_PCH_SPLIT(dev)) + ironlake_crtc_pll_get(crtc); + DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n", crtc->base.base.id, crtc->active ? "enabled" : "disabled");