diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-11-10 09:56:07 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-11-10 09:58:52 +0000 |
commit | 64dbcdd4de1fe1941196265d054272d7d93e5d59 (patch) | |
tree | dd2431605316acb4da845639001cc1d1f8397df8 /src/sna | |
parent | 47f6c5b211c0458f2bf1e05a736e466bd8b64763 (diff) |
sna/dri2: Add a specific recursion indicator for TearFree/DRI2
Avoid conflating the DRI3/Present flag for controlling TearFree by
adding a separate flag to indicate when we are waiting inside the
TearFree shadow handler to avoid recursion in DRI2.
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92873
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna.h | 1 | ||||
-rw-r--r-- | src/sna/sna_display.c | 3 | ||||
-rw-r--r-- | src/sna/sna_dri2.c | 7 |
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)) |