[PATCH] Damage re-used shadow scanout buffer using new transforms.

Keith Packard keithp at keithp.com
Tue Feb 3 20:25:38 PST 2009


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 <keithp at keithp.com>
---
 hw/xfree86/modes/xf86Rotate.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 21b7aff..dcc3ec0 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;
 }
-- 
1.5.6.5




More information about the xorg mailing list