* [PATCH 1/4] drm/i915: Use connector->name in drrs debugfs.
2016-06-20 13:57 [PATCH 0/4] Fix looking at encoder->type in debugfs Maarten Lankhorst
@ 2016-06-20 13:57 ` Maarten Lankhorst
2016-06-20 13:57 ` [PATCH 2/4] drm/i915: Use connector_type instead of intel_encoder->type for DP Maarten Lankhorst
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Maarten Lankhorst @ 2016-06-20 13:57 UTC (permalink / raw)
To: intel-gfx
This removes relying on intel_encoder->type, which may be set to
unknown.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 33 ++++++++-------------------------
1 file changed, 8 insertions(+), 25 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 5b7526697838..18867f5337d7 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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");
--
2.5.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/4] drm/i915: Use connector_type instead of intel_encoder->type for DP.
2016-06-20 13:57 [PATCH 0/4] Fix looking at encoder->type in debugfs Maarten Lankhorst
2016-06-20 13:57 ` [PATCH 1/4] drm/i915: Use connector->name in drrs debugfs Maarten Lankhorst
@ 2016-06-20 13:57 ` Maarten Lankhorst
2016-06-20 13:57 ` [PATCH 3/4] drm/i915: Use atomic state and connector_type in i915_sink_src Maarten Lankhorst
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Maarten Lankhorst @ 2016-06-20 13:57 UTC (permalink / raw)
To: intel-gfx
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 18867f5337d7..87b3e31fb3bb 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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);
--
2.5.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] drm/i915: Use atomic state and connector_type in i915_sink_src
2016-06-20 13:57 [PATCH 0/4] Fix looking at encoder->type in debugfs Maarten Lankhorst
2016-06-20 13:57 ` [PATCH 1/4] drm/i915: Use connector->name in drrs debugfs Maarten Lankhorst
2016-06-20 13:57 ` [PATCH 2/4] drm/i915: Use connector_type instead of intel_encoder->type for DP Maarten Lankhorst
@ 2016-06-20 13:57 ` Maarten Lankhorst
2016-06-20 13:57 ` [PATCH 4/4] drm/i915: Use connector_type for printing in intel_connector_info Maarten Lankhorst
2016-06-20 14:17 ` ✓ Ro.CI.BAT: success for Fix looking at encoder->type in debugfs Patchwork
4 siblings, 0 replies; 8+ messages in thread
From: Maarten Lankhorst @ 2016-06-20 13:57 UTC (permalink / raw)
To: intel-gfx
DPMS is unreliable, use crtc->state.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 87b3e31fb3bb..38f2cbc19f4a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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)
--
2.5.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] drm/i915: Use connector_type for printing in intel_connector_info
2016-06-20 13:57 [PATCH 0/4] Fix looking at encoder->type in debugfs Maarten Lankhorst
` (2 preceding siblings ...)
2016-06-20 13:57 ` [PATCH 3/4] drm/i915: Use atomic state and connector_type in i915_sink_src Maarten Lankhorst
@ 2016-06-20 13:57 ` Maarten Lankhorst
2016-06-20 15:04 ` Ville Syrjälä
2016-06-20 14:17 ` ✓ Ro.CI.BAT: success for Fix looking at encoder->type in debugfs Patchwork
4 siblings, 1 reply; 8+ messages in thread
From: Maarten Lankhorst @ 2016-06-20 13:57 UTC (permalink / raw)
To: intel-gfx
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 38f2cbc19f4a..7ee24626e0a6 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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");
--
2.5.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 4/4] drm/i915: Use connector_type for printing in intel_connector_info
2016-06-20 13:57 ` [PATCH 4/4] drm/i915: Use connector_type for printing in intel_connector_info Maarten Lankhorst
@ 2016-06-20 15:04 ` Ville Syrjälä
2016-06-21 10:00 ` [PATCH v2 4/4] drm/i915: Use connector_type for printing in intel_connector_info, v2 Maarten Lankhorst
0 siblings, 1 reply; 8+ messages in thread
From: Ville Syrjälä @ 2016-06-20 15:04 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
On Mon, Jun 20, 2016 at 03:57:39PM +0200, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 38f2cbc19f4a..7ee24626e0a6 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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)
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
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 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");
> --
> 2.5.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] drm/i915: Use connector_type for printing in intel_connector_info, v2.
2016-06-20 15:04 ` Ville Syrjälä
@ 2016-06-21 10:00 ` Maarten Lankhorst
0 siblings, 0 replies; 8+ messages in thread
From: Maarten Lankhorst @ 2016-06-21 10:00 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
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.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 38f2cbc19f4a..f83e1d402842 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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");
--
2.5.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* ✓ Ro.CI.BAT: success for Fix looking at encoder->type in debugfs.
2016-06-20 13:57 [PATCH 0/4] Fix looking at encoder->type in debugfs Maarten Lankhorst
` (3 preceding siblings ...)
2016-06-20 13:57 ` [PATCH 4/4] drm/i915: Use connector_type for printing in intel_connector_info Maarten Lankhorst
@ 2016-06-20 14:17 ` Patchwork
4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2016-06-20 14:17 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread