Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd6bbda9 authored by Maarten Lankhorst's avatar Maarten Lankhorst
Browse files

drm/i915: Pass crtc_state and connector_state to encoder functions



This is mostly code churn, with exception of a few places:
- intel_display.c has changes in intel_sanitize_encoder
- intel_ddi.c has intel_ddi_fdi_disable calling intel_ddi_post_disable,
  and required a function change. Also affects intel_display.c
- intel_dp_mst.c passes a NULL crtc_state and conn_state to
  intel_ddi_post_disable for shutting down the real encoder.

  If we would pass conn_state, then conn_state->connector !=
  intel_dig_port->connector and conn_state->best_encoder !=
  to_intel_encoder(intel_dig_port).

  We also shouldn't pass crtc_state, because in that case the
  disabling sequence may potentially be different depending on
  which crtc is disabled last. Nice way to introduce bugs.

No other functional changes are done, diff stat is already huge.
Each encoder type will need to be fixed to use the atomic states
separately.

Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470755054-32699-6-git-send-email-maarten.lankhorst@linux.intel.com


Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent fb1c98b1
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -193,21 +193,29 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode)
	I915_WRITE(crt->adpa_reg, adpa);
}

static void intel_disable_crt(struct intel_encoder *encoder)
static void intel_disable_crt(struct intel_encoder *encoder,
			      struct intel_crtc_state *old_crtc_state,
			      struct drm_connector_state *old_conn_state)
{
	intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF);
}

static void pch_disable_crt(struct intel_encoder *encoder)
static void pch_disable_crt(struct intel_encoder *encoder,
			    struct intel_crtc_state *old_crtc_state,
			    struct drm_connector_state *old_conn_state)
{
}

static void pch_post_disable_crt(struct intel_encoder *encoder)
static void pch_post_disable_crt(struct intel_encoder *encoder,
				 struct intel_crtc_state *old_crtc_state,
				 struct drm_connector_state *old_conn_state)
{
	intel_disable_crt(encoder);
	intel_disable_crt(encoder, old_crtc_state, old_conn_state);
}

static void intel_enable_crt(struct intel_encoder *encoder)
static void intel_enable_crt(struct intel_encoder *encoder,
			     struct intel_crtc_state *pipe_config,
			     struct drm_connector_state *conn_state)
{
	intel_crt_set_dpms(encoder, DRM_MODE_DPMS_ON);
}
+22 −9
Original line number Diff line number Diff line
@@ -1611,7 +1611,9 @@ void intel_ddi_clk_select(struct intel_encoder *encoder,
	}
}

static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder,
				 struct intel_crtc_state *pipe_config,
				 struct drm_connector_state *conn_state)
{
	struct drm_encoder *encoder = &intel_encoder->base;
	struct drm_i915_private *dev_priv = to_i915(encoder->dev);
@@ -1663,7 +1665,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
	}
}

static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
				   struct intel_crtc_state *old_crtc_state,
				   struct drm_connector_state *old_conn_state)
{
	struct drm_encoder *encoder = &intel_encoder->base;
	struct drm_device *dev = encoder->dev;
@@ -1673,6 +1677,8 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
	uint32_t val;
	bool wait = false;

	/* old_crtc_state and old_conn_state are NULL when called from DP_MST */

	val = I915_READ(DDI_BUF_CTL(port));
	if (val & DDI_BUF_CTL_ENABLE) {
		val &= ~DDI_BUF_CTL_ENABLE;
@@ -1708,7 +1714,9 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
	}
}

static void intel_enable_ddi(struct intel_encoder *intel_encoder)
static void intel_enable_ddi(struct intel_encoder *intel_encoder,
			     struct intel_crtc_state *pipe_config,
			     struct drm_connector_state *conn_state)
{
	struct drm_encoder *encoder = &intel_encoder->base;
	struct drm_crtc *crtc = encoder->crtc;
@@ -1746,7 +1754,9 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)
	}
}

