diff mbox

[v2,5/9] drm/i915/psr: Handle PSR RFB storage error

Message ID 20180418224311.16577-5-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Souza, Jose April 18, 2018, 10:43 p.m. UTC
Sink will interrupt source when it have any problem saving or reading
the remote frame buffer.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---

Changes from v1:
- printing a debug message when sink assert a error

 drivers/gpu/drm/i915/intel_psr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Dhinakaran Pandiyan April 26, 2018, 10:37 p.m. UTC | #1
On Wed, 2018-04-18 at 15:43 -0700, José Roberto de Souza wrote:
> Sink will interrupt source when it have any problem saving or reading
> the remote frame buffer.
> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> 
> Changes from v1:
> - printing a debug message when sink assert a error
> 
>  drivers/gpu/drm/i915/intel_psr.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 4cb27faab707..558b08a43f9e 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -1156,6 +1156,18 @@ void intel_psr_hpd_short_pulse_handle(struct intel_dp *intel_dp)
>  		intel_psr_exit(dev_priv);
>  	}
>  
> +	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_ERROR_STATUS, &val) != 1) {
> +		DRM_DEBUG_KMS("PSR_ERROR_STATUS read failed\n");
> +		goto dpcd_error;
> +	}
> +
> +	if (val & DP_PSR_RFB_STORAGE_ERROR) {
> +		DRM_DEBUG_KMS("PSR RFB storage error, exiting PSR\n");
> +		intel_psr_exit(dev_priv);

What do we achieve with an exit? Resetting PSR? I don't think that's
enough if the sink has storage errors. I think we should just disable
PSR here too.

> +	}
> +	/* clear status register */
> +	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_ERROR_STATUS, val);

So the other two errors are not handled, silently clearing them isn't
right. How about at least printing a debug with the read value and
saying the error wasn't handled?

> +
>  	/* TODO: handle other PSR/PSR2 errors */
>  dpcd_error:
>  	intel_psr_schedule_activate_work(dev_priv);
Souza, Jose April 30, 2018, 11:28 p.m. UTC | #2
On Thu, 2018-04-26 at 15:37 -0700, Dhinakaran Pandiyan wrote:
> 

> 

> On Wed, 2018-04-18 at 15:43 -0700, José Roberto de Souza wrote:

> > Sink will interrupt source when it have any problem saving or

> > reading

> > the remote frame buffer.

> > 

> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>

> > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

> > ---

> > 

> > Changes from v1:

> > - printing a debug message when sink assert a error

> > 

> >  drivers/gpu/drm/i915/intel_psr.c | 12 ++++++++++++

> >  1 file changed, 12 insertions(+)

> > 

> > diff --git a/drivers/gpu/drm/i915/intel_psr.c

> > b/drivers/gpu/drm/i915/intel_psr.c

> > index 4cb27faab707..558b08a43f9e 100644

> > --- a/drivers/gpu/drm/i915/intel_psr.c

> > +++ b/drivers/gpu/drm/i915/intel_psr.c

> > @@ -1156,6 +1156,18 @@ void intel_psr_hpd_short_pulse_handle(struct

> > intel_dp *intel_dp)

> >  		intel_psr_exit(dev_priv);

> >  	}

> >  

> > +	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_ERROR_STATUS,

> > &val) != 1) {

> > +		DRM_DEBUG_KMS("PSR_ERROR_STATUS read failed\n");

> > +		goto dpcd_error;

> > +	}

> > +

> > +	if (val & DP_PSR_RFB_STORAGE_ERROR) {

> > +		DRM_DEBUG_KMS("PSR RFB storage error, exiting

> > PSR\n");

> > +		intel_psr_exit(dev_priv);

> 

> What do we achieve with an exit? Resetting PSR? I don't think that's

> enough if the sink has storage errors. I think we should just disable

> PSR here too.


Disabling now.

> 

> > +	}

> > +	/* clear status register */

> > +	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_ERROR_STATUS,

> > val);

> 

> So the other two errors are not handled, silently clearing them isn't

> right. How about at least printing a debug with the read value and

> saying the error wasn't handled?


DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR is only applicable for PSR2 and to
sink report DP_PSR_LINK_CRC_ERROR a bit needs to be set in
DP_PSR_EN_CFG(both done in the next patch).

Do you still think that would be nice to print?

> 

> > +

> >  	/* TODO: handle other PSR/PSR2 errors */

> >  dpcd_error:

> >  	intel_psr_schedule_activate_work(dev_priv);

> 

>
Dhinakaran Pandiyan May 8, 2018, 10:16 p.m. UTC | #3
On Mon, 2018-04-30 at 23:28 +0000, Souza, Jose wrote:
> On Thu, 2018-04-26 at 15:37 -0700, Dhinakaran Pandiyan wrote:
> > 
> > 
> > 
> > On Wed, 2018-04-18 at 15:43 -0700, José Roberto de Souza wrote:
> > > 
> > > Sink will interrupt source when it have any problem saving or
> > > reading
> > > the remote frame buffer.
> > > 
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > ---
> > > 
> > > Changes from v1:
> > > - printing a debug message when sink assert a error
> > > 
> > >  drivers/gpu/drm/i915/intel_psr.c | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_psr.c
> > > b/drivers/gpu/drm/i915/intel_psr.c
> > > index 4cb27faab707..558b08a43f9e 100644
> > > --- a/drivers/gpu/drm/i915/intel_psr.c
> > > +++ b/drivers/gpu/drm/i915/intel_psr.c
> > > @@ -1156,6 +1156,18 @@ void
> > > intel_psr_hpd_short_pulse_handle(struct
> > > intel_dp *intel_dp)
> > >  		intel_psr_exit(dev_priv);
> > >  	}
> > >  
> > > +	if (drm_dp_dpcd_readb(&intel_dp->aux,
> > > DP_PSR_ERROR_STATUS,
> > > &val) != 1) {
> > > +		DRM_DEBUG_KMS("PSR_ERROR_STATUS read failed\n");
> > > +		goto dpcd_error;
> > > +	}
> > > +
> > > +	if (val & DP_PSR_RFB_STORAGE_ERROR) {
> > > +		DRM_DEBUG_KMS("PSR RFB storage error, exiting
> > > PSR\n");
> > > +		intel_psr_exit(dev_priv);
> > What do we achieve with an exit? Resetting PSR? I don't think
> > that's
> > enough if the sink has storage errors. I think we should just
> > disable
> > PSR here too.
> Disabling now.
> 
> > 
> > 
> > > 
> > > +	}
> > > +	/* clear status register */
> > > +	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_ERROR_STATUS,
> > > val);
> > So the other two errors are not handled, silently clearing them
> > isn't
> > right. How about at least printing a debug with the read value and
> > saying the error wasn't handled?
> DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR is only applicable for PSR2
Okay, but we do allow PSR2 with i915.enable_psr=1 right?

>  and to
> sink report DP_PSR_LINK_CRC_ERROR a bit needs to be set in
> DP_PSR_EN_CFG(both done in the next patch).
> 
> Do you still think that would be nice to print?
> > 
> > 
> > > 
> > > +
> > >  	/* TODO: handle other PSR/PSR2 errors */
> > >  dpcd_error:
> > >  	intel_psr_schedule_activate_work(dev_priv);
> > 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 4cb27faab707..558b08a43f9e 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -1156,6 +1156,18 @@  void intel_psr_hpd_short_pulse_handle(struct intel_dp *intel_dp)
 		intel_psr_exit(dev_priv);
 	}
 
+	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_ERROR_STATUS, &val) != 1) {
+		DRM_DEBUG_KMS("PSR_ERROR_STATUS read failed\n");
+		goto dpcd_error;
+	}
+
+	if (val & DP_PSR_RFB_STORAGE_ERROR) {
+		DRM_DEBUG_KMS("PSR RFB storage error, exiting PSR\n");
+		intel_psr_exit(dev_priv);
+	}
+	/* clear status register */
+	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_ERROR_STATUS, val);
+
 	/* TODO: handle other PSR/PSR2 errors */
 dpcd_error:
 	intel_psr_schedule_activate_work(dev_priv);