diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-19 08:49:18 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-19 08:51:48 +0000 |
commit | 928050d4e4b0ee958be897d148b60328e9207228 (patch) | |
tree | 3d83a1a3024995f8cce3062ea4e84c5c3b7b48af /src/sna/sna_dri2.c | |
parent | d04e3f63f98eab02614119d59f5df6767bbbf11a (diff) |
sna/dri2: Catch setting signal=true when we have no drawable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r-- | src/sna/sna_dri2.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 63c49327..0e184567 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -1507,6 +1507,7 @@ draw_current_msc(DrawablePtr draw, xf86CrtcPtr crtc, uint64_t msc) { struct dri2_window *priv; + assert(draw); if (draw->type != DRAWABLE_WINDOW) return msc; @@ -1595,6 +1596,8 @@ static void fake_swap_complete(struct sna *sna, ClientPtr client, { const struct ust_msc *swap; + assert(draw); + swap = sna_crtc_last_swap(crtc); DBG(("%s(type=%d): draw=%ld, pipe=%d, frame=%lld [msc %lld], tv=%d.%06d\n", __FUNCTION__, type, (long)draw->id, crtc ? sna_crtc_pipe(crtc) : -1, @@ -1716,6 +1719,8 @@ sna_dri2_client_gone(CallbackListPtr *list, void *closure, void *data) event->client = NULL; event->draw = NULL; + event->keepalive = 1; + assert(!event->signal); if (!event->queued) sna_dri2_event_free(event); @@ -1751,6 +1756,7 @@ sna_dri2_add_event(struct sna *sna, struct dri2_window *priv; struct sna_dri2_event *info, *chain; + assert(draw != NULL); assert(draw->type == DRAWABLE_WINDOW); DBG(("%s: adding event to window %ld)\n", __FUNCTION__, (long)draw->id)); @@ -1852,6 +1858,8 @@ void sna_dri2_destroy_window(WindowPtr win) info->signal = false; info->draw = NULL; + info->keepalive = 1; + assert(!info->signal); list_del(&info->link); chain = info->chain; @@ -2636,8 +2644,10 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event) else __sna_dri2_copy_event(info, info->sync | DRI2_BO); - info->keepalive++; - info->signal = true; + if (info->draw) { + info->keepalive++; + info->signal = true; + } } if (--info->keepalive) { @@ -2729,6 +2739,7 @@ sna_dri2_immediate_blit(struct sna *sna, bool signal = chain->signal; DBG(("%s: swap elision, unblocking client\n", __FUNCTION__)); + assert(chain->draw); chain->signal = true; frame_swap_complete(chain, DRI2_EXCHANGE_COMPLETE); chain->signal = signal; @@ -3072,6 +3083,7 @@ sna_dri2_schedule_flip(ClientPtr client, DrawablePtr draw, xf86CrtcPtr crtc, } else { info->flip_continue = FLIP_COMPLETE; signal = info->signal; + assert(info->draw); info->signal = true; goto new_back; } @@ -3363,6 +3375,7 @@ skip: info->type = SWAP_COMPLETE; info->event_complete = func; info->event_data = data; + assert(info->draw); info->signal = true; info->front = sna_dri2_reference_buffer(front); |