static void intel_disable_ddi(struct intel_encoder *intel_encoder)
static void intel_disable_ddi(struct intel_encoder *intel_encoder,
			      struct intel_crtc_state *old_crtc_state,
			      struct drm_connector_state *old_conn_state)
{
	struct drm_encoder *encoder = &intel_encoder->base;
	struct drm_crtc *crtc = encoder->crtc;
@@ -2052,7 +2062,9 @@ bxt_ddi_phy_calc_lane_lat_optim_mask(struct intel_encoder *encoder,
	}
}

static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder)
static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder,
				   struct intel_crtc_state *pipe_config,
				   struct drm_connector_state *conn_state)
{
	struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
	struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
@@ -2141,10 +2153,11 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
	udelay(600);
}

void intel_ddi_fdi_disable(struct drm_crtc *crtc)
void intel_ddi_fdi_disable(struct intel_encoder *intel_encoder,
			   struct intel_crtc_state *old_crtc_state,
			   struct drm_connector_state *old_conn_state)
{
	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
	struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
	struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);
	uint32_t val;

	/*
@@ -2157,7 +2170,7 @@ void intel_ddi_fdi_disable(struct drm_crtc *crtc)
	val &= ~FDI_RX_ENABLE;
	I915_WRITE(FDI_RX_CTL(PIPE_A), val);

	intel_ddi_post_disable(intel_encoder);
	intel_ddi_post_disable(intel_encoder, old_crtc_state, old_conn_state);

	val = I915_READ(FDI_RX_MISC(PIPE_A));
	val &= ~(FDI_RX_PWRDN_LANE1_MASK | FDI_RX_PWRDN_LANE0_MASK);
+58 −44
Original line number Diff line number Diff line
@@ -5155,6 +5155,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_mask
}

static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc,
					  struct intel_crtc_state *crtc_state,
					  struct drm_atomic_state *old_state)
{
	struct drm_connector_state *old_conn_state;
@@ -5170,11 +5171,12 @@ static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc,
			continue;

		if (encoder->pre_pll_enable)
			encoder->pre_pll_enable(encoder);
			encoder->pre_pll_enable(encoder, crtc_state, conn_state);
	}
}

static void intel_encoders_pre_enable(struct drm_crtc *crtc,
				      struct intel_crtc_state *crtc_state,
				      struct drm_atomic_state *old_state)
{
	struct drm_connector_state *old_conn_state;
@@ -5190,11 +5192,12 @@ static void intel_encoders_pre_enable(struct drm_crtc *crtc,
			continue;

		if (encoder->pre_enable)
			encoder->pre_enable(encoder);
			encoder->pre_enable(encoder, crtc_state, conn_state);
	}
}

static void intel_encoders_enable(struct drm_crtc *crtc,
				  struct intel_crtc_state *crtc_state,
				  struct drm_atomic_state *old_state)
{
	struct drm_connector_state *old_conn_state;
@@ -5209,12 +5212,13 @@ static void intel_encoders_enable(struct drm_crtc *crtc,
		if (conn_state->crtc != crtc)
			continue;

		encoder->enable(encoder);
		encoder->enable(encoder, crtc_state, conn_state);
		intel_opregion_notify_encoder(encoder, true);
	}
}

static void intel_encoders_disable(struct drm_crtc *crtc,
				   struct intel_crtc_state *old_crtc_state,
				   struct drm_atomic_state *old_state)
{
	struct drm_connector_state *old_conn_state;
@@ -5229,11 +5233,12 @@ static void intel_encoders_disable(struct drm_crtc *crtc,
			continue;

		intel_opregion_notify_encoder(encoder, false);
		encoder->disable(encoder);
		encoder->disable(encoder, old_crtc_state, old_conn_state);
	}
}

static void intel_encoders_post_disable(struct drm_crtc *crtc,
					struct intel_crtc_state *old_crtc_state,
					struct drm_atomic_state *old_state)
{
	struct drm_connector_state *old_conn_state;
@@ -5248,11 +5253,12 @@ static void intel_encoders_post_disable(struct drm_crtc *crtc,
			continue;

		if (encoder->post_disable)
			encoder->post_disable(encoder);
			encoder->post_disable(encoder, old_crtc_state, old_conn_state);
	}
}

static void intel_encoders_post_pll_disable(struct drm_crtc *crtc,
					    struct intel_crtc_state *old_crtc_state,
					    struct drm_atomic_state *old_state)
{
	struct drm_connector_state *old_conn_state;
@@ -5267,7 +5273,7 @@ static void intel_encoders_post_pll_disable(struct drm_crtc *crtc,
			continue;

		if (encoder->post_pll_disable)
			encoder->post_pll_disable(encoder);
			encoder->post_pll_disable(encoder, old_crtc_state, old_conn_state);
	}
}

@@ -5316,7 +5322,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,

	intel_crtc->active = true;

	intel_encoders_pre_enable(crtc, old_state);
	intel_encoders_pre_enable(crtc, pipe_config, old_state);

	if (intel_crtc->config->has_pch_encoder) {
		/* Note: FDI PLL enabling _must_ be done before we enable the
@@ -5346,7 +5352,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,
	assert_vblank_disabled(crtc);
	drm_crtc_vblank_on(crtc);

	intel_encoders_enable(crtc, old_state);
	intel_encoders_enable(crtc, pipe_config, old_state);

	if (HAS_PCH_CPT(dev))
		cpt_verify_modeset(dev, intel_crtc->pipe);
@@ -5381,7 +5387,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
		intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
						      false);

	intel_encoders_pre_pll_enable(crtc, old_state);
	intel_encoders_pre_pll_enable(crtc, pipe_config, old_state);

	if (intel_crtc->config->shared_dpll)
		intel_enable_shared_dpll(intel_crtc);
@@ -5419,7 +5425,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
	else
		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);

	intel_encoders_pre_enable(crtc, old_state);
	intel_encoders_pre_enable(crtc, pipe_config, old_state);

	if (intel_crtc->config->has_pch_encoder)
		dev_priv->display.fdi_link_train(crtc);
@@ -5460,7 +5466,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
	assert_vblank_disabled(crtc);
	drm_crtc_vblank_on(crtc);

	intel_encoders_enable(crtc, old_state);
	intel_encoders_enable(crtc, pipe_config, old_state);

	if (intel_crtc->config->has_pch_encoder) {
		intel_wait_for_vblank(dev, pipe);
@@ -5513,7 +5519,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,
		intel_set_pch_fifo_underrun_reporting(dev_priv, pipe, false);
	}

	intel_encoders_disable(crtc, old_state);
	intel_encoders_disable(crtc, old_crtc_state, old_state);

	drm_crtc_vblank_off(crtc);
	assert_vblank_disabled(crtc);
@@ -5525,7 +5531,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,
	if (intel_crtc->config->has_pch_encoder)
		ironlake_fdi_disable(crtc);

	intel_encoders_post_disable(crtc, old_state);
	intel_encoders_post_disable(crtc, old_crtc_state, old_state);

	if (intel_crtc->config->has_pch_encoder) {
		ironlake_disable_pch_transcoder(dev_priv, pipe);
@@ -5568,7 +5574,7 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
		intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
						      false);

	intel_encoders_disable(crtc, old_state);
	intel_encoders_disable(crtc, old_crtc_state, old_state);

	drm_crtc_vblank_off(crtc);
	assert_vblank_disabled(crtc);
@@ -5591,12 +5597,26 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
	if (!transcoder_is_dsi(cpu_transcoder))
		intel_ddi_disable_pipe_clock(intel_crtc);

	intel_encoders_post_disable(crtc, old_state);
	intel_encoders_post_disable(crtc, old_crtc_state, old_state);

	if (intel_crtc->config->has_pch_encoder) {
		struct drm_connector_state *old_conn_state;
		struct drm_connector *conn;
		int i;

		lpt_disable_pch_transcoder(dev_priv);
		lpt_disable_iclkip(dev_priv);
		intel_ddi_fdi_disable(crtc);

		for_each_connector_in_state(old_state, conn, old_conn_state, i)
			if (old_conn_state->crtc == crtc) {
				struct intel_encoder *encoder =
					to_intel_encoder(old_conn_state->best_encoder);

				intel_ddi_fdi_disable(encoder,
						      old_crtc_state,
						      old_conn_state);
				break;
			}

		intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
						      true);
@@ -6687,7 +6707,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,

	intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);

	intel_encoders_pre_pll_enable(crtc, old_state);
	intel_encoders_pre_pll_enable(crtc, pipe_config, old_state);

	if (IS_CHERRYVIEW(dev)) {
		chv_prepare_pll(intel_crtc, intel_crtc->config);
@@ -6697,7 +6717,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,
		vlv_enable_pll(intel_crtc, intel_crtc->config);
	}

	intel_encoders_pre_enable(crtc, old_state);
	intel_encoders_pre_enable(crtc, pipe_config, old_state);

	i9xx_pfit_enable(intel_crtc);

@@ -6709,7 +6729,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,
	assert_vblank_disabled(crtc);
	drm_crtc_vblank_on(crtc);

	intel_encoders_enable(crtc, old_state);
	intel_encoders_enable(crtc, pipe_config, old_state);
}

static void i9xx_set_pll_dividers(struct intel_crtc *crtc)
@@ -6748,7 +6768,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,
	if (!IS_GEN2(dev))
		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);

	intel_encoders_pre_enable(crtc, old_state);
	intel_encoders_pre_enable(crtc, pipe_config, old_state);

	i9xx_enable_pll(intel_crtc);

@@ -6762,7 +6782,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,
	assert_vblank_disabled(crtc);
	drm_crtc_vblank_on(crtc);

	intel_encoders_enable(crtc, old_state);
	intel_encoders_enable(crtc, pipe_config, old_state);
}

static void i9xx_pfit_disable(struct intel_crtc *crtc)
@@ -6796,7 +6816,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
	if (IS_GEN2(dev))
		intel_wait_for_vblank(dev, pipe);

	intel_encoders_disable(crtc, old_state);
	intel_encoders_disable(crtc, old_crtc_state, old_state);

	drm_crtc_vblank_off(crtc);
	assert_vblank_disabled(crtc);
@@ -6805,7 +6825,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,

	i9xx_pfit_disable(intel_crtc);

	intel_encoders_post_disable(crtc, old_state);
	intel_encoders_post_disable(crtc, old_crtc_state, old_state);

	if (!intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI)) {
		if (IS_CHERRYVIEW(dev))
@@ -6816,7 +6836,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
			i9xx_disable_pll(intel_crtc);
	}

	intel_encoders_post_pll_disable(crtc, old_state);
	intel_encoders_post_pll_disable(crtc, old_crtc_state, old_state);

	if (!IS_GEN2(dev))
		intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
@@ -16386,17 +16406,6 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc)
	return false;
}

static bool intel_encoder_has_connectors(struct intel_encoder *encoder)
{
	struct drm_device *dev = encoder->base.dev;
	struct intel_connector *connector;

	for_each_connector_on_encoder(dev, &encoder->base, connector)
		return true;

	return false;
}

static bool has_pch_trancoder(struct drm_i915_private *dev_priv,
			      enum transcoder pch_transcoder)
{
@@ -16500,6 +16509,7 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
{
	struct intel_connector *connector;
	struct drm_device *dev = encoder->base.dev;
	bool found_connector = false;

	/* We need to check both for a crtc link (meaning that the
	 * encoder is active and trying to read from a pipe) and the
@@ -16507,7 +16517,12 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
	bool has_active_crtc = encoder->base.crtc &&
		to_intel_crtc(encoder->base.crtc)->active;

	if (intel_encoder_has_connectors(encoder) && !has_active_crtc) {
	for_each_connector_on_encoder(dev, &encoder->base, connector) {
		found_connector = true;
		break;
	}

	if (found_connector && !has_active_crtc) {
		DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n",
			      encoder->base.base.id,
			      encoder->base.name);
@@ -16516,12 +16531,14 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
		 * fallout from our resume register restoring. Disable
		 * the encoder manually again. */
		if (encoder->base.crtc) {
			struct drm_crtc_state *crtc_state = encoder->base.crtc->state;

			DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n",
				      encoder->base.base.id,
				      encoder->base.name);
			encoder->disable(encoder);
			encoder->disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
			if (encoder->post_disable)
				encoder->post_disable(encoder);
				encoder->post_disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
		}
		encoder->base.crtc = NULL;

@@ -16529,13 +16546,10 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
		 * a bug in one of the get_hw_state functions. Or someplace else
		 * in our code, like the register restore mess on resume. Clamp
		 * things to off as a safer default. */
		for_each_intel_connector(dev, connector) {
			if (connector->encoder != encoder)
				continue;

		connector->base.dpms = DRM_MODE_DPMS_OFF;
		connector->base.encoder = NULL;
	}
	}
	/* Enabled encoders without active connectors will be fixed in
	 * the crtc fixup. */
}
+36 −12
Original line number Diff line number Diff line
@@ -2473,7 +2473,9 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
	}
}

static void intel_disable_dp(struct intel_encoder *encoder)
static void intel_disable_dp(struct intel_encoder *encoder,
			     struct intel_crtc_state *old_crtc_state,
			     struct drm_connector_state *old_conn_state)
{
	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
	struct drm_device *dev = encoder->base.dev;
@@ -2497,7 +2499,9 @@ static void intel_disable_dp(struct intel_encoder *encoder)
		intel_dp_link_down(intel_dp);
}

static void ilk_post_disable_dp(struct intel_encoder *encoder)
static void ilk_post_disable_dp(struct intel_encoder *encoder,
				struct intel_crtc_state *old_crtc_state,
				struct drm_connector_state *old_conn_state)
{
	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
	enum port port = dp_to_dig_port(intel_dp)->port;
@@ -2509,14 +2513,18 @@ static void ilk_post_disable_dp(struct intel_encoder *encoder)
		ironlake_edp_pll_off(intel_dp);
}

static void vlv_post_disable_dp(struct intel_encoder *encoder)
static void vlv_post_disable_dp(struct intel_encoder *encoder,
				struct intel_crtc_state *old_crtc_state,
				struct drm_connector_state *old_conn_state)
{
	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);

	intel_dp_link_down(intel_dp);
}

static void chv_post_disable_dp(struct intel_encoder *encoder)
static void chv_post_disable_dp(struct intel_encoder *encoder,
				struct intel_crtc_state *old_crtc_state,
				struct drm_connector_state *old_conn_state)
{
	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
	struct drm_device *dev = encoder->base.dev;
@@ -2690,7 +2698,9 @@ static void intel_enable_dp(struct intel_encoder *encoder)
	}
}

static void g4x_enable_dp(struct intel_encoder *encoder)
static void g4x_enable_dp(struct intel_encoder *encoder,
			  struct intel_crtc_state *pipe_config,
			  struct drm_connector_state *conn_state)
{
	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);

@@ -2698,7 +2708,9 @@ static void g4x_enable_dp(struct intel_encoder *encoder)
	intel_edp_backlight_on(intel_dp);
}

static void vlv_enable_dp(struct intel_encoder *encoder)
static void vlv_enable_dp(struct intel_encoder *encoder,
			  struct intel_crtc_state *pipe_config,
			  struct drm_connector_state *conn_state)
{
	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);

@@ -2706,7 +2718,9 @@ static void vlv_enable_dp(struct intel_encoder *encoder)
	intel_psr_enable(intel_dp);
}

static void g4x_pre_enable_dp(struct intel_encoder *encoder)
static void g4x_pre_enable_dp(struct intel_encoder *encoder,
			      struct intel_crtc_state *pipe_config,
			      struct drm_connector_state *conn_state)
{
	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
	enum port port = dp_to_dig_port(intel_dp)->port;
@@ -2821,21 +2835,27 @@ static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp)
	intel_dp_init_panel_power_sequencer_registers(dev, intel_dp);
}

static void vlv_pre_enable_dp(struct intel_encoder *encoder)
static void vlv_pre_enable_dp(struct intel_encoder *encoder,
			      struct intel_crtc_state *pipe_config,
			      struct drm_connector_state *conn_state)
{
	vlv_phy_pre_encoder_enable(encoder);

	intel_enable_dp(encoder);
}

static void vlv_dp_pre_pll_enable(struct intel_encoder *encoder)
static void vlv_dp_pre_pll_enable(struct intel_encoder *encoder,
				  struct intel_crtc_state *pipe_config,
				  struct drm_connector_state *conn_state)
{
	intel_dp_prepare(encoder);

	vlv_phy_pre_pll_enable(encoder);
}

