Commit 09b98517 authored by Jani Nikula's avatar Jani Nikula

drm/i915/psr: switch PSR debugfs to struct intel_connector

Prefer struct intel_connector over struct drm_connector.

Cc: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJouni Högander <jouni.hogander@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230317134144.223936-2-jani.nikula@intel.com
parent 5cc0de45
...@@ -2879,7 +2879,8 @@ void intel_psr_debugfs_register(struct drm_i915_private *i915) ...@@ -2879,7 +2879,8 @@ void intel_psr_debugfs_register(struct drm_i915_private *i915)
static int i915_psr_sink_status_show(struct seq_file *m, void *data) static int i915_psr_sink_status_show(struct seq_file *m, void *data)
{ {
u8 val; struct intel_connector *connector = m->private;
struct intel_dp *intel_dp = intel_attached_dp(connector);
static const char * const sink_status[] = { static const char * const sink_status[] = {
"inactive", "inactive",
"transition to active, capture and display", "transition to active, capture and display",
...@@ -2890,17 +2891,15 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data) ...@@ -2890,17 +2891,15 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data)
"reserved", "reserved",
"sink internal error", "sink internal error",
}; };
struct drm_connector *connector = m->private;
struct intel_dp *intel_dp =
intel_attached_dp(to_intel_connector(connector));
int ret; int ret;
u8 val;
if (!CAN_PSR(intel_dp)) { if (!CAN_PSR(intel_dp)) {
seq_puts(m, "PSR Unsupported\n"); seq_puts(m, "PSR Unsupported\n");
return -ENODEV; return -ENODEV;
} }
if (connector->status != connector_status_connected) if (connector->base.status != connector_status_connected)
return -ENODEV; return -ENODEV;
ret = drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_STATUS, &val); ret = drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_STATUS, &val);
...@@ -2922,21 +2921,19 @@ DEFINE_SHOW_ATTRIBUTE(i915_psr_sink_status); ...@@ -2922,21 +2921,19 @@ DEFINE_SHOW_ATTRIBUTE(i915_psr_sink_status);
static int i915_psr_status_show(struct seq_file *m, void *data) static int i915_psr_status_show(struct seq_file *m, void *data)
{ {
struct drm_connector *connector = m->private; struct intel_connector *connector = m->private;
struct intel_dp *intel_dp = struct intel_dp *intel_dp = intel_attached_dp(connector);
intel_attached_dp(to_intel_connector(connector));
return intel_psr_status(m, intel_dp); return intel_psr_status(m, intel_dp);
} }
DEFINE_SHOW_ATTRIBUTE(i915_psr_status); DEFINE_SHOW_ATTRIBUTE(i915_psr_status);
void intel_psr_connector_debugfs_add(struct intel_connector *intel_connector) void intel_psr_connector_debugfs_add(struct intel_connector *connector)
{ {
struct drm_connector *connector = &intel_connector->base; struct drm_i915_private *i915 = to_i915(connector->base.dev);
struct drm_i915_private *i915 = to_i915(connector->dev); struct dentry *root = connector->base.debugfs_entry;
struct dentry *root = connector->debugfs_entry;
if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) if (connector->base.connector_type != DRM_MODE_CONNECTOR_eDP)
return; return;
debugfs_create_file("i915_psr_sink_status", 0444, root, debugfs_create_file("i915_psr_sink_status", 0444, root,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment