Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/915/psr: Set psr.source_ok during atomic_check
Date: Thu, 14 Dec 2017 19:50:13 +0000	[thread overview]
Message-ID: <1513282303.9641.16.camel@dk-H97M-D3H> (raw)
In-Reply-To: <20171214150628.GE10981@intel.com>


On Thu, 2017-12-14 at 17:06 +0200, Ville Syrjälä wrote:
> On Tue, Dec 12, 2017 at 04:59:34PM -0800, Dhinakaran Pandiyan wrote:
> > Since commit 4d90f2d507ab ("drm/i915: Start tracking PSR state in crtc
> > state"), we check whether PSR can be enabled or not in
> > psr_compute_config(). Given that the psr.source_ok field is supposed to
> > track this check, set the field in psr_compute_config() as well.
> 
> NAK. compute_config() isn't allowed to change global state since the
> modeset can still fail later, or this might in fact be a
> TEST_ONLY operation.

I thought of it, but the only purpose of this flag is in debugfs to
indicate PSR requirements were met. It is not checked anywhere in the
driver. Setting this flag during commit (in intel_psr_enable) is
redundant because psr.enabled, exposed via debugfs, already provides
that information. By moving this flag to where PSR conditions are
checked, this could give a hint that something went wrong if PSR was not
enabled when PSR conditions were met.


Basically, I don't see any use for this flag the way it is set now. The
other idea I was considering is killing this flag and exposing a
no_fbc_reason type string.


> 
> > 
> > Now tests can distinguish between PSR not enabled due to unmet mode
> > requirements and something going wrong during commit.
> > 
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_psr.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> > index a1ad85fa5c1a..b59a956047ff 100644
> > --- a/drivers/gpu/drm/i915/intel_psr.c
> > +++ b/drivers/gpu/drm/i915/intel_psr.c
> > @@ -358,6 +358,8 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
> >  		&crtc_state->base.adjusted_mode;
> >  	int psr_setup_time;
> >  
> > +	dev_priv->psr.source_ok = false;
> > +
> >  	if (!HAS_PSR(dev_priv))
> >  		return;
> >  
> > @@ -420,7 +422,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
> >  	 * caps during eDP detection.
> >  	 */
> >  	if (!dev_priv->psr.psr2_support) {
> > -		crtc_state->has_psr = true;
> > +		dev_priv->psr.source_ok = (crtc_state->has_psr = true);
> >  		return;
> >  	}
> >  
> > @@ -440,7 +442,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
> >  		return;
> >  	}
> >  
> > -	crtc_state->has_psr = true;
> > +	dev_priv->psr.source_ok = (crtc_state->has_psr = true);
> >  	crtc_state->has_psr2 = true;
> >  }
> >  
> > @@ -522,8 +524,6 @@ void intel_psr_enable(struct intel_dp *intel_dp,
> >  	}
> >  
> >  	dev_priv->psr.psr2_support = crtc_state->has_psr2;
> > -	dev_priv->psr.source_ok = true;
> > -
> >  	dev_priv->psr.busy_frontbuffer_bits = 0;
> >  
> >  	dev_priv->psr.setup_vsc(intel_dp, crtc_state);
> > @@ -657,7 +657,7 @@ void intel_psr_disable(struct intel_dp *intel_dp,
> >  	/* Disable PSR on Sink */
> >  	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
> >  
> > -	dev_priv->psr.enabled = NULL;
> > +	dev_priv->psr.source_ok = (dev_priv->psr.enabled = NULL);
> >  	mutex_unlock(&dev_priv->psr.lock);
> >  
> >  	cancel_delayed_work_sync(&dev_priv->psr.work);
> > -- 
> > 2.11.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2017-12-14 19:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  0:59 [PATCH] drm/915/psr: Set psr.source_ok during atomic_check Dhinakaran Pandiyan
2017-12-13  1:28 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-13  2:15 ` ✓ Fi.CI.IGT: " Patchwork
2017-12-14 15:06 ` [PATCH] " Ville Syrjälä
2017-12-14 19:50   ` Pandiyan, Dhinakaran [this message]

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=1513282303.9641.16.camel@dk-H97M-D3H \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@linux.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