aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_drv.h
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-10-05 11:05:58 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-10 10:53:02 -0400
commit6441ab5f8ffdf7e99eefe0fb747858e0c12b567e (patch)
tree4408fc4fb3eeba522abf3a91ddd3b5a8af575b8f /drivers/gpu/drm/i915/intel_drv.h
parentee2b0b382a7e6cbf3549559ec7dc86c63f5aa3d1 (diff)
drm/i915: completely rewrite the Haswell PLL handling code
Problems with the previous code: - HDMI just uses WRPLL1 for everything, so dual head cases might not work sometimes. - At encoder->mode_set we just write the PLL register without doing any kind of check (e.g., check if the PLL is already being used). - There is no way to fail and return error codes at encoder->mode_set. - We write to PORT_CLK_SEL at mode_set and we never disable it. - Machines hang due to wrong clock enable/disable sequence. So here we rewrite the code, making it a little more like the pre-Haswell PLL mode set code: - Check PLL availability at ironlake_crtc_mode_set. - Try to use both WRPLLs. - Check if PLLs are used before actually trying to use them, and properly fail with error messages. - Enable/disable PORT_CLK_SEL at the right place. - Add some WARNs to check for bugs. The next improvement will be to try to reuse PLLs if the timings match, but this is content for another patch and it's already documented with a TODO comment. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_drv.h')
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5de365d70de..245319a4559 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -212,6 +212,7 @@ struct intel_crtc {
212 212
213 /* We can share PLLs across outputs if the timings match */ 213 /* We can share PLLs across outputs if the timings match */
214 struct intel_pch_pll *pch_pll; 214 struct intel_pch_pll *pch_pll;
215 uint32_t ddi_pll_sel;
215}; 216};
216 217
217struct intel_plane { 218struct intel_plane {
@@ -586,5 +587,10 @@ extern void intel_ddi_disable_pipe_func(struct drm_i915_private *dev_priv,
586 enum pipe pipe); 587 enum pipe pipe);
587extern void intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc); 588extern void intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc);
588extern void intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc); 589extern void intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc);
590extern void intel_ddi_setup_hw_pll_state(struct drm_device *dev);
591extern bool intel_ddi_pll_mode_set(struct drm_crtc *crtc, int clock);
592extern void intel_ddi_pre_enable(struct intel_encoder *intel_encoder);
593extern void intel_ddi_post_disable(struct intel_encoder *intel_encoder);
594extern void intel_ddi_put_crtc_pll(struct drm_crtc *crtc);
589 595
590#endif /* __INTEL_DRV_H__ */ 596#endif /* __INTEL_DRV_H__ */