From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: check the power wells on assert_{cursor, plane} Date: Thu, 17 Jul 2014 10:38:49 +0200 Message-ID: <20140717083849.GD15237@phenom.ffwll.local> References: <1405541195-3642-1-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 9203A89DA9 for ; Thu, 17 Jul 2014 01:38:48 -0700 (PDT) Received: by mail-wi0-f170.google.com with SMTP id f8so6073606wiw.3 for ; Thu, 17 Jul 2014 01:38:45 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1405541195-3642-1-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Wed, Jul 16, 2014 at 05:06:34PM -0300, Paulo Zanoni wrote: > From: Paulo Zanoni > > Since we merged runtime PM support for DPMS, it is possible that these > functions will be called when the power wells are disabled but a mode > is "set", resulting in "failed assertion" and "device suspended while > reading register" WARNs. > > To reproduce the bug: disable all screens using mode unset, do a > modeset on one screen, disable it using DPMS, then try to do a mode > unset on it again to see the WARNs. > > Testcase: igt/rpm_rpm/dpms-mode-unset-lpsp > Testcase: igt/rpm_rpm/dpms-mode-unset-non-lpsp > Signed-off-by: Paulo Zanoni Hm, where do we call these asserts while the pipe is off? Do you have some example backtraces at hand? -Daniel > --- > drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 54e3af9..7ad46e2 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -1216,7 +1216,9 @@ static void assert_cursor(struct drm_i915_private *dev_priv, > struct drm_device *dev = dev_priv->dev; > bool cur_state; > > - if (IS_845G(dev) || IS_I865G(dev)) > + if (!intel_display_power_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe))) > + cur_state = false; > + else if (IS_845G(dev) || IS_I865G(dev)) > cur_state = I915_READ(_CURACNTR) & CURSOR_ENABLE; > else > cur_state = I915_READ(CURCNTR(pipe)) & CURSOR_MODE; > @@ -1262,9 +1264,13 @@ static void assert_plane(struct drm_i915_private *dev_priv, > u32 val; > bool cur_state; > > - reg = DSPCNTR(plane); > - val = I915_READ(reg); > - cur_state = !!(val & DISPLAY_PLANE_ENABLE); > + if (!intel_display_power_enabled(dev_priv, POWER_DOMAIN_PIPE(plane))) { > + cur_state = false; > + } else { > + reg = DSPCNTR(plane); > + val = I915_READ(reg); > + cur_state = !!(val & DISPLAY_PLANE_ENABLE); > + } > WARN(cur_state != state, > "plane %c assertion failure (expected %s, current %s)\n", > plane_name(plane), state_string(state), state_string(cur_state)); > -- > 2.0.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch