From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/psr: Split sink status into a separate debugfs node
Date: Thu, 19 Jul 2018 00:00:51 -0700 [thread overview]
Message-ID: <20180719070051.GA31791@intel.com> (raw)
In-Reply-To: <1531984719.28553.69.camel@intel.com>
On Thu, Jul 19, 2018 at 12:18:39AM -0700, Dhinakaran Pandiyan wrote:
> On Thu, 2018-07-19 at 07:18 +0100, Chris Wilson wrote:
> > Quoting Dhinakaran Pandiyan (2018-07-05 01:31:21)
> > >
> > > This allows to read i915_edp_psr_status from tests without
> > > triggering
> > > any AUX communication. Take this opportunity to move this under the
> > > eDP-1 connector directory as the status we print is of the sink.
> > >
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Cc: José Roberto de Souza <jose.souza@intel.com>
> > > Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/i915_debugfs.c | 69 +++++++++++++++++++++--
> > > --------------
> > > 1 file changed, 39 insertions(+), 30 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> > > b/drivers/gpu/drm/i915/i915_debugfs.c
> > > index f6142d78ede4..5069d5dedafe 100644
> > > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > > @@ -2592,6 +2592,41 @@ static const struct file_operations
> > > i915_guc_log_relay_fops = {
> > > .release = i915_guc_log_relay_release,
> > > };
> > >
> > > +static int i915_psr_sink_status_show(struct seq_file *m, void
> > > *data)
> > > +{
> > > + u8 val;
> > > + static const char * const sink_status[] = {
> > > + "inactive",
> > > + "transition to active, capture and display",
> > > + "active, display from RFB",
> > > + "active, capture and display on sink device
> > > timings",
> > > + "transition to inactive, capture and display,
> > > timing re-sync",
> > > + "reserved",
> > > + "reserved",
> > > + "sink internal error",
> > > + };
> > > + struct drm_connector *connector = m->private;
> > > + struct intel_dp *intel_dp =
> > > + enc_to_intel_dp(&intel_attached_encoder(connector)-
> > > >base);
> > > +
> > > + if (connector->status != connector_status_connected)
> > > + return -ENODEV;
> > > +
> > > + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_STATUS, &val)
> > > == 1) {
> > > + const char *str = "unknown";
> > > +
> > > + val &= DP_PSR_SINK_STATE_MASK;
> > > + if (val < ARRAY_SIZE(sink_status))
> > > + str = sink_status[val];
> > > + seq_printf(m, "Sink PSR status: 0x%x [%s]\n", val,
> > > str);
> > > + } else {
> > > + DRM_ERROR("dpcd read (at %u) failed\n",
> > > DP_PSR_STATUS);
> > Why is this common occurrence (any DP that doesn't support PSR) an
> > error?
> We create this file only for eDPs and I did not think dpcd_read would
> return an error if the panel did not support PSR. Do you happen to have
> any logs?
>
> > Why report it via a backchannel when you are already directly
> > communicating with the user?!!!
> >
> You are right, i915_dpcd_show() also has the same issue. How about
> returning the error to the user?
>
> @@ -2595,6 +2595,7 @@ static const struct file_operations
> i915_guc_log_relay_fops = {
> static int i915_psr_sink_status_show(struct seq_file *m, void *data)
> {
> u8 val;
> + int ret;
> static const char * const sink_status[] = {
> "inactive",
> "transition to active, capture and display",
> @@ -2605,6 +2606,7 @@ static int i915_psr_sink_status_show(struct
> seq_file *m, void *data)
> "reserved",
> "sink internal error",
> };
> + const char *str = "unknown";
> struct drm_connector *connector = m->private;
> struct intel_dp *intel_dp =
> enc_to_intel_dp(&intel_attached_encoder(connector)-
> >base);
> @@ -2612,17 +2614,16 @@ static int i915_psr_sink_status_show(struct
> seq_file *m, void *data)
> if (connector->status != connector_status_connected)
> return -ENODEV;
>
> - if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_STATUS, &val) ==
> 1) {
> - const char *str = "unknown";
> + ret = drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_STATUS, &val);
>
> + if (ret < 0) {
> + return ret;
> + } else if (ret == 1) {
> val &= DP_PSR_SINK_STATE_MASK;
> if (val < ARRAY_SIZE(sink_status))
> str = sink_status[val];
> - seq_printf(m, "Sink PSR status: 0x%x [%s]\n", val,
> str);
> - } else {
> - DRM_ERROR("dpcd read (at %u) failed\n", DP_PSR_STATUS);
> }
> -
> + seq_printf(m, "Sink PSR status: 0x%x [%s]\n", val, str);
> return 0;
> }
ops, just saw this after sending the patch...
I think this should work as well.
However I believe it is better not even read the dpcd if psr is not supported.
>
> > Please fix this mess.
> > -Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2018-07-19 7:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 0:31 [PATCH] drm/i915/psr: Split sink status into a separate debugfs node Dhinakaran Pandiyan
2018-07-05 0:37 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-07-05 0:55 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-05 4:54 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-07-05 21:04 ` [PATCH] " Rodrigo Vivi
2018-07-05 21:27 ` Dhinakaran Pandiyan
2018-07-05 21:37 ` Rodrigo Vivi
2018-07-05 22:42 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-07-06 13:43 ` ✓ Fi.CI.IGT: " Patchwork
2018-07-12 23:26 ` [PATCH] " Rodrigo Vivi
2018-07-13 3:10 ` Dhinakaran Pandiyan
2018-07-19 6:18 ` Chris Wilson
2018-07-19 7:18 ` Dhinakaran Pandiyan
2018-07-19 7:00 ` Rodrigo Vivi [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=20180719070051.GA31791@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dhinakaran.pandiyan@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;
as well as URLs for NNTP newsgroup(s).