summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-12-03 17:04:09 +0900
committerAdam Jackson <ajax@redhat.com>2015-12-07 17:05:54 -0500
commit530d3e5ca0a02039b04ec6a677bbb4e05b78e5f4 (patch)
treede7ea53eab5baedeb83f4259f17948b39134a205 /dix
parent2a52c06e235bd79f91851121f53f7c1808fde321 (diff)
prime: Damage full destination rectangle when we start dirty tracking
This makes sure that the destination pixmap contents will be fully initialized. Without this, a PRIME output starts out with garbage. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/pixmap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/dix/pixmap.c b/dix/pixmap.c
index 05aebc42c..11d83fe00 100644
--- a/dix/pixmap.c
+++ b/dix/pixmap.c
@@ -173,6 +173,9 @@ PixmapStartDirtyTracking(PixmapPtr src,
{
ScreenPtr screen = src->drawable.pScreen;
PixmapDirtyUpdatePtr dirty_update;
+ RegionPtr damageregion;
+ RegionRec dstregion;
+ BoxRec box;
dirty_update = calloc(1, sizeof(PixmapDirtyUpdateRec));
if (!dirty_update)
@@ -205,6 +208,24 @@ PixmapStartDirtyTracking(PixmapPtr src,
return FALSE;
}
+ /* Damage destination rectangle so that the destination pixmap contents
+ * will get fully initialized
+ */
+ box.x1 = dirty_update->x;
+ box.y1 = dirty_update->y;
+ if (dirty_update->rotation == RR_Rotate_90 ||
+ dirty_update->rotation == RR_Rotate_270) {
+ box.x2 = dirty_update->x + slave_dst->drawable.height;
+ box.y2 = dirty_update->y + slave_dst->drawable.width;
+ } else {
+ box.x2 = dirty_update->x + slave_dst->drawable.width;
+ box.y2 = dirty_update->y + slave_dst->drawable.height;
+ }
+ RegionInit(&dstregion, &box, 1);
+ damageregion = DamageRegion(dirty_update->damage);
+ RegionUnion(damageregion, damageregion, &dstregion);
+ RegionUninit(&dstregion);
+
DamageRegister(&src->drawable, dirty_update->damage);
xorg_list_add(&dirty_update->ent, &screen->pixmap_dirty_list);
return TRUE;