diff mbox series

[2/2] drm/i915/display: Support Multiple Transcoders' PSR status on debugfs

Message ID 20201103015045.109306-2-gwan-gyeong.mun@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915/display: Support PSR Multiple Transcoders | expand

Commit Message

Gwan-gyeong Mun Nov. 3, 2020, 1:50 a.m. UTC
In order to support the PSR state of each transcoder, it adds
i915_psr_status to sub-directory of each transcoder.

Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
---
 .../drm/i915/display/intel_display_debugfs.c  | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index b87c321b2bf5..2c5c6097dfd2 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -2091,6 +2091,23 @@  static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data)
 }
 DEFINE_SHOW_ATTRIBUTE(i915_hdcp_sink_capability);
 
+static int i915_psr_status_show(struct seq_file *m, void *data)
+{
+	struct drm_connector *connector = m->private;
+	struct intel_dp *intel_dp =
+		intel_attached_dp(to_intel_connector(connector));
+	struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
+
+	if (connector->status != connector_status_connected)
+		return -ENODEV;
+
+	if (!HAS_PSR(dev_priv))
+		return -ENODEV;
+
+	return intel_psr_status(m, intel_dp);
+}
+DEFINE_SHOW_ATTRIBUTE(i915_psr_status);
+
 #define LPSP_CAPABLE(COND) (COND ? seq_puts(m, "LPSP: capable\n") : \
 				seq_puts(m, "LPSP: incapable\n"))
 
@@ -2266,6 +2283,12 @@  int intel_connector_debugfs_add(struct drm_connector *connector)
 				    connector, &i915_psr_sink_status_fops);
 	}
 
+	if (INTEL_GEN(dev_priv) >= 12 &&
+	    connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+		debugfs_create_file("i915_psr_status", S_IRUGO, root,
+				    connector, &i915_psr_status_fops);
+	}
+
 	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
 	    connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
 	    connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) {