mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 19:13:03 -04:00
drm/i915/dp_link_caps: Add debugfs entry showing allowed configurations
Add a debugfs entry showing the currently allowed link configurations in the connector's iteration order. Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260701153204.4124150-12-imre.deak@intel.com
This commit is contained in:
@@ -1123,6 +1123,43 @@ static int i915_dp_max_lane_count_show(void *data, u64 *val)
|
||||
}
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(i915_dp_max_lane_count_fops, i915_dp_max_lane_count_show, NULL, "%llu\n");
|
||||
|
||||
static int intel_dp_allowed_link_configs_show(struct seq_file *m, void *data)
|
||||
{
|
||||
struct intel_connector *connector = to_intel_connector(m->private);
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
struct intel_dp *intel_dp = intel_attached_dp(connector);
|
||||
struct intel_dp_link_caps *link_caps = intel_dp->link.caps;
|
||||
struct intel_dp_link_config link_config;
|
||||
struct intel_dp_link_caps_iter iter;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
err = drm_modeset_lock_single_interruptible(&display->drm->mode_config.connection_mutex);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
intel_dp_flush_connector_commits(connector);
|
||||
|
||||
i = 0;
|
||||
intel_dp_link_caps_iter_start(&iter,
|
||||
link_caps,
|
||||
intel_dp_link_caps_connector_compute_order(connector),
|
||||
INTEL_DP_LINK_CAPS_FILTER_ALL);
|
||||
for_each_dp_link_config(&iter, &link_config) {
|
||||
seq_printf(m, "%s%dx%d",
|
||||
i ? " " : "",
|
||||
link_config.lane_count, link_config.rate);
|
||||
i++;
|
||||
}
|
||||
intel_dp_link_caps_iter_end(&iter);
|
||||
|
||||
drm_modeset_unlock(&display->drm->mode_config.connection_mutex);
|
||||
|
||||
seq_putc(m, '\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
DEFINE_SHOW_ATTRIBUTE(intel_dp_allowed_link_configs);
|
||||
|
||||
/**
|
||||
* intel_dp_link_caps_debugfs_add - add link caps debugfs files for a connector
|
||||
@@ -1149,6 +1186,9 @@ void intel_dp_link_caps_debugfs_add(struct intel_connector *connector)
|
||||
|
||||
debugfs_create_file("i915_dp_max_lane_count", 0444, root,
|
||||
connector, &i915_dp_max_lane_count_fops);
|
||||
|
||||
debugfs_create_file("intel_dp_allowed_link_configs", 0444, root,
|
||||
connector, &intel_dp_allowed_link_configs_fops);
|
||||
}
|
||||
|
||||
struct intel_dp_link_caps *intel_dp_link_caps_init(struct intel_dp *intel_dp)
|
||||
|
||||
Reference in New Issue
Block a user