summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-18 13:16:23 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-18 13:18:25 +0000
commit828a3a80aa3f0692e7be2831d58bccf02e2c481d (patch)
tree3975c3323534256998bc03620571c5a9ae14903d
parente17eaf540b614cdcb8f7349dd01852c3afc5ab05 (diff)
uxa: Clip dirty region to slave pixmap before appending damage
Fixes regression from commit c789d06cf8a0debc67058d7be1483f5b542e2baa Author: Dave Airlie <airlied@redhat.com> Date: Mon Jan 7 13:57:21 2013 +1000 intel: fixup damage posting to be done correctly around slave pixmap which causes the entire slave scanout to be readback from uncached memory every time a pixel is modified. Reported-by: Stephen Liang <inteldriver@angrywalls.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59539 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_driver.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c
index d22c0639..78071062 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -686,7 +686,7 @@ void IntelEmitInvarientState(ScrnInfoPtr scrn)
}
#ifdef INTEL_PIXMAP_SHARING
-static Bool
+static void
redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
@@ -695,9 +695,19 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
int was_blocked;
PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
-
+ RegionTranslate(&pixregion, dirty->x, dirty->y);
+ RegionIntersect(&pixregion, &pixregion, DamageRegion(dirty->damage));
+ RegionTranslate(&pixregion, -dirty->x, -dirty->y);
+ was_blocked = RegionNil(&pixregion);
DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
+ RegionUninit(&pixregion);
+ if (was_blocked)
+ return;
+
+ PixmapRegionInit(&pixregion, dirty->slave_dst->master_pixmap);
PixmapSyncDirtyHelper(dirty, &pixregion);
+ RegionUninit(&pixregion);
+
intel_batch_submit(scrn);
if (!intel->has_prime_vmap_flush) {
drm_intel_bo *bo = intel_get_pixmap_bo(dirty->slave_dst->master_pixmap);
@@ -706,10 +716,9 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
drm_intel_bo_unmap(bo);
xf86UnblockSIGIO(was_blocked);
}
- DamageRegionProcessPending(&dirty->slave_dst->drawable);
- RegionUninit(&pixregion);
- return 0;
+ DamageRegionProcessPending(&dirty->slave_dst->drawable);
+ return;
}
static void