public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH] drm/i915: check the power wells on assert_{cursor, plane}
Date: Thu, 17 Jul 2014 10:38:49 +0200	[thread overview]
Message-ID: <20140717083849.GD15237@phenom.ffwll.local> (raw)
In-Reply-To: <1405541195-3642-1-git-send-email-przanoni@gmail.com>

On Wed, Jul 16, 2014 at 05:06:34PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> 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 <paulo.r.zanoni@intel.com>

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

  parent reply	other threads:[~2014-07-17  8:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 20:06 [PATCH] drm/i915: check the power wells on assert_{cursor, plane} Paulo Zanoni
2014-07-16 20:06 ` [PATCH] tests/pm_rpm: add dpms-mode-unset{, -non}-lpsp subtests Paulo Zanoni
2014-07-17  8:38 ` Daniel Vetter [this message]
2014-07-17 12:53   ` [PATCH] drm/i915: check the power wells on assert_{cursor, plane} Paulo Zanoni
2014-07-17 13:23     ` Daniel Vetter
2014-07-17 13:29       ` Paulo Zanoni
2014-07-17 16:58         ` Daniel Vetter
2014-07-17 19:31           ` Paulo Zanoni
2014-07-17 14:16       ` [PATCH] drm/i915: remove plane/cursor/pipe assertions from intel_crtc_disable Paulo Zanoni
2014-07-17 17:16         ` Daniel Vetter

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=20140717083849.GD15237@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=przanoni@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox