Commit 17bef9ba authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Nuke .post_pll_disable() for DDI platforms

HSW+ platforms call encoder .post_disable() and .post_pll_disable()
back to back. And since we don't even disable the PLL in between
let's just move everything into .post_disable().

intel_dp_mst does forward the .post_disable() call to intel_ddi at
the very end of its own .post_disable() hook, so this time MST
I shouldn't even break MST by accident.

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191213195217.15168-2-ville.syrjala@linux.intel.comReviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
parent 6a6d79de
...@@ -3856,6 +3856,9 @@ static void intel_ddi_post_disable(struct intel_encoder *encoder, ...@@ -3856,6 +3856,9 @@ static void intel_ddi_post_disable(struct intel_encoder *encoder,
const struct drm_connector_state *old_conn_state) const struct drm_connector_state *old_conn_state)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
bool is_tc_port = intel_phy_is_tc(dev_priv, phy);
/* /*
* When called from DP MST code: * When called from DP MST code:
...@@ -3879,6 +3882,13 @@ static void intel_ddi_post_disable(struct intel_encoder *encoder, ...@@ -3879,6 +3882,13 @@ static void intel_ddi_post_disable(struct intel_encoder *encoder,
if (INTEL_GEN(dev_priv) >= 11) if (INTEL_GEN(dev_priv) >= 11)
icl_unmap_plls_to_ports(encoder); icl_unmap_plls_to_ports(encoder);
if (intel_crtc_has_dp_encoder(old_crtc_state) || is_tc_port)
intel_display_power_put_unchecked(dev_priv,
intel_ddi_main_link_aux_domain(dig_port));
if (is_tc_port)
intel_tc_port_put_link(dig_port);
} }
void intel_ddi_fdi_post_disable(struct intel_encoder *encoder, void intel_ddi_fdi_post_disable(struct intel_encoder *encoder,
...@@ -4191,24 +4201,6 @@ intel_ddi_pre_pll_enable(struct intel_encoder *encoder, ...@@ -4191,24 +4201,6 @@ intel_ddi_pre_pll_enable(struct intel_encoder *encoder,
crtc_state->lane_lat_optim_mask); crtc_state->lane_lat_optim_mask);
} }
static void
intel_ddi_post_pll_disable(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state)
{
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
bool is_tc_port = intel_phy_is_tc(dev_priv, phy);
if (intel_crtc_has_dp_encoder(crtc_state) || is_tc_port)
intel_display_power_put_unchecked(dev_priv,
intel_ddi_main_link_aux_domain(dig_port));
if (is_tc_port)
intel_tc_port_put_link(dig_port);
}
static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
{ {
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
...@@ -4795,7 +4787,6 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) ...@@ -4795,7 +4787,6 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
encoder->compute_config = intel_ddi_compute_config; encoder->compute_config = intel_ddi_compute_config;
encoder->enable = intel_enable_ddi; encoder->enable = intel_enable_ddi;
encoder->pre_pll_enable = intel_ddi_pre_pll_enable; encoder->pre_pll_enable = intel_ddi_pre_pll_enable;
encoder->post_pll_disable = intel_ddi_post_pll_disable;
encoder->pre_enable = intel_ddi_pre_enable; encoder->pre_enable = intel_ddi_pre_enable;
encoder->disable = intel_disable_ddi; encoder->disable = intel_disable_ddi;
encoder->post_disable = intel_ddi_post_disable; encoder->post_disable = intel_ddi_post_disable;
......
...@@ -6765,8 +6765,6 @@ static void haswell_crtc_disable(struct intel_atomic_state *state, ...@@ -6765,8 +6765,6 @@ static void haswell_crtc_disable(struct intel_atomic_state *state,
ironlake_pfit_disable(old_crtc_state); ironlake_pfit_disable(old_crtc_state);
intel_encoders_post_disable(state, crtc); intel_encoders_post_disable(state, crtc);
intel_encoders_post_pll_disable(state, crtc);
} }
static void i9xx_pfit_enable(const struct intel_crtc_state *crtc_state) static void i9xx_pfit_enable(const struct intel_crtc_state *crtc_state)
......
...@@ -286,20 +286,6 @@ static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder, ...@@ -286,20 +286,6 @@ static void intel_mst_pre_pll_enable_dp(struct intel_encoder *encoder,
pipe_config, NULL); pipe_config, NULL);
} }
static void intel_mst_post_pll_disable_dp(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state)
{
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
struct intel_digital_port *intel_dig_port = intel_mst->primary;
struct intel_dp *intel_dp = &intel_dig_port->dp;
if (intel_dp->active_mst_links == 0)
intel_dig_port->base.post_pll_disable(&intel_dig_port->base,
old_crtc_state,
old_conn_state);
}
static void intel_mst_pre_enable_dp(struct intel_encoder *encoder, static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config, const struct intel_crtc_state *pipe_config,
const struct drm_connector_state *conn_state) const struct drm_connector_state *conn_state)
...@@ -656,7 +642,6 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum ...@@ -656,7 +642,6 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum
intel_encoder->disable = intel_mst_disable_dp; intel_encoder->disable = intel_mst_disable_dp;
intel_encoder->post_disable = intel_mst_post_disable_dp; intel_encoder->post_disable = intel_mst_post_disable_dp;
intel_encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp; intel_encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp;
intel_encoder->post_pll_disable = intel_mst_post_pll_disable_dp;
intel_encoder->pre_enable = intel_mst_pre_enable_dp; intel_encoder->pre_enable = intel_mst_pre_enable_dp;
intel_encoder->enable = intel_mst_enable_dp; intel_encoder->enable = intel_mst_enable_dp;
intel_encoder->get_hw_state = intel_dp_mst_enc_get_hw_state; intel_encoder->get_hw_state = intel_dp_mst_enc_get_hw_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment