diff options
-rw-r--r-- | src/sna/sna_display.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index eacfe146..03595da0 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -1995,9 +1995,9 @@ get_scanout_bo(struct sna *sna, PixmapPtr pixmap) return priv->gpu_bo; } -static void clear(struct sna *sna, - PixmapPtr front, struct kgem_bo *bo, - xf86CrtcPtr crtc) +static void shadow_clear(struct sna *sna, + PixmapPtr front, struct kgem_bo *bo, + xf86CrtcPtr crtc) { bool ok = false; if (!wedged(sna)) @@ -2009,6 +2009,12 @@ static void clear(struct sna *sna, if (ptr) memset(ptr, 0, bo->pitch * crtc->mode.HDisplay); } + sna->mode.shadow_dirty = true; +} + +static bool rr_active(xf86CrtcPtr crtc) +{ + return crtc->transformPresent || crtc->rotation != RR_Rotate_0; } static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc) @@ -2082,7 +2088,7 @@ force_shadow: } front = sna_crtc->slave_pixmap ?: sna->front; - if (__sna_pixmap_get_bo(front) && !crtc->transformPresent) { + if (__sna_pixmap_get_bo(front) && !rr_active(crtc)) { BoxRec b; b.x1 = crtc->x; @@ -2100,7 +2106,7 @@ force_shadow: b.y2 = scrn->virtualY; if (b.x2 - b.x1 < crtc->mode.HDisplay || b.y2 - b.y1 < crtc->mode.VDisplay) - clear(sna, front, bo, crtc); + shadow_clear(sna, front, bo, crtc); if (b.y2 > b.y1 && b.x2 > b.x1) { DrawableRec tmp; @@ -2120,11 +2126,11 @@ force_shadow: if (!sna->render.copy_boxes(sna, GXcopy, &front->drawable, __sna_pixmap_get_bo(front), 0, 0, &tmp, bo, -crtc->x, -crtc->y, - &b, 1, 0)) - clear(sna, front, bo, crtc); + &b, 1, COPY_LAST)) + shadow_clear(sna, front, bo, crtc); } } else - clear(sna, front, bo, crtc); + shadow_clear(sna, front, bo, crtc); sna_crtc->shadow_bo_width = crtc->mode.HDisplay; sna_crtc->shadow_bo_height = crtc->mode.VDisplay; |