diff mbox

[1/5] drm/i915: Splitting intel_dp_detect

Message ID 1455623572-10599-1-git-send-email-shubhangi.shrivastava@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shubhangi Shrivastava Feb. 16, 2016, 11:52 a.m. UTC
intel_dp_detect() is called for not just detection but
during modes enumeration as well. Repeating the whole
sequence during each of these calls is wasteful and
time consuming.
This patch moves probing for panel, DPCD read etc done in
intel_dp_detect() to a new function intel_dp_long_pulse().
Note that the behavior of intel_dp_detect() is changed to
report connected or disconnected depending on whether the
EDID is available or not.
This change will be required by further patches in the series
to avoid performing duplicated DPCD operations on hotplug.

v2: Moved a hunk to next patch of the series.
    Moved intel_dp_unset_edid to out. (Ander)

v3: Rephrased commit message and intel_dp_unset_dp() is called
    within intel_dp_set_dp() to free the previous EDID. (Ander)

v4: Added overriding of status to disconnected for MST. (Ander)

Tested-by: Nathan D Ciobanu <nathan.d.ciobanu@intel.com>
Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 63 ++++++++++++++++++++++++++++-------------
 1 file changed, 43 insertions(+), 20 deletions(-)

Comments

Ander Conselvan de Oliveira Feb. 18, 2016, 9:32 a.m. UTC | #1
On Tue, 2016-02-16 at 12:36 +0000, Patchwork wrote:
> == Summary ==
> 
> Series 3480v1 Series without cover letter
> http://patchwork.freedesktop.org/api/1.0/series/3480/revisions/1/mbox/
> 
> Test gem_ctx_create:
>         Subgroup basic:
>                 pass       -> INCOMPLETE (bdw-nuci7)

It is unlikely that this patch series causes this system hang. I didn't find any
know issue with this particular test though. Seems that the machine experienced
a few system hangs in the past. Is this a known issue?

> Test gem_ringfill:
>         Subgroup basic-default-hang:
>                 incomplete -> PASS       (snb-dellxps)
> Test gem_sync:
>         Subgroup basic-bsd:
>                 dmesg-fail -> PASS       (ilk-hp8440p)
> Test kms_flip:
>         Subgroup basic-flip-vs-dpms:
>                 dmesg-warn -> PASS       (ilk-hp8440p) UNSTABLE
> Test pm_rpm:
>         Subgroup basic-pci-d3-state:
>                 pass       -> DMESG-WARN (bsw-nuc-2)

This looks like https://bugs.freedesktop.org/show_bug.cgi?id=94164 , but the
"snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered" messages are
new. Can these audio messages be ignored?

>         Subgroup basic-rte:
>                 dmesg-warn -> PASS       (bsw-nuc-2)
> 
> bdw-nuci7        total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
> bdw-ultra        total:165  pass:152  dwarn:0   dfail:0   fail:0   skip:13 
> bsw-nuc-2        total:165  pass:135  dwarn:1   dfail:0   fail:0   skip:29 
> byt-nuc          total:165  pass:140  dwarn:1   dfail:0   fail:0   skip:24 
> hsw-brixbox      total:165  pass:151  dwarn:0   dfail:0   fail:0   skip:14 
> hsw-gt2          total:165  pass:154  dwarn:0   dfail:0   fail:1   skip:10 
> ilk-hp8440p      total:165  pass:116  dwarn:0   dfail:0   fail:1   skip:48 
> ivb-t430s        total:165  pass:150  dwarn:0   dfail:0   fail:1   skip:14 
> skl-i5k-2        total:165  pass:150  dwarn:0   dfail:0   fail:0   skip:15 
> snb-dellxps      total:165  pass:142  dwarn:0   dfail:0   fail:1   skip:22 
> snb-x220t        total:165  pass:142  dwarn:0   dfail:0   fail:2   skip:21 
> 
> Results at /archive/results/CI_IGT_test/Patchwork_1414/
> 
> 63cbdd1816fd78d404ed004b0f931c497625e0df drm-intel-nightly: 2016y-02m-16d-09h
> -41m-02s UTC integration manifest
> f67c5fd98206fc40fb6f612eaa101a9e1bcae320 drm/i915: force full detect on sink
> count change
> 86dac93fb6d797e1c34562be455dee9ed3c5c536 drm/i915: Read sink_count dpcd always
> b6405e7f8984d5c3847f071ff8a084fe6fd6b9a2 drm/i915: Reorganizing
> intel_dp_check_link_status
> 31024bbf335cb1fc83a3aa1754de59c29c7f6656 drm/i915: Cleaning up
> intel_dp_hpd_pulse
> a3f3c7dd074448560b65b6f5827d033f85801a82 drm/i915: Splitting intel_dp_detect
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 2233f36..c632e2e 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -129,6 +129,7 @@  static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
 static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
 static void vlv_steal_power_sequencer(struct drm_device *dev,
 				      enum pipe pipe);
