diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-09-02 16:03:05 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-10-20 18:26:43 -0400 |
commit | d9d444cbc536050ef66e4cefcd55224c46cbbadf (patch) | |
tree | 590b93af00d9591c55a10c9d383698d0d11d8325 /drivers/gpu | |
parent | 27f8227b1e2b326a9a0995dd9c1f14893c61ee01 (diff) |
drm/i915: split refclk code out of ironlake_crtc_mode_set
Just a cleanup to make the mode_set function more manageable.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6b1a1edeafef..3b62b919fad5 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5241,6 +5241,40 @@ void ironlake_init_pch_refclk(struct drm_device *dev) | |||
5241 | } | 5241 | } |
5242 | } | 5242 | } |
5243 | 5243 | ||
5244 | static int ironlake_get_refclk(struct drm_crtc *crtc) | ||
5245 | { | ||
5246 | struct drm_device *dev = crtc->dev; | ||
5247 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5248 | struct intel_encoder *encoder; | ||
5249 | struct drm_mode_config *mode_config = &dev->mode_config; | ||
5250 | struct intel_encoder *edp_encoder = NULL; | ||
5251 | int num_connectors = 0; | ||
5252 | bool is_lvds = false; | ||
5253 | |||
5254 | list_for_each_entry(encoder, &mode_config->encoder_list, base.head) { | ||
5255 | if (encoder->base.crtc != crtc) | ||
5256 | continue; | ||
5257 | |||
5258 | switch (encoder->type) { | ||
5259 | case INTEL_OUTPUT_LVDS: | ||
5260 | is_lvds = true; | ||
5261 | break; | ||
5262 | case INTEL_OUTPUT_EDP: | ||
5263 | edp_encoder = encoder; | ||
5264 | break; | ||
5265 | } | ||
5266 | num_connectors++; | ||
5267 | } | ||
5268 | |||
5269 | if (is_lvds && intel_panel_use_ssc(dev_priv) && num_connectors < 2) { | ||
5270 | DRM_DEBUG_KMS("using SSC reference clock of %d MHz\n", | ||
5271 | dev_priv->lvds_ssc_freq); | ||
5272 | return dev_priv->lvds_ssc_freq * 1000; | ||
5273 | } | ||
5274 | |||
5275 | return 120000; | ||
5276 | } | ||
5277 | |||
5244 | static int ironlake_crtc_mode_set(struct drm_crtc *crtc, | 5278 | static int ironlake_crtc_mode_set(struct drm_crtc *crtc, |
5245 | struct drm_display_mode *mode, | 5279 | struct drm_display_mode *mode, |
5246 | struct drm_display_mode *adjusted_mode, | 5280 | struct drm_display_mode *adjusted_mode, |
@@ -5300,10 +5334,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, | |||
5300 | num_connectors++; | 5334 | num_connectors++; |
5301 | } | 5335 | } |
5302 | 5336 | ||
5303 | /* | 5337 | refclk = ironlake_get_refclk(crtc); |
5304 | * Every reference clock in a PCH system is 120MHz | ||
5305 | */ | ||
5306 | refclk = 120000; | ||
5307 | 5338 | ||
5308 | /* | 5339 | /* |
5309 | * Returns a set of divisors for the desired target clock with the given | 5340 | * Returns a set of divisors for the desired target clock with the given |