[Intel-gfx] [PATCH] drm/i915/psr: Split sink status into a separate debugfs node
Chris Wilson
chris at chris-wilson.co.uk
Thu Jul 19 06:18:59 UTC 2018
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 at intel.com>
> Cc: José Roberto de Souza <jose.souza at intel.com>
> Suggested-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at 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?
Why report it via a backchannel when you are already directly
communicating with the user?!!!
Please fix this mess.
-Chris
More information about the Intel-gfx
mailing list