aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-06-22 14:57:04 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-07-07 06:10:07 -0400
commit37a5650b5bd645d74f082f2cffd22e4db7f4b238 (patch)
tree5b85827faed44cd45539ec0a439ef8b5c11e5305
parent3d6e9ee0e125548c94417368ba53334445939bfd (diff)
drm/i915: Kill has_dp_encoder from pipe_config
Use the new output_types bitmask instead of has_dp_encoder. To make it less oainlful provide a small helper (intel_crtc_has_dp_encoder()) to do the bitsy stuff. v2: Rebase Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1466621833-5054-7-git-send-email-ville.syrjala@linux.intel.com
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c3
-rw-r--r--drivers/gpu/drm/i915/intel_display.c21
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c3
-rw-r--r--drivers/gpu/drm/i915/intel_dp_mst.c3
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h12
5 files changed, 19 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index d6efe8bf813b..aa12d0e9bb93 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -834,7 +834,7 @@ static void ddi_dotclock_get(struct intel_crtc_state *pipe_config)
834 if (pipe_config->has_pch_encoder) 834 if (pipe_config->has_pch_encoder)
835 dotclock = intel_dotclock_calculate(pipe_config->port_clock, 835 dotclock = intel_dotclock_calculate(pipe_config->port_clock,
836 &pipe_config->fdi_m_n); 836 &pipe_config->fdi_m_n);
837 else if (pipe_config->has_dp_encoder) 837 else if (intel_crtc_has_dp_encoder(pipe_config))
838 dotclock = intel_dotclock_calculate(pipe_config->port_clock, 838 dotclock = intel_dotclock_calculate(pipe_config->port_clock,
839 &pipe_config->dp_m_n); 839 &pipe_config->dp_m_n);
840 else if (pipe_config->has_hdmi_sink && pipe_config->pipe_bpp == 36) 840 else if (pipe_config->has_hdmi_sink && pipe_config->pipe_bpp == 36)
@@ -2211,7 +2211,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
2211 break; 2211 break;
2212 case TRANS_DDI_MODE_SELECT_DP_SST: 2212 case TRANS_DDI_MODE_SELECT_DP_SST:
2213 case TRANS_DDI_MODE_SELECT_DP_MST: 2213 case TRANS_DDI_MODE_SELECT_DP_MST:
2214 pipe_config->has_dp_encoder = true;
2215 pipe_config->lane_count = 2214 pipe_config->lane_count =
2216 ((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1; 2215 ((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1;
2217 intel_dp_get_m_n(intel_crtc, pipe_config); 2216 intel_dp_get_m_n(intel_crtc, pipe_config);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9f2ed96fda7a..15cb1e20a490 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4109,7 +4109,7 @@ static void ironlake_pch_enable(struct drm_crtc *crtc)
4109 intel_fdi_normal_train(crtc); 4109 intel_fdi_normal_train(crtc);
4110 4110
4111 /* For PCH DP, enable TRANS_DP_CTL */ 4111 /* For PCH DP, enable TRANS_DP_CTL */
4112 if (HAS_PCH_CPT(dev) && intel_crtc->config->has_dp_encoder) { 4112 if (HAS_PCH_CPT(dev) && intel_crtc_has_dp_encoder(intel_crtc->config)) {
4113 const struct drm_display_mode *adjusted_mode = 4113 const struct drm_display_mode *adjusted_mode =
4114 &intel_crtc->config->base.adjusted_mode; 4114 &intel_crtc->config->base.adjusted_mode;
4115 u32 bpc = (I915_READ(PIPECONF(pipe)) & PIPECONF_BPC_MASK) >> 5; 4115 u32 bpc = (I915_READ(PIPECONF(pipe)) & PIPECONF_BPC_MASK) >> 5;
@@ -4735,7 +4735,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
4735 if (intel_crtc->config->has_pch_encoder) 4735 if (intel_crtc->config->has_pch_encoder)
4736 intel_prepare_shared_dpll(intel_crtc); 4736 intel_prepare_shared_dpll(intel_crtc);
4737 4737
4738 if (intel_crtc->config->has_dp_encoder) 4738 if (intel_crtc_has_dp_encoder(intel_crtc->config))
4739 intel_dp_set_m_n(intel_crtc, M1_N1); 4739 intel_dp_set_m_n(intel_crtc, M1_N1);
4740 4740
4741 intel_set_pipe_timings(intel_crtc); 4741 intel_set_pipe_timings(intel_crtc);
@@ -4826,7 +4826,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
4826 if (intel_crtc->config->shared_dpll) 4826 if (intel_crtc->config->shared_dpll)
4827 intel_enable_shared_dpll(intel_crtc); 4827 intel_enable_shared_dpll(intel_crtc);
4828 4828
4829 if (intel_crtc->config->has_dp_encoder) 4829 if (intel_crtc_has_dp_encoder(intel_crtc->config))
4830 intel_dp_set_m_n(intel_crtc, M1_N1); 4830 intel_dp_set_m_n(intel_crtc, M1_N1);
4831 4831
4832 if (!intel_crtc->config->has_dsi_encoder) 4832 if (!intel_crtc->config->has_dsi_encoder)
@@ -6129,7 +6129,7 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
6129 if (WARN_ON(intel_crtc->active)) 6129 if (WARN_ON(intel_crtc->active))
6130 return; 6130 return;
6131 6131
6132 if (intel_crtc->config->has_dp_encoder) 6132 if (intel_crtc_has_dp_encoder(intel_crtc->config))
6133 intel_dp_set_m_n(intel_crtc, M1_N1); 6133 intel_dp_set_m_n(intel_crtc, M1_N1);
6134 6134
6135 intel_set_pipe_timings(intel_crtc); 6135 intel_set_pipe_timings(intel_crtc);
@@ -6202,7 +6202,7 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc)
6202 6202
6203 i9xx_set_pll_dividers(intel_crtc); 6203 i9xx_set_pll_dividers(intel_crtc);
6204 6204
6205 if (intel_crtc->config->has_dp_encoder) 6205 if (intel_crtc_has_dp_encoder(intel_crtc->config))
6206 intel_dp_set_m_n(intel_crtc, M1_N1); 6206 intel_dp_set_m_n(intel_crtc, M1_N1);
6207 6207
6208 intel_set_pipe_timings(intel_crtc); 6208 intel_set_pipe_timings(intel_crtc);
@@ -7373,7 +7373,7 @@ static void vlv_prepare_pll(struct intel_crtc *crtc,
7373 vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW10(pipe), 7373 vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW10(pipe),
7374 0x00d0000f); 7374 0x00d0000f);
7375 7375
7376 if (pipe_config->has_dp_encoder) { 7376 if (intel_crtc_has_dp_encoder(pipe_config)) {
7377 /* Use SSC source */ 7377 /* Use SSC source */
7378 if (pipe == PIPE_A) 7378 if (pipe == PIPE_A)
7379 vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe), 7379 vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW5(pipe),
@@ -7590,7 +7590,7 @@ static void i9xx_compute_dpll(struct intel_crtc *crtc,
7590 intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) 7590 intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
7591 dpll |= DPLL_SDVO_HIGH_SPEED; 7591 dpll |= DPLL_SDVO_HIGH_SPEED;
7592 7592
7593 if (crtc_state->has_dp_encoder) 7593 if (intel_crtc_has_dp_encoder(crtc_state))
7594 dpll |= DPLL_SDVO_HIGH_SPEED; 7594 dpll |= DPLL_SDVO_HIGH_SPEED;
7595 7595
7596 /* compute bitmask from p1 value */ 7596 /* compute bitmask from p1 value */
@@ -8935,7 +8935,7 @@ static void ironlake_compute_dpll(struct intel_crtc *intel_crtc,
8935 intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) 8935 intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
8936 dpll |= DPLL_SDVO_HIGH_SPEED; 8936 dpll |= DPLL_SDVO_HIGH_SPEED;
8937 8937
8938 if (crtc_state->has_dp_encoder) 8938 if (intel_crtc_has_dp_encoder(crtc_state))
8939 dpll |= DPLL_SDVO_HIGH_SPEED; 8939 dpll |= DPLL_SDVO_HIGH_SPEED;
8940 8940
8941 /* compute bitmask from p1 value */ 8941 /* compute bitmask from p1 value */
@@ -12238,14 +12238,14 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
12238 pipe_config->fdi_m_n.link_m, pipe_config->fdi_m_n.link_n, 12238 pipe_config->fdi_m_n.link_m, pipe_config->fdi_m_n.link_n,
12239 pipe_config->fdi_m_n.tu); 12239 pipe_config->fdi_m_n.tu);
12240 DRM_DEBUG_KMS("dp: %i, lanes: %i, gmch_m: %u, gmch_n: %u, link_m: %u, link_n: %u, tu: %u\n", 12240 DRM_DEBUG_KMS("dp: %i, lanes: %i, gmch_m: %u, gmch_n: %u, link_m: %u, link_n: %u, tu: %u\n",
12241 pipe_config->has_dp_encoder, 12241 intel_crtc_has_dp_encoder(pipe_config),
12242 pipe_config->lane_count, 12242 pipe_config->lane_count,
12243 pipe_config->dp_m_n.gmch_m, pipe_config->dp_m_n.gmch_n, 12243 pipe_config->dp_m_n.gmch_m, pipe_config->dp_m_n.gmch_n,
12244 pipe_config->dp_m_n.link_m, pipe_config->dp_m_n.link_n, 12244 pipe_config->dp_m_n.link_m, pipe_config->dp_m_n.link_n,
12245 pipe_config->dp_m_n.tu); 12245 pipe_config->dp_m_n.tu);
12246 12246
12247 DRM_DEBUG_KMS("dp: %i, lanes: %i, gmch_m2: %u, gmch_n2: %u, link_m2: %u, link_n2: %u, tu2: %u\n", 12247 DRM_DEBUG_KMS("dp: %i, lanes: %i, gmch_m2: %u, gmch_n2: %u, link_m2: %u, link_n2: %u, tu2: %u\n",
12248 pipe_config->has_dp_encoder, 12248 intel_crtc_has_dp_encoder(pipe_config),
12249 pipe_config->lane_count, 12249 pipe_config->lane_count,
12250 pipe_config->dp_m2_n2.gmch_m, 12250 pipe_config->dp_m2_n2.gmch_m,
12251 pipe_config->dp_m2_n2.gmch_n, 12251 pipe_config->dp_m2_n2.gmch_n,
@@ -12773,7 +12773,6 @@ intel_pipe_config_compare(struct drm_device *dev,
12773 PIPE_CONF_CHECK_I(fdi_lanes); 12773 PIPE_CONF_CHECK_I(fdi_lanes);
12774 PIPE_CONF_CHECK_M_N(fdi_m_n); 12774 PIPE_CONF_CHECK_M_N(fdi_m_n);
12775 12775
12776 PIPE_CONF_CHECK_I(has_dp_encoder);
12777 PIPE_CONF_CHECK_I(lane_count); 12776 PIPE_CONF_CHECK_I(lane_count);
12778 PIPE_CONF_CHECK_X(lane_lat_optim_mask); 12777 PIPE_CONF_CHECK_X(lane_lat_optim_mask);
12779 12778
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 66dd8ff52e17..3a392c42cd3d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1501,7 +1501,6 @@ intel_dp_compute_config(struct intel_encoder *encoder,
1501 if (HAS_PCH_SPLIT(dev) && !HAS_DDI(dev) && port != PORT_A) 1501 if (HAS_PCH_SPLIT(dev) && !HAS_DDI(dev) && port != PORT_A)
1502 pipe_config->has_pch_encoder = true; 1502 pipe_config->has_pch_encoder = true;
1503 1503
1504 pipe_config->has_dp_encoder = true;
1505 pipe_config->has_drrs = false; 1504 pipe_config->has_drrs = false;
1506 pipe_config->has_audio = intel_dp->has_audio && port != PORT_A; 1505 pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
1507 1506
@@ -2442,8 +2441,6 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
2442 !IS_CHERRYVIEW(dev) && tmp & DP_COLOR_RANGE_16_235) 2441 !IS_CHERRYVIEW(dev) && tmp & DP_COLOR_RANGE_16_235)
2443 pipe_config->limited_color_range = true; 2442 pipe_config->limited_color_range = true;
2444 2443
2445 pipe_config->has_dp_encoder = true;
2446
2447 pipe_config->lane_count = 2444 pipe_config->lane_count =
2448 ((tmp & DP_PORT_WIDTH_MASK) >> DP_PORT_WIDTH_SHIFT) + 1; 2445 ((tmp & DP_PORT_WIDTH_MASK) >> DP_PORT_WIDTH_SHIFT) + 1;
2449 2446
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 81800877b1af..68a005d729e9 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -47,7 +47,6 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,
47 47
48 pipe_config->dp_encoder_is_mst = true; 48 pipe_config->dp_encoder_is_mst = true;
49 pipe_config->has_pch_encoder = false; 49 pipe_config->has_pch_encoder = false;
50 pipe_config->has_dp_encoder = true;
51 bpp = 24; 50 bpp = 24;
52 /* 51 /*
53 * for MST we always configure max link bw - the spec doesn't 52 * for MST we always configure max link bw - the spec doesn't
@@ -246,8 +245,6 @@ static void intel_dp_mst_enc_get_config(struct intel_encoder *encoder,
246 enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; 245 enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
247 u32 temp, flags = 0; 246 u32 temp, flags = 0;
248 247
249 pipe_config->has_dp_encoder = true;
250
251 temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder)); 248 temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
252 if (temp & TRANS_DDI_PHSYNC) 249 if (temp & TRANS_DDI_PHSYNC)
253 flags |= DRM_MODE_FLAG_PHSYNC; 250 flags |= DRM_MODE_FLAG_PHSYNC;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index f4710558150f..de8e64395ff3 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -522,10 +522,6 @@ struct intel_crtc_state {
522 */ 522 */
523 bool limited_color_range; 523 bool limited_color_range;
524 524
525 /* DP has a bunch of special case unfortunately, so mark the pipe
526 * accordingly. */
527 bool has_dp_encoder;
528
529 /* DSI has special cases */ 525 /* DSI has special cases */
530 bool has_dsi_encoder; 526 bool has_dsi_encoder;
531 527
@@ -1198,6 +1194,14 @@ intel_crtc_has_type(const struct intel_crtc_state *crtc_state,
1198{ 1194{
1199 return crtc_state->output_types & (1 << type); 1195 return crtc_state->output_types & (1 << type);
1200} 1196}
1197static inline bool
1198intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state)
1199{
1200 return crtc_state->output_types &
1201 ((1 << INTEL_OUTPUT_DISPLAYPORT) |
1202 (1 << INTEL_OUTPUT_DP_MST) |
1203 (1 << INTEL_OUTPUT_EDP));
1204}
1201static inline void 1205static inline void
1202intel_wait_for_vblank(struct drm_device *dev, int pipe) 1206intel_wait_for_vblank(struct drm_device *dev, int pipe)
1203{ 1207{