aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_sprite.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-13 12:36:55 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-13 14:10:00 -0400
commit93314b5b6f343f5a4c14c89d000007a754190c9a (patch)
tree688c2ae7fc464d986fbed8cae92c12ef4eef9645 /drivers/gpu/drm/i915/intel_sprite.c
parente188719a2891f01b3100dca4ae3a055fb5a7ab52 (diff)
drm/i915: Switch off FBC when disabling the primary plane when obscured
As we switch on/off the primary plane if it is completely obscured by an overlapping video sprite, we also nee to make sure that we update the FBC configuration at the same time. v2: Not all crtcs are intel_crtcs, as spotted by Daniel. v3: Boot testing rules. References: https://bugs.freedesktop.org/show_bug.cgi?id=50238 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Jani Nikula <jani.nikula@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sprite.c')
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 2a20fb0781d7..9d7777bc1545 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -326,6 +326,12 @@ intel_enable_primary(struct drm_crtc *crtc)
326 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 326 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
327 int reg = DSPCNTR(intel_crtc->plane); 327 int reg = DSPCNTR(intel_crtc->plane);
328 328
329 if (!intel_crtc->primary_disabled)
330 return;
331
332 intel_crtc->primary_disabled = false;
333 intel_update_fbc(dev);
334
329 I915_WRITE(reg, I915_READ(reg) | DISPLAY_PLANE_ENABLE); 335 I915_WRITE(reg, I915_READ(reg) | DISPLAY_PLANE_ENABLE);
330} 336}
331 337
@@ -337,7 +343,13 @@ intel_disable_primary(struct drm_crtc *crtc)
337 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 343 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
338 int reg = DSPCNTR(intel_crtc->plane); 344 int reg = DSPCNTR(intel_crtc->plane);
339 345
346 if (intel_crtc->primary_disabled)
347 return;
348
340 I915_WRITE(reg, I915_READ(reg) & ~DISPLAY_PLANE_ENABLE); 349 I915_WRITE(reg, I915_READ(reg) & ~DISPLAY_PLANE_ENABLE);
350
351 intel_crtc->primary_disabled = true;
352 intel_update_fbc(dev);
341} 353}
342 354
343static int 355static int
@@ -485,18 +497,14 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
485 * Be sure to re-enable the primary before the sprite is no longer 497 * Be sure to re-enable the primary before the sprite is no longer
486 * covering it fully. 498 * covering it fully.
487 */ 499 */
488 if (!disable_primary && intel_plane->primary_disabled) { 500 if (!disable_primary)
489 intel_enable_primary(crtc); 501 intel_enable_primary(crtc);
490 intel_plane->primary_disabled = false;
491 }
492 502
493 intel_plane->update_plane(plane, fb, obj, crtc_x, crtc_y, 503 intel_plane->update_plane(plane, fb, obj, crtc_x, crtc_y,
494 crtc_w, crtc_h, x, y, src_w, src_h); 504 crtc_w, crtc_h, x, y, src_w, src_h);
495 505
496 if (disable_primary) { 506 if (disable_primary)
497 intel_disable_primary(crtc); 507 intel_disable_primary(crtc);
498 intel_plane->primary_disabled = true;
499 }
500 508
501 /* Unpin old obj after new one is active to avoid ugliness */ 509 /* Unpin old obj after new one is active to avoid ugliness */
502 if (old_obj) { 510 if (old_obj) {
@@ -527,11 +535,8 @@ intel_disable_plane(struct drm_plane *plane)
527 struct intel_plane *intel_plane = to_intel_plane(plane); 535 struct intel_plane *intel_plane = to_intel_plane(plane);
528 int ret = 0; 536 int ret = 0;
529 537
530 if (intel_plane->primary_disabled) { 538 if (plane->crtc)
531 intel_enable_primary(plane->crtc); 539 intel_enable_primary(plane->crtc);
532 intel_plane->primary_disabled = false;
533 }
534
535 intel_plane->disable_plane(plane); 540 intel_plane->disable_plane(plane);
536 541
537 if (!intel_plane->obj) 542 if (!intel_plane->obj)