Fix looking at encoder->type in debugfs.
Subsystems (2)
cover Fix looking at encoder->type in debugfs.
This is required for patch "[PATCH 12/12] drm/i915: Stop frobbing with DDI encoder->type", otherwise debugfs will not give all info when encoder->type == DDI.
Maarten Lankhorst (4):
drm/i915: Use connector->name in drrs debugfs.
drm/i915: Use connector_type instead of intel_encoder->type for DP. drm/i915: Use atomic state and connector_type in i915_sink_src drm/i915: Use connector_type for printing in intel_connector_info
drivers/gpu/drm/i915/i915_debugfs.c | 81 +++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 43 deletions(-)
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/4 drm/i915: Use connector->name in drrs debugfs.
This removes relying on intel_encoder->type, which may be set to unknown.
--- drivers/gpu/drm/i915/i915_debugfs.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +8 -25
@@ -3374,31 +3374,16 @@ static int i915_ddb_info(struct seq_file *m, void *unused)static void drrs_status_per_crtc (struct seq_file *m,struct drm_device *dev,struct intel_crtc *intel_crtc) { -struct intel_encoder *intel_encoder;struct drm_i915_private *dev_priv = dev->dev_private;struct i915_drrs *drrs = &dev_priv->drrs;int vrefresh =0 ; +struct drm_connector *connector; -for_each_encoder_on_crtc (dev, &intel_crtc->base, intel_encoder) { -/* Encoder connected on this CRTC */ -switch (intel_encoder->type) { -case INTEL_OUTPUT_EDP : -seq_puts (m,"eDP:\n" ); -break ; -case INTEL_OUTPUT_DSI : -seq_puts (m,"DSI:\n" ); -break ; -case INTEL_OUTPUT_HDMI : -seq_puts (m,"HDMI:\n" ); -break ; -case INTEL_OUTPUT_DISPLAYPORT : -seq_puts (m,"DP:\n" ); -break ; -default : -seq_printf (m,"Other encoder (id=%d).\n" , - intel_encoder->type); -return ; - } +drm_for_each_connector (connector, dev) { +if (connector->state->crtc != &intel_crtc->base) +continue ; + +seq_printf (m,"%s:\n" , connector->name); }if (dev_priv->vbt.drrs_type ==STATIC_DRRS_SUPPORT )
@@ -3461,18 +3446,16 @@ static int i915_drrs_status(struct seq_file *m, void *unused)struct intel_crtc *intel_crtc;int active_crtc_cnt =0 ; +drm_modeset_lock_all (dev);for_each_intel_crtc (dev, intel_crtc) { -drm_modeset_lock (&intel_crtc->base.mutex,NULL ); -if (intel_crtc->base.state->active) { active_crtc_cnt++;seq_printf (m,"\nCRTC %d: " , active_crtc_cnt);drrs_status_per_crtc (m, dev, intel_crtc); } - -drm_modeset_unlock (&intel_crtc->base.mutex); } +drm_modeset_unlock_all (dev);if (!active_crtc_cnt)seq_puts (m,"No active crtc found\n" );
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Use connector_type instead of intel_encoder->type for DP.
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +12 -6
@@ -2950,7 +2950,7 @@ static void intel_dp_info(struct seq_file *m,seq_printf (m,"\tDPCD rev: %x\n" , intel_dp->dpcd[DP_DPCD_REV ]);seq_printf (m,"\taudio support: %s\n" ,yesno (intel_dp->has_audio)); -if (intel_encoder->type ==INTEL_OUTPUT_EDP ) +if (intel_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP)intel_panel_info (m, &intel_connector->panel); }
@@ -3473,17 +3473,23 @@ static int i915_dp_mst_info(struct seq_file *m, void *unused) {struct drm_info_node *node = (struct drm_info_node *) m->private;struct drm_device *dev = node->minor->dev; -struct drm_encoder *encoder;struct intel_encoder *intel_encoder;struct intel_digital_port *intel_dig_port; +struct drm_connector *connector; +drm_modeset_lock_all (dev); -list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) { - intel_encoder =to_intel_encoder (encoder); -if (intel_encoder->type !=INTEL_OUTPUT_DISPLAYPORT ) +drm_for_each_connector (connector, dev) { +if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort)continue ; - intel_dig_port =enc_to_dig_port (encoder); + + intel_encoder =intel_attached_encoder (connector); +if (!intel_encoder || intel_encoder->type ==INTEL_OUTPUT_DP_MST ) +continue ; + + intel_dig_port =enc_to_dig_port (&intel_encoder->base);if (!intel_dig_port->dp.can_mst)continue ; +seq_printf (m,"MST Source Port %c\n" ,port_name (intel_dig_port->port));drm_dp_mst_dump_topology (m, &intel_dig_port->dp.mst_mgr);
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915: Use atomic state and connector_type in i915_sink_src
In reply to Maarten LankhorstDPMS is unreliable, use crtc->state.
--- drivers/gpu/drm/i915/i915_debugfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +6 -6
@@ -2701,7 +2701,6 @@ static int i915_sink_crc(struct seq_file *m, void *data) {struct drm_info_node *node = m->private;struct drm_device *dev = node->minor->dev; -struct intel_encoder *encoder;struct intel_connector *connector;struct intel_dp *intel_dp =NULL ;int ret;
@@ -2709,18 +2708,19 @@ static int i915_sink_crc(struct seq_file *m, void *data)drm_modeset_lock_all (dev);for_each_intel_connector (dev, connector) { +struct drm_crtc *crtc; -if (connector->base.dpms !=DRM_MODE_DPMS_ON ) +if (!connector->base.state->best_encoder)continue ; -if (!connector->base.encoder) + crtc = connector->base.state->crtc; +if (!crtc->state->active)continue ; - encoder =to_intel_encoder (connector->base.encoder); -if (encoder->type !=INTEL_OUTPUT_EDP ) +if (connector->base.connector_type != DRM_MODE_CONNECTOR_eDP)continue ; - intel_dp =enc_to_intel_dp (&encoder->base); + intel_dp =enc_to_intel_dp (connector->base.state->best_encoder); ret =intel_dp_sink_crc (intel_dp, crc);if (ret)
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: Use connector_type for printing in intel_connector_info
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +12 -6
@@ -2989,14 +2989,20 @@ static void intel_connector_info(struct seq_file *m,seq_printf (m,"\tCEA rev: %d\n" , connector->display_info.cea_rev); } -if (intel_encoder) { -if (intel_encoder->type ==INTEL_OUTPUT_DISPLAYPORT || - intel_encoder->type ==INTEL_OUTPUT_EDP ) + +switch (connector->connector_type) { +case DRM_MODE_CONNECTOR_DisplayPort: +case DRM_MODE_CONNECTOR_eDP: +if (intel_encoder->type !=INTEL_OUTPUT_DP_MST )intel_dp_info (m, intel_connector); -else if (intel_encoder->type ==INTEL_OUTPUT_HDMI ) -intel_hdmi_info (m, intel_connector); -else if (intel_encoder->type ==INTEL_OUTPUT_LVDS ) +break ; +case DRM_MODE_CONNECTOR_LVDS : +if (intel_encoder->type !=INTEL_OUTPUT_SDVO )intel_lvds_info (m, intel_connector); +break ; +case DRM_MODE_CONNECTOR_HDMIA : +if (intel_encoder->type !=INTEL_OUTPUT_SDVO ) +intel_hdmi_info (m, intel_connector); }seq_printf (m,"\tmodes:\n" );
Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/4] drm/i915: Use connector_type for printing in intel_connector_info
Quoted 18 lines · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +2
-3@@ -2989,14 +2989,20 @@ static void intel_connector_info(struct seq_file *m,seq_printf (m,"\tCEA rev: %d\n" , connector->display_info.cea_rev); } -if (intel_encoder) { -if (intel_encoder->type ==INTEL_OUTPUT_DISPLAYPORT || - intel_encoder->type ==INTEL_OUTPUT_EDP ) + +switch (connector->connector_type) {
drivers/gpu/drm/i915/i915_debugfs.c static void intel_connector_info(struct seq_file *m, · line 3000
Quoted 10 lines
drivers/gpu/drm/i915/i915_debugfs.c +6
-3+case DRM_MODE_CONNECTOR_DisplayPort: +case DRM_MODE_CONNECTOR_eDP: +if (intel_encoder->type !=INTEL_OUTPUT_DP_MST )intel_dp_info (m, intel_connector); - else if (intel_encoder->type == INTEL_OUTPUT_HDMI) - intel_hdmi_info(m, intel_connector); - else if (intel_encoder->type == INTEL_OUTPUT_LVDS) +break ; +case DRM_MODE_CONNECTOR_LVDS : +if (intel_encoder->type !=INTEL_OUTPUT_SDVO )
This could blow up with DVO I think. It would be a bit more clear (and less dangerous) to keep checking for the encoder type(s) we want, rather than exclude types we don't want.
With that stuff fixed, the series lgtm
Quoted 15 lines
drivers/gpu/drm/i915/i915_debugfs.c +4
-0intel_lvds_info (m, intel_connector); +break ; +case DRM_MODE_CONNECTOR_HDMIA : +if (intel_encoder->type !=INTEL_OUTPUT_SDVO ) +intel_hdmi_info (m, intel_connector); }seq_printf (m,"\tmodes:\n" );Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/4 drm/i915: Use connector_type for printing in intel_connector_info, v2.
Instead of looking at encoder->type, which may be set to UNKNOWN, use connector->connector_type. Info cannot be printed for MST connectors which may have a NULL encoder, return early in that case.
Changes since v1:
- Whitelist encoder types for HDMI and LVDS.
- Fix oops on MST.
- Do not list encoder types for eDP/DP, they're always valid.
--- drivers/gpu/drm/i915/i915_debugfs.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +19 -7
@@ -2989,14 +2989,26 @@ static void intel_connector_info(struct seq_file *m,seq_printf (m,"\tCEA rev: %d\n" , connector->display_info.cea_rev); } -if (intel_encoder) { -if (intel_encoder->type ==INTEL_OUTPUT_DISPLAYPORT || - intel_encoder->type ==INTEL_OUTPUT_EDP ) -intel_dp_info (m, intel_connector); -else if (intel_encoder->type ==INTEL_OUTPUT_HDMI ) -intel_hdmi_info (m, intel_connector); -else if (intel_encoder->type ==INTEL_OUTPUT_LVDS ) + +if (!intel_encoder || intel_encoder->type ==INTEL_OUTPUT_DP_MST ) +return ; + +switch (connector->connector_type) { +case DRM_MODE_CONNECTOR_DisplayPort: +case DRM_MODE_CONNECTOR_eDP: +intel_dp_info (m, intel_connector); +break ; +case DRM_MODE_CONNECTOR_LVDS : +if (intel_encoder->type ==INTEL_OUTPUT_LVDS )intel_lvds_info (m, intel_connector); +break ; +case DRM_MODE_CONNECTOR_HDMIA : +if (intel_encoder->type ==INTEL_OUTPUT_HDMI || + intel_encoder->type ==INTEL_OUTPUT_UNKNOWN ) +intel_hdmi_info (m, intel_connector); +break ; +default : +break ; }seq_printf (m,"\tmodes:\n" );
Signature · 7 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Ro.CI.BAT: success for Fix looking at encoder->type in debugfs.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: Fix looking at encoder->type in debugfs.
URL : https://patchwork.freedesktop.org/series/8926/
State : success
== Summary ==
Series 8926v1 Fix looking at encoder->type in debugfs.
http://patchwork.freedesktop.org/api/1.0/series/8926/revisions/1/mbox
fi-skl-i7-6700k total:223 pass:186 dwarn:0 dfail:0 fail:2 skip:35 ro-bdw-i7-5600u total:223 pass:183 dwarn:0 dfail:0 fail:2 skip:38 ro-bsw-n3050 total:223 pass:170 dwarn:0 dfail:0 fail:4 skip:49 ro-byt-n2820 total:223 pass:171 dwarn:0 dfail:0 fail:5 skip:47 ro-ilk1-i5-650 total:218 pass:148 dwarn:0 dfail:0 fail:3 skip:67 ro-ivb2-i7-3770 total:223 pass:183 dwarn:0 dfail:0 fail:2 skip:38 ro-skl3-i5-6260u total:223 pass:199 dwarn:1 dfail:0 fail:2 skip:21 ro-snb-i7-2620M total:223 pass:172 dwarn:0 dfail:0 fail:3 skip:48
fi-hsw-i7-4770k failed to connect after reboot
fi-skl-i5-6260u failed to connect after reboot
fi-snb-i7-2600 failed to connect after reboot
ro-bdw-i5-5250u failed to connect after reboot
ro-bdw-i7-5557U failed to connect after reboot
ro-hsw-i3-4010u failed to connect after reboot
ro-hsw-i7-4770r failed to connect after reboot
ro-ilk-i7-620lm failed to connect after reboot
ro-ivb-i7-3770 failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1238/
f586720 drm-intel-nightly: 2016y-06m-20d-13h-24m-46s UTC integration manifest 7b2831b drm/i915: Use connector_type for printing in intel_connector_info 400c93d drm/i915: Use atomic state and connector_type in i915_sink_src 6c4e767 drm/i915: Use connector_type instead of intel_encoder->type for DP. 83ded8c drm/i915: Use connector->name in drrs debugfs.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx