diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-09-10 13:47:20 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-10 18:12:55 -0400 |
commit | 7e7d76c306adb73a41d2678a42a11004df2519b7 (patch) | |
tree | 2d21776f3fa52172b6edb68a61b415864cf3bc6d /drivers/gpu/drm/i915/intel_display.c | |
parent | 4d12fe0b4864682d3562021cde0f32961c655d75 (diff) |
drm/i915: use i915 and Ironlake CRTC enable/disable functions in prepare/commit
This will allow us to optimize our prepare/commit paths a bit better.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
[ickle: minor tweak to handle the cursor across pipe resizing]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 69 |
1 files changed, 60 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index fecb98c2d8ad..98276b8454fc 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2478,16 +2478,60 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2478 | } | 2478 | } |
2479 | } | 2479 | } |
2480 | 2480 | ||
2481 | static void intel_crtc_prepare (struct drm_crtc *crtc) | 2481 | /* Prepare for a mode set. |
2482 | * | ||
2483 | * Note we could be a lot smarter here. We need to figure out which outputs | ||
2484 | * will be enabled, which disabled (in short, how the config will changes) | ||
2485 | * and perform the minimum necessary steps to accomplish that, e.g. updating | ||
2486 | * watermarks, FBC configuration, making sure PLLs are programmed correctly, | ||
2487 | * panel fitting is in the proper state, etc. | ||
2488 | */ | ||
2489 | static void i9xx_crtc_prepare(struct drm_crtc *crtc) | ||
2482 | { | 2490 | { |
2483 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 2491 | struct drm_device *dev = crtc->dev; |
2484 | crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF); | 2492 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
2493 | |||
2494 | intel_crtc->cursor_on = false; | ||
2495 | intel_crtc_update_cursor(crtc); | ||
2496 | |||
2497 | i9xx_crtc_disable(crtc); | ||
2498 | intel_clear_scanline_wait(dev); | ||
2485 | } | 2499 | } |
2486 | 2500 | ||
2487 | static void intel_crtc_commit (struct drm_crtc *crtc) | 2501 | static void i9xx_crtc_commit(struct drm_crtc *crtc) |
2488 | { | 2502 | { |
2489 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 2503 | struct drm_device *dev = crtc->dev; |
2490 | crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON); | 2504 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
2505 | |||
2506 | intel_update_watermarks(dev); | ||
2507 | i9xx_crtc_enable(crtc); | ||
2508 | |||
2509 | intel_crtc->cursor_on = true; | ||
2510 | intel_crtc_update_cursor(crtc); | ||
2511 | } | ||
2512 | |||
2513 | static void ironlake_crtc_prepare(struct drm_crtc *crtc) | ||
2514 | { | ||
2515 | struct drm_device *dev = crtc->dev; | ||
2516 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
2517 | |||
2518 | intel_crtc->cursor_on = false; | ||
2519 | intel_crtc_update_cursor(crtc); | ||
2520 | |||
2521 | ironlake_crtc_disable(crtc); | ||
2522 | intel_clear_scanline_wait(dev); | ||
2523 | } | ||
2524 | |||
2525 | static void ironlake_crtc_commit(struct drm_crtc *crtc) | ||
2526 | { | ||
2527 | struct drm_device *dev = crtc->dev; | ||
2528 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
2529 | |||
2530 | intel_update_watermarks(dev); | ||
2531 | ironlake_crtc_enable(crtc); | ||
2532 | |||
2533 | intel_crtc->cursor_on = true; | ||
2534 | intel_crtc_update_cursor(crtc); | ||
2491 | } | 2535 | } |
2492 | 2536 | ||
2493 | void intel_encoder_prepare (struct drm_encoder *encoder) | 2537 | void intel_encoder_prepare (struct drm_encoder *encoder) |
@@ -5184,14 +5228,12 @@ cleanup_work: | |||
5184 | return ret; | 5228 | return ret; |
5185 | } | 5229 | } |
5186 | 5230 | ||
5187 | static const struct drm_crtc_helper_funcs intel_helper_funcs = { | 5231 | static struct drm_crtc_helper_funcs intel_helper_funcs = { |
5188 | .dpms = intel_crtc_dpms, | 5232 | .dpms = intel_crtc_dpms, |
5189 | .mode_fixup = intel_crtc_mode_fixup, | 5233 | .mode_fixup = intel_crtc_mode_fixup, |
5190 | .mode_set = intel_crtc_mode_set, | 5234 | .mode_set = intel_crtc_mode_set, |
5191 | .mode_set_base = intel_pipe_set_base, | 5235 | .mode_set_base = intel_pipe_set_base, |
5192 | .mode_set_base_atomic = intel_pipe_set_base_atomic, | 5236 | .mode_set_base_atomic = intel_pipe_set_base_atomic, |
5193 | .prepare = intel_crtc_prepare, | ||
5194 | .commit = intel_crtc_commit, | ||
5195 | .load_lut = intel_crtc_load_lut, | 5237 | .load_lut = intel_crtc_load_lut, |
5196 | }; | 5238 | }; |
5197 | 5239 | ||
@@ -5241,6 +5283,15 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) | |||
5241 | 5283 | ||
5242 | intel_crtc->cursor_addr = 0; | 5284 | intel_crtc->cursor_addr = 0; |
5243 | intel_crtc->dpms_mode = -1; | 5285 | intel_crtc->dpms_mode = -1; |
5286 | |||
5287 | if (HAS_PCH_SPLIT(dev)) { | ||
5288 | intel_helper_funcs.prepare = ironlake_crtc_prepare; | ||
5289 | intel_helper_funcs.commit = ironlake_crtc_commit; | ||
5290 | } else { | ||
5291 | intel_helper_funcs.prepare = i9xx_crtc_prepare; | ||
5292 | intel_helper_funcs.commit = i9xx_crtc_commit; | ||
5293 | } | ||
5294 | |||
5244 | drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs); | 5295 | drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs); |
5245 | 5296 | ||
5246 | intel_crtc->busy = false; | 5297 | intel_crtc->busy = false; |