From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Fix psr sink status report.
Date: Fri, 20 Jul 2018 10:38:01 -0700 [thread overview]
Message-ID: <20180720173801.GC16907@intel.com> (raw)
In-Reply-To: <1532051520.28553.86.camel@intel.com>
On Thu, Jul 19, 2018 at 06:52:00PM -0700, Dhinakaran Pandiyan wrote:
> On Thu, 2018-07-19 at 17:31 -0700, Rodrigo Vivi wrote:
> > First of all don't try to read dpcd if PSR is not even supported.
> >
> > But also, if read failed return -EIO instead of reporting via a
> > backchannel.
> >
> > v2: fix dev_priv: At this level m->private is the connector. (CI/DK)
> > don't convert dpcd read errors to EIO. (DK)
> >
> > Fixes: 5b7b30864d1d ("drm/i915/psr: Split sink status into a separate
> > debugfs node")
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > Cc: José Roberto de Souza <jose.souza@intel.com>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_debugfs.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> > b/drivers/gpu/drm/i915/i915_debugfs.c
> > index b3aefd623557..59dc0610ea44 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -2606,13 +2606,22 @@ static int i915_psr_sink_status_show(struct
> > seq_file *m, void *data)
> > "sink internal error",
> > };
> > struct drm_connector *connector = m->private;
> > + struct drm_i915_private *dev_priv = to_i915(connector->dev);
> > struct intel_dp *intel_dp =
> > enc_to_intel_dp(&intel_attached_encoder(connector)-
> > >base);
> > + int ret;
> > +
> > + if (!CAN_PSR(dev_priv)) {
> > + seq_puts(m, "PSR Unsupported\n");
> > + return -ENODEV;
> > + }
> >
> > if (connector->status != connector_status_connected)
> > return -ENODEV;
> >
> > - if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_STATUS, &val)
> > == 1) {
> > + ret = drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_STATUS,
> > &val);
> > +
> > + if (ret == 1) {
> > const char *str = "unknown";
> >
> > val &= DP_PSR_SINK_STATE_MASK;
> > @@ -2620,7 +2629,7 @@ static int i915_psr_sink_status_show(struct
> > seq_file *m, void *data)
> > str = sink_status[val];
> > seq_printf(m, "Sink PSR status: 0x%x [%s]\n", val,
> > str);
> > } else {
>
> dpcd_readb() is not expected to return anything other than 1 or a
> negative error code, so this looks good.
> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
thanks, pushed.
>
>
> Are you also sending a similar fix for i915_dpcd_show()? That function
> also prints a DRM_ERROR() for failed aux transactions.
well... it is a bit different there because we cannot return in the middle
of the loop because we might want to get other regs read. but probably it
is a good idea to print the error message along with the reads so you don't
have to look to 2 places.
I will put a simple patch and we can wait until Jani is back from
vacation since he was the author there.
>
> > - DRM_ERROR("dpcd read (at %u) failed\n",
> > DP_PSR_STATUS);
> > + return ret;
> > }
> >
> > return 0;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-07-20 17:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 7:12 [PATCH] drm/i915: Fix psr sink status report Rodrigo Vivi
2018-07-19 7:42 ` ✗ Fi.CI.BAT: failure for drm/i915: Fix psr sink status report. (rev2) Patchwork
2018-07-20 0:31 ` [PATCH] drm/i915: Fix psr sink status report Rodrigo Vivi
2018-07-20 1:52 ` Dhinakaran Pandiyan
2018-07-20 17:38 ` Rodrigo Vivi [this message]
2018-07-20 21:37 ` Dhinakaran Pandiyan
2018-07-20 1:48 ` ✗ Fi.CI.BAT: failure for drm/i915: Fix psr sink status report. (rev3) Patchwork
2018-07-20 9:12 ` ✓ Fi.CI.IGT: success " Patchwork
2018-07-20 16:56 ` ✓ Fi.CI.BAT: " Patchwork
2018-07-21 16:19 ` ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-07-19 6:59 [PATCH] drm/i915: Fix psr sink status report Rodrigo Vivi
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=20180720173801.GC16907@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dhinakaran.pandiyan@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.