summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_display.c3
-rw-r--r--src/sna/sna_dri2.c7
3 files changed, 7 insertions, 4 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 7592f7b4..3c19aa5d 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -304,6 +304,7 @@ struct sna {
unsigned flip_active;
unsigned hidden;
bool shadow_enabled;
+ bool shadow_wait;
bool dirty;
int max_crtc_width, max_crtc_height;
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 997150ed..a7dcb6bc 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1379,6 +1379,7 @@ static bool wait_for_shadow(struct sna *sna,
}
assert(sna->mode.shadow_active);
+ sna->mode.shadow_wait = true;
sna->mode.shadow_enabled = false;
flip_active = sna->mode.flip_active;
@@ -1432,6 +1433,8 @@ static bool wait_for_shadow(struct sna *sna,
}
}
assert(!sna->mode.shadow_enabled);
+ assert(sna->mode.shadow_wait);
+ sna->mode.shadow_wait = false;
sna->mode.shadow_enabled = true;
if (bo->refcnt > 1) {
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index dae1e77e..e9d91591 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2464,8 +2464,7 @@ static void chain_swap(struct sna_dri2_event *chain)
switch (chain->type) {
case SWAP_COMPLETE:
DBG(("%s: emitting chained vsync'ed blit\n", __FUNCTION__));
- if (chain->sna->mode.shadow &&
- !chain->sna->mode.shadow_enabled) {
+ if (chain->sna->mode.shadow && !chain->sna->mode.shadow_wait) {
/* recursed from wait_for_shadow(), simply requeue */
DBG(("%s -- recursed from wait_for_shadow(), requeuing\n", __FUNCTION__));
if (sna_next_vblank(chain))
@@ -2562,7 +2561,7 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event)
/* else fall through to blit */
case SWAP:
assert(info->signal);
- if (sna->mode.shadow && !sna->mode.shadow_enabled) {
+ if (sna->mode.shadow && !sna->mode.shadow_wait) {
/* recursed from wait_for_shadow(), simply requeue */
DBG(("%s -- recursed from wait_for_shadow(), requeuing\n", __FUNCTION__));
} else if (can_xchg(info->sna, draw, info->front, info->back)) {
@@ -2600,7 +2599,7 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event)
}
if (info->pending.bo) {
- if (sna->mode.shadow && !sna->mode.shadow_enabled) {
+ if (sna->mode.shadow && !sna->mode.shadow_wait) {
/* recursed from wait_for_shadow(), simply requeue */
DBG(("%s -- recursed from wait_for_shadow(), requeuing\n", __FUNCTION__));
if (sna_next_vblank(info))