summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-09-26 14:09:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-26 14:24:45 +0100
commit50bd37cf7fb811001e79a27b35e5cd0544391cd9 (patch)
treefc4bb8c0ebd8d7a474d5d5e1aaaeed5592e1abf9 /src
parentc9445af34a091f85d63f40982762fb58b267004d (diff)
sna: Simplify the clearing of a transformed frontbuffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index f54f4de2..c7806cea 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4021,6 +4021,7 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region)
{
struct sna *sna = to_sna(crtc->scrn);
struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
+ struct sna_pixmap *priv = sna_pixmap(sna->front);
int16_t tx, ty;
DBG(("%s: crtc %d [pipe=%d], damage (%d, %d), (%d, %d) x %ld\n",
@@ -4031,6 +4032,17 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region)
assert(!wedged(sna));
+ if (priv->clear) {
+ DBG(("%s: clear damage boxes\n", __FUNCTION__));
+
+ RegionTranslate(region, -crtc->bounds.x1, -crtc->bounds.y1);
+ sna_blt_fill_boxes(sna, GXcopy,
+ sna_crtc->bo, sna->front->drawable.bitsPerPixel,
+ priv->clear_color,
+ REGION_RECTS(region), REGION_NUM_RECTS(region));
+ return;
+ }
+
if (crtc->filter == NULL &&
sna_transform_is_integer_translation(&crtc->crtc_to_framebuffer,
&tx, &ty)) {
@@ -4048,7 +4060,7 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region)
*/
if (sna->render.copy_boxes(sna, GXcopy,
- sna->front, __sna_pixmap_get_bo(sna->front), 0, 0,
+ sna->front, priv->gpu_bo, 0, 0,
&tmp, sna_crtc->bo, -tx, -ty,
REGION_RECTS(region), REGION_NUM_RECTS(region), 0))
return;