intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix psr sink status report.
@ 2018-07-19  7:12 Rodrigo Vivi
  2018-07-19  7:42 ` ✗ Fi.CI.BAT: failure for drm/i915: Fix psr sink status report. (rev2) Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Rodrigo Vivi @ 2018-07-19  7:12 UTC (permalink / raw)
  To: intel-gfx; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi

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.

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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index b3aefd623557..401aca53169d 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2594,6 +2594,7 @@ static const struct file_operations i915_guc_log_relay_fops = {
 
 static int i915_psr_sink_status_show(struct seq_file *m, void *data)
 {
+	struct drm_i915_private *dev_priv = node_to_i915(m->private);
 	u8 val;
 	static const char * const sink_status[] = {
 		"inactive",
@@ -2609,6 +2610,11 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data)
 	struct intel_dp *intel_dp =
 		enc_to_intel_dp(&intel_attached_encoder(connector)->base);
 
+	if (!CAN_PSR(dev_priv)) {
+		seq_puts(m, "PSR Unsupported\n");
+		return -ENODEV;
+	}
+
 	if (connector->status != connector_status_connected)
 		return -ENODEV;
 
@@ -2620,7 +2626,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 {
-		DRM_ERROR("dpcd read (at %u) failed\n", DP_PSR_STATUS);
+		return -EIO;
 	}
 
 	return 0;
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH] drm/i915: Fix psr sink status report.
@ 2018-07-19  6:59 Rodrigo Vivi
  0 siblings, 0 replies; 11+ messages in thread
From: Rodrigo Vivi @ 2018-07-19  6:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi

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.

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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index b3aefd623557..401aca53169d 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2594,6 +2594,7 @@ static const struct file_operations i915_guc_log_relay_fops = {
 
 static int i915_psr_sink_status_show(struct seq_file *m, void *data)
 {
+	struct drm_i915_private *dev_priv = node_to_i915(m->private);
 	u8 val;
 	static const char * const sink_status[] = {
 		"inactive",
@@ -2609,6 +2610,11 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data)
 	struct intel_dp *intel_dp =
 		enc_to_intel_dp(&intel_attached_encoder(connector)->base);
 
+	if (!CAN_PSR(dev_priv)) {
+		seq_puts(m, "PSR Unsupported\n");
+		return -ENODEV;
+	}
+
 	if (connector->status != connector_status_connected)
 		return -ENODEV;
 
@@ -2620,7 +2626,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 {
-		DRM_ERROR("dpcd read (at %u) failed\n", DP_PSR_STATUS);
+		return -EIO;
 	}
 
 	return 0;
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-07-21 16:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).