static void chv_pre_enable_dp(struct intel_encoder *encoder)
static void chv_pre_enable_dp(struct intel_encoder *encoder,
			      struct intel_crtc_state *pipe_config,
			      struct drm_connector_state *conn_state)
{
	chv_phy_pre_encoder_enable(encoder);

@@ -2845,14 +2865,18 @@ static void chv_pre_enable_dp(struct intel_encoder *encoder)
	chv_phy_release_cl2_override(encoder);
}

static void chv_dp_pre_pll_enable(struct intel_encoder *encoder)
static void chv_dp_pre_pll_enable(struct intel_encoder *encoder,
				  struct intel_crtc_state *pipe_config,
				  struct drm_connector_state *conn_state)
{
	intel_dp_prepare(encoder);

	chv_phy_pre_pll_enable(encoder);
}

static void chv_dp_post_pll_disable(struct intel_encoder *encoder)
static void chv_dp_post_pll_disable(struct intel_encoder *encoder,
				    struct intel_crtc_state *pipe_config,
				    struct drm_connector_state *conn_state)
{
	chv_phy_post_pll_disable(encoder);
}
+15 −5
Original line number Diff line number Diff line
@@ -92,7 +92,9 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,

}

static void intel_mst_disable_dp(struct intel_encoder *encoder)
static void intel_mst_disable_dp(struct intel_encoder *encoder,
				 struct intel_crtc_state *old_crtc_state,
				 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;
@@ -109,7 +111,9 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder)
	}
}

static void intel_mst_post_disable_dp(struct intel_encoder *encoder)
static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
				      struct intel_crtc_state *old_crtc_state,
				      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;
@@ -128,12 +132,16 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder)

	intel_mst->connector = NULL;
	if (intel_dp->active_mst_links == 0) {
		intel_dig_port->base.post_disable(&intel_dig_port->base);
		intel_dig_port->base.post_disable(&intel_dig_port->base,
						  NULL, NULL);

		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
	}
}

static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
				    struct intel_crtc_state *pipe_config,
				    struct drm_connector_state *conn_state)
{
	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
	struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -200,7 +208,9 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
	ret = drm_dp_update_payload_part1(&intel_dp->mst_mgr);
}

static void intel_mst_enable_dp(struct intel_encoder *encoder)
static void intel_mst_enable_dp(struct intel_encoder *encoder,
				struct intel_crtc_state *pipe_config,
				struct drm_connector_state *conn_state)
{
	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
	struct intel_digital_port *intel_dig_port = intel_mst->primary;
Loading