From 763df9eec79a867978efc5138d8635a46c1a0d17 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 3 Feb 2009 20:15:41 -0800 Subject: [PATCH] Damage re-used shadow scanout buffer using new transforms. When the shadow scanout buffer can be re-used, the underlying framebuffer area must be damaged so that the scanout will be repainted. This patch delays the addition of that damaged area until after the transform in the crtc has been updated, otherwise the old transform would have been used and the wrong area repainted. Signed-off-by: Keith Packard --- hw/xfree86/modes/xf86Rotate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 21b7aff97..dcc3ec02c 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -406,6 +406,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) int new_width = 0; int new_height = 0; RRTransformPtr transform = NULL; + Bool damage = FALSE; if (crtc->transformPresent) transform = &crtc->transform; @@ -466,7 +467,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) else { /* mark shadowed area as damaged so it will be repainted */ - xf86CrtcDamageShadow (crtc); + damage = TRUE; } if (!xf86_config->rotation_damage) @@ -540,6 +541,9 @@ xf86CrtcRotate (xf86CrtcPtr crtc) crtc->bounds.y2 = crtc->mode.VDisplay; pixman_f_transform_bounds (&f_crtc_to_fb, &crtc->bounds); + if (damage) + xf86CrtcDamageShadow (crtc); + /* All done */ return TRUE; }