aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-09-27 01:24:57 -0400
committerKeith Packard <keithp@keithp.com>2011-09-28 17:08:38 -0400
commit9fb526db979581841227e1ed4f75a5fbe853db4a (patch)
treeb4171d88d0d535f178ca33787556246c502f7c90 /drivers/gpu
parentafffb9dfb62a9eb2a6e467a3875907189e49a2d2 (diff)
drm/i915: Initialize PCH refclks at modeset init time
The reference clock configuration must be done before any mode setting can occur as all outputs must be disabled to change anything. Initialize the clocks after turning everything off during the initialization process. Also, re-initialize the refclk at resume time. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c3
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c10
3 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 58480deacc07..2b6c2d2f223b 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -471,6 +471,9 @@ static int i915_drm_thaw(struct drm_device *dev)
471 error = i915_gem_init_ringbuffer(dev); 471 error = i915_gem_init_ringbuffer(dev);
472 mutex_unlock(&dev->struct_mutex); 472 mutex_unlock(&dev->struct_mutex);
473 473
474 if (HAS_PCH_SPLIT(dev))
475 ironlake_init_pch_refclk(dev);
476
474 drm_mode_config_reset(dev); 477 drm_mode_config_reset(dev);
475 drm_irq_install(dev); 478 drm_irq_install(dev);
476 479
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 18df595b3992..98f2e0bf80de 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1302,6 +1302,7 @@ extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
1302extern bool intel_fbc_enabled(struct drm_device *dev); 1302extern bool intel_fbc_enabled(struct drm_device *dev);
1303extern void intel_disable_fbc(struct drm_device *dev); 1303extern void intel_disable_fbc(struct drm_device *dev);
1304extern bool ironlake_set_drps(struct drm_device *dev, u8 val); 1304extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
1305extern void ironlake_init_pch_refclk(struct drm_device *dev);
1305extern void ironlake_enable_rc6(struct drm_device *dev); 1306extern void ironlake_enable_rc6(struct drm_device *dev);
1306extern void gen6_set_rps(struct drm_device *dev, u8 val); 1307extern void gen6_set_rps(struct drm_device *dev, u8 val);
1307extern void intel_detect_pch (struct drm_device *dev); 1308extern void intel_detect_pch (struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b072a35b6f52..91d7d5ed33ae 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5109,7 +5109,10 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
5109 return ret; 5109 return ret;
5110} 5110}
5111 5111
5112static void ironlake_update_pch_refclk(struct drm_device *dev) 5112/*
5113 * Initialize reference clocks when the driver loads
5114 */
5115void ironlake_init_pch_refclk(struct drm_device *dev)
5113{ 5116{
5114 struct drm_i915_private *dev_priv = dev->dev_private; 5117 struct drm_i915_private *dev_priv = dev->dev_private;
5115 struct drm_mode_config *mode_config = &dev->mode_config; 5118 struct drm_mode_config *mode_config = &dev->mode_config;
@@ -5411,8 +5414,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
5411 ironlake_compute_m_n(intel_crtc->bpp, lane, target_clock, link_bw, 5414 ironlake_compute_m_n(intel_crtc->bpp, lane, target_clock, link_bw,
5412 &m_n); 5415 &m_n);
5413 5416
5414 ironlake_update_pch_refclk(dev);
5415
5416 fp = clock.n << 16 | clock.m1 << 8 | clock.m2; 5417 fp = clock.n << 16 | clock.m1 << 8 | clock.m2;
5417 if (has_reduced_clock) 5418 if (has_reduced_clock)
5418 fp2 = reduced_clock.n << 16 | reduced_clock.m1 << 8 | 5419 fp2 = reduced_clock.n << 16 | reduced_clock.m1 << 8 |
@@ -7284,6 +7285,9 @@ static void intel_setup_outputs(struct drm_device *dev)
7284 7285
7285 /* disable all the possible outputs/crtcs before entering KMS mode */ 7286 /* disable all the possible outputs/crtcs before entering KMS mode */
7286 drm_helper_disable_unused_functions(dev); 7287 drm_helper_disable_unused_functions(dev);
7288
7289 if (HAS_PCH_SPLIT(dev))
7290 ironlake_init_pch_refclk(dev);
7287} 7291}
7288 7292
7289static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) 7293static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)