diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sprite.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sprite.c | 25 |
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 | ||
343 | static int | 355 | static 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) |