diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-08-17 11:46:20 -0400 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-11-10 15:30:42 -0500 |
commit | e404ba8d06ff2a1bdb916a9e5d2c09cacd7e5ca3 (patch) | |
tree | ae345ebb5a738840c977316412dc07d16af0b0e7 /drivers/gpu | |
parent | abfce949052f323b6b0531c6cdc7ad0c3d501d94 (diff) |
drm/i915: Setup DDI clk for MST on SKL
Set up the DDI->PLL mapping on SKL also for MST links. Might help make
MST operational on SKL.
v2: Rebased due to KBL
Improve the patch subject, Jesse provided the new one
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1439826380-18403-1-git-send-email-ville.syrjala@linux.intel.com
References: https://bugs.freedesktop.org/show_bug.cgi?id=91791
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 49 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp_mst.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 |
3 files changed, 32 insertions, 27 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 50cadbad88eb..da46eddd80f4 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -2259,30 +2259,21 @@ uint32_t ddi_signal_levels(struct intel_dp *intel_dp) | |||
2259 | return DDI_BUF_TRANS_SELECT(level); | 2259 | return DDI_BUF_TRANS_SELECT(level); |
2260 | } | 2260 | } |
2261 | 2261 | ||
2262 | static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) | 2262 | void intel_ddi_clk_select(struct intel_encoder *encoder, |
2263 | const struct intel_crtc_state *pipe_config) | ||
2263 | { | 2264 | { |
2264 | struct drm_encoder *encoder = &intel_encoder->base; | 2265 | struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); |
2265 | struct drm_device *dev = encoder->dev; | 2266 | enum port port = intel_ddi_get_encoder_port(encoder); |
2266 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
2267 | struct intel_crtc *crtc = to_intel_crtc(encoder->crtc); | ||
2268 | enum port port = intel_ddi_get_encoder_port(intel_encoder); | ||
2269 | int type = intel_encoder->type; | ||
2270 | int hdmi_level; | ||
2271 | |||
2272 | if (type == INTEL_OUTPUT_EDP) { | ||
2273 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | ||
2274 | intel_edp_panel_on(intel_dp); | ||
2275 | } | ||
2276 | 2267 | ||
2277 | if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) { | 2268 | if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) { |
2278 | uint32_t dpll = crtc->config->ddi_pll_sel; | 2269 | uint32_t dpll = pipe_config->ddi_pll_sel; |
2279 | uint32_t val; | 2270 | uint32_t val; |
2280 | 2271 | ||
2281 | /* | 2272 | /* |
2282 | * DPLL0 is used for eDP and is the only "private" DPLL (as | 2273 | * DPLL0 is used for eDP and is the only "private" DPLL (as |
2283 | * opposed to shared) on SKL | 2274 | * opposed to shared) on SKL |
2284 | */ | 2275 | */ |
2285 | if (type == INTEL_OUTPUT_EDP) { | 2276 | if (encoder->type == INTEL_OUTPUT_EDP) { |
2286 | WARN_ON(dpll != SKL_DPLL0); | 2277 | WARN_ON(dpll != SKL_DPLL0); |
2287 | 2278 | ||
2288 | val = I915_READ(DPLL_CTRL1); | 2279 | val = I915_READ(DPLL_CTRL1); |
@@ -2290,7 +2281,7 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) | |||
2290 | val &= ~(DPLL_CTRL1_HDMI_MODE(dpll) | | 2281 | val &= ~(DPLL_CTRL1_HDMI_MODE(dpll) | |
2291 | DPLL_CTRL1_SSC(dpll) | | 2282 | DPLL_CTRL1_SSC(dpll) | |
2292 | DPLL_CTRL1_LINK_RATE_MASK(dpll)); | 2283 | DPLL_CTRL1_LINK_RATE_MASK(dpll)); |
2293 | val |= crtc->config->dpll_hw_state.ctrl1 << (dpll * 6); | 2284 | val |= pipe_config->dpll_hw_state.ctrl1 << (dpll * 6); |
2294 | 2285 | ||
2295 | I915_WRITE(DPLL_CTRL1, val); | 2286 | I915_WRITE(DPLL_CTRL1, val); |
2296 | POSTING_READ(DPLL_CTRL1); | 2287 | POSTING_READ(DPLL_CTRL1); |
@@ -2306,11 +2297,29 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) | |||
2306 | 2297 | ||
2307 | I915_WRITE(DPLL_CTRL2, val); | 2298 | I915_WRITE(DPLL_CTRL2, val); |
2308 | 2299 | ||
2309 | } else if (INTEL_INFO(dev)->gen < 9) { | 2300 | } else if (INTEL_INFO(dev_priv)->gen < 9) { |
2310 | WARN_ON(crtc->config->ddi_pll_sel == PORT_CLK_SEL_NONE); | 2301 | WARN_ON(pipe_config->ddi_pll_sel == PORT_CLK_SEL_NONE); |
2311 | I915_WRITE(PORT_CLK_SEL(port), crtc->config->ddi_pll_sel); | 2302 | I915_WRITE(PORT_CLK_SEL(port), pipe_config->ddi_pll_sel); |
2303 | } | ||
2304 | } | ||
2305 | |||
2306 | static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) | ||
2307 | { | ||
2308 | struct drm_encoder *encoder = &intel_encoder->base; | ||
2309 | struct drm_device *dev = encoder->dev; | ||
2310 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
2311 | struct intel_crtc *crtc = to_intel_crtc(encoder->crtc); | ||
2312 | enum port port = intel_ddi_get_encoder_port(intel_encoder); | ||
2313 | int type = intel_encoder->type; | ||
2314 | int hdmi_level; | ||
2315 | |||
2316 | if (type == INTEL_OUTPUT_EDP) { | ||
2317 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | ||
2318 | intel_edp_panel_on(intel_dp); | ||
2312 | } | 2319 | } |
2313 | 2320 | ||
2321 | intel_ddi_clk_select(intel_encoder, crtc->config); | ||
2322 | |||
2314 | if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { | 2323 | if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { |
2315 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | 2324 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); |
2316 | 2325 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 15372598b2c3..8a604ac797aa 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c | |||
@@ -173,20 +173,14 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) | |||
173 | intel_mst->port = found->port; | 173 | intel_mst->port = found->port; |
174 | 174 | ||
175 | if (intel_dp->active_mst_links == 0) { | 175 | if (intel_dp->active_mst_links == 0) { |
176 | enum port port = intel_ddi_get_encoder_port(encoder); | 176 | intel_ddi_clk_select(encoder, intel_crtc->config); |
177 | 177 | ||
178 | intel_dp_set_link_params(intel_dp, intel_crtc->config); | 178 | intel_dp_set_link_params(intel_dp, intel_crtc->config); |
179 | 179 | ||
180 | /* FIXME: add support for SKL */ | ||
181 | if (INTEL_INFO(dev)->gen < 9) | ||
182 | I915_WRITE(PORT_CLK_SEL(port), | ||
183 | intel_crtc->config->ddi_pll_sel); | ||
184 | |||
185 | intel_ddi_init_dp_buf_reg(&intel_dig_port->base); | 180 | intel_ddi_init_dp_buf_reg(&intel_dig_port->base); |
186 | 181 | ||
187 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); | 182 | intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); |
188 | 183 | ||
189 | |||
190 | intel_dp_start_link_train(intel_dp); | 184 | intel_dp_start_link_train(intel_dp); |
191 | intel_dp_stop_link_train(intel_dp); | 185 | intel_dp_stop_link_train(intel_dp); |
192 | } | 186 | } |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index f32a59493a09..3f80816dea69 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -997,6 +997,8 @@ void intel_crt_init(struct drm_device *dev); | |||
997 | 997 | ||
998 | 998 | ||
999 | /* intel_ddi.c */ | 999 | /* intel_ddi.c */ |
1000 | void intel_ddi_clk_select(struct intel_encoder *encoder, | ||
1001 | const struct intel_crtc_state *pipe_config); | ||
1000 | void intel_prepare_ddi(struct drm_device *dev); | 1002 | void intel_prepare_ddi(struct drm_device *dev); |
1001 | void hsw_fdi_link_train(struct drm_crtc *crtc); | 1003 | void hsw_fdi_link_train(struct drm_crtc *crtc); |
1002 | void intel_ddi_init(struct drm_device *dev, enum port port); | 1004 | void intel_ddi_init(struct drm_device *dev, enum port port); |