public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org,
	Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915: Be defensive and don't assume PSR has any commit to sync against
Date: Tue, 4 Sep 2018 20:39:53 +0300	[thread overview]
Message-ID: <20180904173953.GI5565@intel.com> (raw)
In-Reply-To: <20180904162902.2578-1-chris@chris-wilson.co.uk>

On Tue, Sep 04, 2018 at 05:29:02PM +0100, Chris Wilson wrote:
> If the previous modeset commit has completed and is no longer part of
> the crtc state, skip waiting for it.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107792
> Fixes: c44301fce614 ("drm/i915: Allow control of PSR at runtime through debugfs, v6")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_psr.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 21984d4c08ed..bddc9c7c681e 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -834,6 +834,7 @@ int intel_psr_set_debugfs_mode(struct drm_i915_private *dev_priv,
>  	struct drm_device *dev = &dev_priv->drm;
>  	struct drm_connector_state *conn_state;
>  	struct intel_crtc_state *crtc_state = NULL;
> +	struct drm_crtc_commit *commit = NULL;
>  	struct drm_crtc *crtc;
>  	struct intel_dp *dp;
>  	int ret;
> @@ -860,12 +861,15 @@ int intel_psr_set_debugfs_mode(struct drm_i915_private *dev_priv,
>  			return ret;
>  
>  		crtc_state = to_intel_crtc_state(crtc->state);
> -		ret = wait_for_completion_interruptible(&crtc_state->base.commit->hw_done);
> -	} else
> -		ret = wait_for_completion_interruptible(&conn_state->commit->hw_done);
> -
> -	if (ret)
> -		return ret;
> +		commit = crtc_state->base.commit;
> +	} else {
> +		commit = conn_state->commit;

I can't even find where we clear state->commit after its done.
Do we just leave it pointing at freed memory or something? Also I
can't figure out why drm_atomic_helper_commit_hw_done() copies
the commit also to the old state.

> +	}
> +	if (commit) {
> +		ret = wait_for_completion_interruptible(&commit->hw_done);
> +		if (ret)
> +			return ret;
> +	}
>  
>  	ret = mutex_lock_interruptible(&dev_priv->psr.lock);
>  	if (ret)
> -- 
> 2.19.0.rc1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-09-04 17:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 16:29 [PATCH] drm/i915: Be defensive and don't assume PSR has any commit to sync against Chris Wilson
2018-09-04 16:59 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-09-04 17:39 ` Ville Syrjälä [this message]
2018-09-04 17:44   ` [PATCH] " Chris Wilson
2018-09-04 17:59     ` Ville Syrjälä
2018-09-04 18:06       ` Ville Syrjälä
2018-09-04 18:12         ` Chris Wilson
2018-09-04 20:54           ` Pandiyan, Dhinakaran
2018-09-05 10:22             ` Ville Syrjälä
2018-09-05 10:51               ` Maarten Lankhorst
2018-09-05 17:12                 ` Pandiyan, Dhinakaran
2018-09-04 23:55 ` ✓ Fi.CI.IGT: success for " Patchwork

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=20180904173953.GI5565@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.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