Skip to content

Commit 5ea2355

Browse files
dhnkrnjnikula
authored andcommitted
drm/i915/mst: Use MST sideband message transactions for dpms control
Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to set power states for downstream sinks. Apart from giving us the ability to set power state for individual sinks, this fixes the below test for me. $ xrandr --display :0 --output DP-2-2-8 --off $ xrandr --display :0 --output DP-2-2-1 --off $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen $ xrandr --display :0 --output DP-2-2-1 --auto v2: Modify and document the dpms and port disable order (Ville) Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten) v3 by Jani: rebase References: https://bugs.freedesktop.org/show_bug.cgi?id=90963 References: https://bugs.freedesktop.org/show_bug.cgi?id=88124 Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Lyude <lyude@redhat.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171003142211.860-1-jani.nikula@intel.com
1 parent ac14fbd commit 5ea2355

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

drivers/gpu/drm/i915/intel_ddi.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
21622162
intel_prepare_dp_ddi_buffers(encoder);
21632163

21642164
intel_ddi_init_dp_buf_reg(encoder);
2165-
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
2165+
if (!link_mst)
2166+
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
21662167
intel_dp_start_link_train(intel_dp);
21672168
if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
21682169
intel_dp_stop_link_train(intel_dp);
@@ -2236,12 +2237,21 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
22362237
uint32_t val;
22372238
bool wait = false;
22382239

2239-
/* old_crtc_state and old_conn_state are NULL when called from DP_MST */
2240-
22412240
if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
2241+
/*
2242+
* old_crtc_state and old_conn_state are NULL when called from
2243+
* DP_MST. The main connector associated with this port is never
2244+
* bound to a crtc for MST.
2245+
*/
2246+
bool is_mst = !old_crtc_state;
22422247
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
22432248

2244-
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
2249+
/*
2250+
* Power down sink before disabling the port, otherwise we end
2251+
* up getting interrupts from the sink on detecting link loss.
2252+
*/
2253+
if (!is_mst)
2254+
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
22452255
}
22462256

22472257
val = I915_READ(DDI_BUF_CTL(port));

drivers/gpu/drm/i915/intel_dp_mst.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,19 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
162162

163163
drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
164164

165+
/*
166+
* Power down mst path before disabling the port, otherwise we end
167+
* up getting interrupts from the sink upon detecting link loss.
168+
*/
169+
drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
170+
false);
171+
165172
intel_dp->active_mst_links--;
166173

167174
intel_mst->connector = NULL;
168175
if (intel_dp->active_mst_links == 0) {
169176
intel_dig_port->base.post_disable(&intel_dig_port->base,
170177
NULL, NULL);
171-
172-
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
173178
}
174179
DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
175180
}
@@ -196,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
196201

197202
DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
198203

204+
drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
199205
if (intel_dp->active_mst_links == 0)
200206
intel_dig_port->base.pre_enable(&intel_dig_port->base,
201207
pipe_config, NULL);

0 commit comments

Comments
 (0)