Skip to content

Commit c4227e1

Browse files
almahallawyideak
authored andcommitted
drm/i915/display: Extend i915_display_info with Type-C port details
Expose key Type-C port data in i915_display_info to make it easier to understand the port configuration and active mode, especially whether the link is in DP-Alt or TBT-Alt, without having to scan kernel logs. Tested in DP-Alt, TBT-Alt, SST, and MST. Expected output: [CONNECTOR:290:DP-2]: status: connected TC Port: E/TC#2 mode: tbt-alt pin assignment: - max lanes: 4 physical dimensions: 600x340mm ... [CONNECTOR:263:DP-5]: status: connected TC Port: G/TC#4 mode: dp-alt pin assignment: C max lanes: 4 physical dimensions: 610x350mm v2: Use drm_printer (Ville) Lock/Unlock around the printf (Imre) v3: Forward Declaration drm_printer struct (Jani) v4: Handle MST connector with no active encoder (Imre) Add a delimiter between fields and ":" after the port name (Imre) v5: Init dig_port and use it in intel_encorder_is_tc and tc_info (Imre) Move tc->port_name to a newline (Imre) v6: Use intel_tc_port_lock/Unlock (Imre) Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Imre Deak <imre.deak@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Khaled Almahallawy <khaled.almahallawy@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20251028190753.3089937-1-khaled.almahallawy@intel.com
1 parent 44fde50 commit c4227e1

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

drivers/gpu/drm/i915/display/intel_display_debugfs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "intel_psr_regs.h"
4848
#include "intel_vdsc.h"
4949
#include "intel_wm.h"
50+
#include "intel_tc.h"
5051

5152
static struct intel_display *node_to_intel_display(struct drm_info_node *node)
5253
{
@@ -246,6 +247,8 @@ static void intel_connector_info(struct seq_file *m,
246247
{
247248
struct intel_connector *intel_connector = to_intel_connector(connector);
248249
const struct drm_display_mode *mode;
250+
struct drm_printer p = drm_seq_file_printer(m);
251+
struct intel_digital_port *dig_port = NULL;
249252

250253
seq_printf(m, "[CONNECTOR:%d:%s]: status: %s\n",
251254
connector->base.id, connector->name,
@@ -268,14 +271,19 @@ static void intel_connector_info(struct seq_file *m,
268271
intel_dp_mst_info(m, intel_connector);
269272
else
270273
intel_dp_info(m, intel_connector);
274+
dig_port = dp_to_dig_port(intel_attached_dp(intel_connector));
271275
break;
272276
case DRM_MODE_CONNECTOR_HDMIA:
273277
intel_hdmi_info(m, intel_connector);
278+
dig_port = hdmi_to_dig_port(intel_attached_hdmi(intel_connector));
274279
break;
275280
default:
276281
break;
277282
}
278283

284+
if (dig_port != NULL && intel_encoder_is_tc(&dig_port->base))
285+
intel_tc_info(&p, dig_port);
286+
279287
intel_hdcp_info(m, intel_connector);
280288

281289
seq_printf(m, "\tmax bpc: %u\n", connector->display_info.bpc);

drivers/gpu/drm/i915/display/intel_tc.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,19 @@ void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port,
17031703
mutex_unlock(&tc->lock);
17041704
}
17051705

1706+
void intel_tc_info(struct drm_printer *p, struct intel_digital_port *dig_port)
1707+
{
1708+
struct intel_tc_port *tc = to_tc_port(dig_port);
1709+
1710+
intel_tc_port_lock(dig_port);
1711+
drm_printf(p, "\tTC Port %s: mode: %s, pin assignment: %c, max lanes: %d\n",
1712+
tc->port_name,
1713+
tc_port_mode_name(tc->mode),
1714+
pin_assignment_name(tc->pin_assignment),
1715+
tc->max_lane_count);
1716+
intel_tc_port_unlock(dig_port);
1717+
}
1718+
17061719
/*
17071720
* The type-C ports are different because even when they are connected, they may
17081721
* not be available/usable by the graphics driver: see the comment on

drivers/gpu/drm/i915/display/intel_tc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/types.h>
1010

11+
struct drm_printer;
1112
struct intel_crtc_state;
1213
struct intel_digital_port;
1314
struct intel_encoder;
@@ -113,4 +114,6 @@ void intel_tc_port_cleanup(struct intel_digital_port *dig_port);
113114

114115
bool intel_tc_cold_requires_aux_pw(struct intel_digital_port *dig_port);
115116

117+
void intel_tc_info(struct drm_printer *p, struct intel_digital_port *dig_port);
118+
116119
#endif /* __INTEL_TC_H__ */

0 commit comments

Comments
 (0)