+static void intel_dp_unset_edid(struct intel_dp *intel_dp);
 
 static unsigned int intel_dp_unused_lane_mask(int lane_count)
 {
@@ -4581,6 +4582,7 @@  intel_dp_set_edid(struct intel_dp *intel_dp)
 	struct intel_connector *intel_connector = intel_dp->attached_connector;
 	struct edid *edid;
 
+	intel_dp_unset_edid(intel_dp);
 	edid = intel_dp_get_edid(intel_dp);
 	intel_connector->detect_edid = edid;
 
@@ -4601,9 +4603,10 @@  intel_dp_unset_edid(struct intel_dp *intel_dp)
 	intel_dp->has_audio = false;
 }
 
-static enum drm_connector_status
-intel_dp_detect(struct drm_connector *connector, bool force)
+static void
+intel_dp_long_pulse(struct intel_connector *intel_connector)
 {
+	struct drm_connector *connector = &intel_connector->base;
 	struct intel_dp *intel_dp = intel_attached_dp(connector);
 	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
 	struct intel_encoder *intel_encoder = &intel_dig_port->base;
@@ -4613,17 +4616,6 @@  intel_dp_detect(struct drm_connector *connector, bool force)
 	bool ret;
 	u8 sink_irq_vector;
 
-	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
-		      connector->base.id, connector->name);
-	intel_dp_unset_edid(intel_dp);
-
-	if (intel_dp->is_mst) {
-		/* MST devices are disconnected from a monitor POV */
-		if (intel_encoder->type != INTEL_OUTPUT_EDP)
-			intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
-		return connector_status_disconnected;
-	}
-
 	power_domain = intel_display_port_aux_power_domain(intel_encoder);
 	intel_display_power_get(to_i915(dev), power_domain);
 
@@ -4644,14 +4636,18 @@  intel_dp_detect(struct drm_connector *connector, bool force)
 		goto out;
 	}
 
+	if (intel_encoder->type != INTEL_OUTPUT_EDP)
+		intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
+
 	intel_dp_probe_oui(intel_dp);
 
 	ret = intel_dp_probe_mst(intel_dp);
 	if (ret) {
-		/* if we are in MST mode then this connector
-		   won't appear connected or have anything with EDID on it */
-		if (intel_encoder->type != INTEL_OUTPUT_EDP)
-			intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
+		/*
+		 * If we are in MST mode then this connector
+		 * won't appear connected or have anything
+		 * with EDID on it
+		 */
 		status = connector_status_disconnected;
 		goto out;
 	}
@@ -4666,8 +4662,6 @@  intel_dp_detect(struct drm_connector *connector, bool force)
 
 	intel_dp_set_edid(intel_dp);
 
-	if (intel_encoder->type != INTEL_OUTPUT_EDP)
-		intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
 	status = connector_status_connected;
 
 	/* Try to read the source of the interrupt */
@@ -4685,8 +4679,37 @@  intel_dp_detect(struct drm_connector *connector, bool force)
 	}
 
 out:
+	if (status != connector_status_connected)
+		intel_dp_unset_edid(intel_dp);
 	intel_display_power_put(to_i915(dev), power_domain);
-	return status;
+	return;
+}
+
+static enum drm_connector_status
+intel_dp_detect(struct drm_connector *connector, bool force)
+{
+	struct intel_dp *intel_dp = intel_attached_dp(connector);
+	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+	struct intel_encoder *intel_encoder = &intel_dig_port->base;
+	struct intel_connector *intel_connector = to_intel_connector(connector);
+
+	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
+		     connector->base.id, connector->name);
+
+	if (intel_dp->is_mst) {
+		/* MST devices are disconnected from a monitor POV */
+		intel_dp_unset_edid(intel_dp);
+		if (intel_encoder->type != INTEL_OUTPUT_EDP)
+			intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
+		return connector_status_disconnected;
+	}
+
+	intel_dp_long_pulse(intel_dp->attached_connector);
+
+	if (intel_connector->detect_edid)
+		return connector_status_connected;
+	else
+		return connector_status_disconnected;
 }
 
 static void