summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-02-06 06:34:35 +0100
committerKeith Packard <keithp@keithp.com>2009-02-17 21:41:42 -0800
commita86dd529e9deaba61aee220d79ac607abbcb5dc6 (patch)
treed2b05f9d2bc13ff4a2bb5d4b4996500c898621c0
parent5946d603e76206105bea41a8beeb116daf209964 (diff)
Eliminate the shadow clear on transform change
When the crtc transformation changes, the entire crtc must be repainted. This was being done by clearing the shadow and then painting the rectangle containing the screen image; the clear being required as the screen image may not fill the crtc. When changing the transform rapidly, this leads to flashing. Eliminate the clear by painting the entire crtc instead of just the screen rectangle. (cherry picked fom commit 5394b7e66224d20888dd4020f5cb8ca930720fb4) Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/modes/xf86Crtc.h4
-rw-r--r--hw/xfree86/modes/xf86Rotate.c39
2 files changed, 29 insertions, 14 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 6761f6ed3..0a596bc49 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -337,6 +337,10 @@ struct _xf86Crtc {
BoxRec panningTotalArea;
BoxRec panningTrackingArea;
INT16 panningBorder[4];
+ /**
+ * Clear the shadow
+ */
+ Bool shadowClear;
};
typedef struct _xf86OutputFuncs {
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 66d97a9fb..9f573940d 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -113,22 +113,33 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
SetPicturePictFilter (src, crtc->filter,
crtc->params, crtc->nparams);
- while (n--)
+ if (crtc->shadowClear)
{
- BoxRec dst_box;
-
- dst_box = *b;
- dst_box.x1 -= crtc->filter_width >> 1;
- dst_box.x2 += crtc->filter_width >> 1;
- dst_box.y1 -= crtc->filter_height >> 1;
- dst_box.y2 += crtc->filter_height >> 1;
- pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &dst_box);
CompositePicture (PictOpSrc,
src, NULL, dst,
- dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1,
- dst_box.x2 - dst_box.x1,
- dst_box.y2 - dst_box.y1);
- b++;
+ 0, 0, 0, 0, 0, 0,
+ crtc->mode.HDisplay, crtc->mode.VDisplay);
+ crtc->shadowClear = FALSE;
+ }
+ else
+ {
+ while (n--)
+ {
+ BoxRec dst_box;
+
+ dst_box = *b;
+ dst_box.x1 -= crtc->filter_width >> 1;
+ dst_box.x2 += crtc->filter_width >> 1;
+ dst_box.y1 -= crtc->filter_height >> 1;
+ dst_box.y2 += crtc->filter_height >> 1;
+ pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &dst_box);
+ CompositePicture (PictOpSrc,
+ src, NULL, dst,
+ dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1,
+ dst_box.x2 - dst_box.x1,
+ dst_box.y2 - dst_box.y1);
+ b++;
+ }
}
FreePicture (src, None);
FreePicture (dst, None);
@@ -192,7 +203,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
&damage_region);
REGION_UNINIT (pScreen, &damage_region);
- xf86CrtcShadowClear (crtc);
+ crtc->shadowClear = TRUE;
}
static void