summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-04 10:07:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-04 10:07:51 +0100
commit4556ac396ed46a476cc970946011e377451346ff (patch)
treeb4e587c3d5946e913d92866d1a0aafd8c214dd28 /src
parent9154dff9aedad3271f629edb1ccc9c8d273ca7bc (diff)
sna: Track TearFree shadow as an active scanout
Don't allow DRI2 to hand back the current shadow buffer as a Drawable's next back buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index e9f3707b..10d33f25 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1726,11 +1726,13 @@ static bool wait_for_shadow(struct sna *sna,
sna_pixmap_unmap(pixmap, priv);
DBG(("%s: setting front pixmap to handle=%d\n", __FUNCTION__, bo->handle));
+ sna->mode.shadow->active_scanout--;
tmp = priv->gpu_bo;
priv->gpu_bo = bo;
if (bo != sna->mode.shadow)
kgem_bo_destroy(&sna->kgem, sna->mode.shadow);
sna->mode.shadow = tmp;
+ sna->mode.shadow->active_scanout++;
sna_dri2_pixmap_update_bo(sna, pixmap, bo);
@@ -1852,6 +1854,7 @@ static void sna_mode_disable_shadow(struct sna *sna)
sna->mode.shadow_enabled = false;
if (sna->mode.shadow) {
+ sna->mode.shadow->active_scanout--;
kgem_bo_destroy(&sna->kgem, sna->mode.shadow);
sna->mode.shadow = NULL;
}
@@ -2323,6 +2326,7 @@ static void set_shadow(struct sna *sna, RegionPtr region)
assert(priv->gpu_bo);
assert(sna->mode.shadow);
+ assert(sna->mode.shadow->active_scanout);
DBG(("%s: waiting for region %dx[(%d, %d), (%d, %d)], front handle=%d, shadow handle=%d\n",
__FUNCTION__,
@@ -2631,6 +2635,7 @@ out_shadow:
assert(__sna_pixmap_get_bo(sna->front) == NULL ||
__sna_pixmap_get_bo(sna->front)->pitch == shadow->pitch);
sna->mode.shadow = shadow;
+ sna->mode.shadow->active_scanout++;
}
set_shadow(sna, &region);