summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-24 07:34:46 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-24 09:01:58 +0100
commit6e2cee27c379278b0321fd1db34ed80c439115a7 (patch)
treea2e0dc8ff290653e4775a96cff0f364613854308 /src/sna
parent706480bde6120f84388a99085ed3d1cc3b759697 (diff)
sna/dri2: Add a dash more asserts
References: https://bugs.freedesktop.org/attachment.cgi?id=101618 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_dri2.c11
-rw-r--r--src/sna/sna_render.c2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 686fd605..4220f8f8 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1313,15 +1313,19 @@ void sna_dri2_destroy_window(WindowPtr win)
info = priv->chain;
info->draw = NULL;
+ info->client = NULL;
chain = info->chain;
info->chain = NULL;
assert(info->queued);
while ((info = chain)) {
+ info->draw = NULL;
+ info->client = NULL;
+
chain = info->chain;
info->chain = NULL;
- info->draw = NULL;
+
if (!info->queued)
sna_dri2_event_free(sna, NULL, info);
}
@@ -1787,6 +1791,8 @@ static void frame_swap_complete(struct sna *sna,
if (frame->draw == NULL)
return;
+ assert(frame->client);
+
swap = sna_crtc_last_swap(frame->crtc);
DBG(("%s: draw=%ld, pipe=%d, frame=%lld [msc=%lld], tv=%d.%06d\n",
__FUNCTION__, (long)frame->draw, frame->pipe,
@@ -2146,6 +2152,7 @@ static void chain_flip(struct sna *sna)
}
assert(chain == dri2_chain(chain->draw));
+ assert(!chain->queued);
chain->queued = true;
if (can_flip(sna, chain->draw, chain->front, chain->back, chain->crtc) &&
@@ -2153,7 +2160,6 @@ static void chain_flip(struct sna *sna)
DBG(("%s: performing chained flip\n", __FUNCTION__));
} else {
DBG(("%s: emitting chained vsync'ed blit\n", __FUNCTION__));
- assert(chain->queued);
chain->bo = __sna_dri2_copy_region(sna, chain->draw, NULL,
chain->back, chain->front,
true);
@@ -2185,6 +2191,7 @@ static void sna_dri2_flip_event(struct sna *sna,
struct sna_dri2_event *flip)
{
DBG(("%s(pipe=%d, event=%d)\n", __FUNCTION__, flip->pipe, flip->type));
+ assert(flip->queued);
if (sna->dri2.flip_pending == flip)
sna->dri2.flip_pending = NULL;
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 3b8a54af..e8060b41 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1348,10 +1348,10 @@ sna_render_picture_convolve(struct sna *sna,
DBG(("%s: pixmap allocation failed\n", __FUNCTION__));
return -1;
}
- assert(__sna_pixmap_get_bo(tmp));
tmp = NULL;
bo = __sna_pixmap_get_bo(pixmap);
+ assert(bo);
if (sna->render.clear(sna, pixmap, bo))
tmp = CreatePicture(0, &pixmap->drawable,
PictureMatchFormat(screen, depth, channel->pict_format),