All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"shuahkhan@gmail.com" <shuahkhan@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: Linux 3.10-rc7
Date: Tue, 25 Jun 2013 13:08:16 -0700	[thread overview]
Message-ID: <20130625130816.55e6cb80@jbarnes-desktop> (raw)
In-Reply-To: <B8EFE96D1287C24090BAD9D858E15E617305B4@sisaex02sj>

On Tue, 25 Jun 2013 19:59:28 +0000
Shuah Khan <shuah.kh@samsung.com> wrote:

> On 06/25/2013 01:52 PM, Jesse Barnes wrote:
> > On Tue, 25 Jun 2013 21:37:37 +0200
> > Daniel Vetter <daniel.vetter@ffwll.ch> 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?

-- 
Jesse Barnes, Intel Open Source Technology Center

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");

WARNING: multiple messages have this Message-ID (diff)
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"shuahkhan@gmail.com" <shuahkhan@gmail.com>,
	Dave Airlie <airlied@redhat.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: Linux 3.10-rc7
Date: Tue, 25 Jun 2013 13:08:16 -0700	[thread overview]
Message-ID: <20130625130816.55e6cb80@jbarnes-desktop> (raw)
In-Reply-To: <B8EFE96D1287C24090BAD9D858E15E617305B4@sisaex02sj>

On Tue, 25 Jun 2013 19:59:28 +0000
Shuah Khan <shuah.kh@samsung.com> wrote:

> On 06/25/2013 01:52 PM, Jesse Barnes wrote:
> > On Tue, 25 Jun 2013 21:37:37 +0200
> > Daniel Vetter <daniel.vetter@ffwll.ch> 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?

-- 
Jesse Barnes, Intel Open Source Technology Center

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");


  reply	other threads:[~2013-06-25 20:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-22 21:04 Linux 3.10-rc7 Linus Torvalds
2013-06-24  0:00 ` Stephen Rothwell
2013-06-25 15:28 ` Shuah Khan
2013-06-25 19:05   ` Linus Torvalds
2013-06-25 19:37     ` Daniel Vetter
2013-06-25 19:37       ` Daniel Vetter
2013-06-25 19:54       ` Jesse Barnes
2013-06-25 19:59         ` Shuah Khan
2013-06-25 20:08           ` Jesse Barnes [this message]
2013-06-25 20:08             ` Jesse Barnes
2013-06-25 20:51             ` Shuah Khan
2013-06-25 20:54               ` Tomas Winkler
2013-06-25 20:57               ` Tomas Winkler
2013-06-25 20:57                 ` Tomas Winkler
2013-06-25 21:11                 ` Shuah Khan
2013-06-26 22:11                   ` Winkler, Tomas
2013-06-26 22:24                     ` Shuah Khan
2013-07-01 14:54                       ` Shuah Khan
2013-07-01 14:54                         ` Shuah Khan
2013-07-04 19:26                         ` Tomas Winkler
2013-07-04 19:26                           ` Tomas Winkler
2013-07-07 18:31                           ` Sören Brinkmann
2013-07-08 19:12                             ` Daniel Vetter
2013-06-25 21:09               ` Jesse Barnes
2013-06-25 21:09                 ` Jesse Barnes
2013-06-29 15:05 ` Sergey Meirovich
2013-06-29 18:11   ` Linus Torvalds
2013-06-29 21:07     ` Sergey Meirovich
2013-06-29 22:13       ` Linus Torvalds
2013-06-29 23:34         ` Dave Airlie
2013-06-29 23:34           ` Dave Airlie
2013-06-29 23:52         ` Sergey Meirovich
2013-06-30  0:11           ` Linus Torvalds
2013-06-30  0:11             ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130625130816.55e6cb80@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shuah.kh@samsung.com \
    --cc=shuahkhan@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.