public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Handle runtime pm in the CRC setup code
Date: Tue, 25 Nov 2014 13:33:51 +0000	[thread overview]
Message-ID: <20141125133351.GD2506@strange.ger.corp.intel.com> (raw)
In-Reply-To: <1416920890-20614-1-git-send-email-daniel.vetter@ffwll.ch>

On Tue, Nov 25, 2014 at 02:08:10PM +0100, Daniel Vetter wrote:
> The crc code doesn't handle anything really that could drop the
> register state (by design so that we have less complexity). Which
> means userspace may only start crc capture once the pipe is fully set
> up.
> 
> With an i-g-t patch this will be the case, but there's still the
> problem that this results in obscure unclaimed register write
> failures. Which is a pain to debug.
> 
> So instead make sure we don't have the basic unclaimed register write
> failure by grabbing runtime pm references. And reject completely
> invalid requests with -EIO. This is still racy of course, but for a
> test library we don't really care - if userspace shuts down the pipe
> right afterwards the entire setup will be lost anyway.
> 
> v2: Put instead of get, spotted by Damien. Also explain the runtime pm
> dance.
> 
> v3: There's really no need for rpm get/put since power_is_enabled only
> checks software state (Damien).
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=86092
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Tested-by: lu hua <huax.lu@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index b50458360a2d..1da809fcc1df 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -3344,6 +3344,11 @@ static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
>  	if (pipe_crc->source && source)
>  		return -EINVAL;
>  
> +	if (!intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe))) {
> +		DRM_DEBUG_KMS("Trying to capture CRC while pipe is off\n");
> +		return -EIO;
> +	}
> +
>  	if (IS_GEN2(dev))
>  		ret = i8xx_pipe_crc_ctl_reg(&source, &val);
>  	else if (INTEL_INFO(dev)->gen < 5)
> -- 
> 2.1.1
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-11-25 13:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 15:23 [PATCH] drm/i915: Handle runtime pm in the CRC setup code Daniel Vetter
2014-11-24 15:36 ` Damien Lespiau
2014-11-24 20:11   ` Daniel Vetter
2014-11-24 20:43 ` Daniel Vetter
2014-11-25 11:00   ` [PATCH] drm/i915: Handle runtime pm in the CRC setup shuang.he
2014-11-25 12:12   ` [PATCH] drm/i915: Handle runtime pm in the CRC setup code Damien Lespiau
2014-11-25 12:58     ` Daniel Vetter
2014-11-25 13:08   ` Daniel Vetter
2014-11-25 13:33     ` Damien Lespiau [this message]
2014-11-26  7:32     ` [PATCH] drm/i915: Handle runtime pm in the CRC setup shuang.he
2014-11-25  1:20 ` shuang.he

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=20141125133351.GD2506@strange.ger.corp.intel.com \
    --to=damien.lespiau@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox