summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-16 09:39:10 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-16 09:39:10 +0000
commit3f56c3d50cc668e51ee649db8191da28bed3c582 (patch)
treecb02c57f2072080bb09b122145315f80e1f2a09b /src
parent4eb2d9dc92cec2053c76df5dc923f5552fd06c9e (diff)
sna/dri2: Flush outstanding signals when decoupling inflight events
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_dri2.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index c30e0fa1..afd26037 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1819,7 +1819,8 @@ sna_dri2_add_event(struct sna *sna,
static void decouple_window(WindowPtr win,
struct dri2_window *priv,
- struct sna *sna)
+ struct sna *sna,
+ bool signal)
{
if (priv->front) {
DBG(("%s: decouple private front\n", __FUNCTION__));
@@ -1843,6 +1844,12 @@ static void decouple_window(WindowPtr win,
assert(info->draw == &win->drawable);
if (info->pending.bo) {
+ if (signal) {
+ bool was_signalling = info->signal;
+ info->signal = true;
+ frame_swap_complete(info, DRI2_EXCHANGE_COMPLETE);
+ info->signal = was_signalling;
+ }
assert(info->pending.bo->active_scanout > 0);
info->pending.bo->active_scanout--;
@@ -1850,6 +1857,8 @@ static void decouple_window(WindowPtr win,
info->pending.bo = NULL;
}
+ if (info->signal && signal)
+ frame_swap_complete(info, DRI2_EXCHANGE_COMPLETE);
info->signal = false;
info->draw = NULL;
info->keepalive = 1;
@@ -1877,7 +1886,7 @@ void sna_dri2_decouple_window(WindowPtr win)
return;
DBG(("%s: window=%ld\n", __FUNCTION__, win->drawable.id));
- decouple_window(win, priv, to_sna_from_drawable(&win->drawable));
+ decouple_window(win, priv, to_sna_from_drawable(&win->drawable), true);
priv->scanout = -1;
}
@@ -1893,7 +1902,7 @@ void sna_dri2_destroy_window(WindowPtr win)
DBG(("%s: window=%ld\n", __FUNCTION__, win->drawable.id));
sna = to_sna_from_drawable(&win->drawable);
- decouple_window(win, priv, sna);
+ decouple_window(win, priv, sna, false);
while (!list_is_empty(&priv->cache)) {
struct dri_bo *c;