Skip to content

Commit f21a219

Browse files
shubhangi-shrivastavaAnder Conselvan de Oliveira
authored andcommitted
drm/i915: Splitting intel_dp_detect
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> [anderco: fix parenthesis alignment] Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1459341326-13142-1-git-send-email-shubhangi.shrivastava@intel.com
1 parent 72e96d6 commit f21a219

File tree

1 file changed

+43
-20
lines changed

1 file changed

+43
-20
lines changed

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
129129
static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
130130
static void vlv_steal_power_sequencer(struct drm_device *dev,
131131
enum pipe pipe);
132+
static void intel_dp_unset_edid(struct intel_dp *intel_dp);
132133

133134
static unsigned int intel_dp_unused_lane_mask(int lane_count)
134135
{
@@ -4513,6 +4514,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp)
45134514
struct intel_connector *intel_connector = intel_dp->attached_connector;
45144515
struct edid *edid;
45154516

4517+
intel_dp_unset_edid(intel_dp);
45164518
edid = intel_dp_get_edid(intel_dp);
45174519
intel_connector->detect_edid = edid;
45184520

@@ -4533,9 +4535,10 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
45334535
intel_dp->has_audio = false;
45344536
}
45354537

4536-
static enum drm_connector_status
4537-
intel_dp_detect(struct drm_connector *connector, bool force)
4538+
static void
4539+
intel_dp_long_pulse(struct intel_connector *intel_connector)
45384540
{
4541+
struct drm_connector *connector = &intel_connector->base;
45394542
struct intel_dp *intel_dp = intel_attached_dp(connector);
45404543
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
45414544
struct intel_encoder *intel_encoder = &intel_dig_port->base;
@@ -4545,17 +4548,6 @@ intel_dp_detect(struct drm_connector *connector, bool force)
45454548
bool ret;
45464549
u8 sink_irq_vector;
45474550

4548-
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
4549-
connector->base.id, connector->name);
4550-
intel_dp_unset_edid(intel_dp);
4551-
4552-
if (intel_dp->is_mst) {
4553-
/* MST devices are disconnected from a monitor POV */
4554-
if (intel_encoder->type != INTEL_OUTPUT_EDP)
4555-
intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
4556-
return connector_status_disconnected;
4557-
}
4558-
45594551
power_domain = intel_display_port_aux_power_domain(intel_encoder);
45604552
intel_display_power_get(to_i915(dev), power_domain);
45614553

@@ -4576,14 +4568,18 @@ intel_dp_detect(struct drm_connector *connector, bool force)
45764568
goto out;
45774569
}
45784570

4571+
if (intel_encoder->type != INTEL_OUTPUT_EDP)
4572+
intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
4573+
45794574
intel_dp_probe_oui(intel_dp);
45804575

45814576
ret = intel_dp_probe_mst(intel_dp);
45824577
if (ret) {
4583-
/* if we are in MST mode then this connector
4584-
won't appear connected or have anything with EDID on it */
4585-
if (intel_encoder->type != INTEL_OUTPUT_EDP)
4586-
intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
4578+
/*
4579+
* If we are in MST mode then this connector
4580+
* won't appear connected or have anything
4581+
* with EDID on it
4582+
*/
45874583
status = connector_status_disconnected;
45884584
goto out;
45894585
}
@@ -4598,8 +4594,6 @@ intel_dp_detect(struct drm_connector *connector, bool force)
45984594

45994595
intel_dp_set_edid(intel_dp);
46004596

4601-
if (intel_encoder->type != INTEL_OUTPUT_EDP)
4602-
intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
46034597
status = connector_status_connected;
46044598

46054599
/* Try to read the source of the interrupt */
@@ -4617,8 +4611,37 @@ intel_dp_detect(struct drm_connector *connector, bool force)
46174611
}
46184612

46194613
out:
4614+
if (status != connector_status_connected)
4615+
intel_dp_unset_edid(intel_dp);
46204616
intel_display_power_put(to_i915(dev), power_domain);
4621-
return status;
4617+
return;
4618+
}
4619+
4620+
static enum drm_connector_status
4621+
intel_dp_detect(struct drm_connector *connector, bool force)
4622+
{
4623+
struct intel_dp *intel_dp = intel_attached_dp(connector);
4624+
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
4625+
struct intel_encoder *intel_encoder = &intel_dig_port->base;
4626+
struct intel_connector *intel_connector = to_intel_connector(connector);
4627+
4628+
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
4629+
connector->base.id, connector->name);
4630+
4631+
if (intel_dp->is_mst) {
4632+
/* MST devices are disconnected from a monitor POV */
4633+
intel_dp_unset_edid(intel_dp);
4634+
if (intel_encoder->type != INTEL_OUTPUT_EDP)
4635+
intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
4636+
return connector_status_disconnected;
4637+
}
4638+
4639+
intel_dp_long_pulse(intel_dp->attached_connector);
4640+
4641+
if (intel_connector->detect_edid)
4642+
return connector_status_connected;
4643+
else
4644+
return connector_status_disconnected;
46224645
}
46234646

46244647
static void

0 commit comments

Comments
 (0)