summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-12 21:53:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-12 21:53:38 +0000
commit3b82d93162b9e127c6d055d5007e75fcc31f4af8 (patch)
treed257daa1c81399a9590487147ae136be91da8500 /src/sna
parent04e4805f57fdf0581e5e75c29c275c15c79852a3 (diff)
sna/dri: Validate that the scanout flag is set
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_dri.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 9a7e2466..9310e982 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1085,8 +1085,10 @@ sna_dri_frame_event_info_free(struct sna *sna,
assert(info->scanout[1].bo == NULL);
- if (info->scanout[0].bo)
+ if (info->scanout[0].bo) {
+ assert(info->scanout[0].bo->scanout);
kgem_bo_destroy(&sna->kgem, info->scanout[0].bo);
+ }
if (info->cache.bo)
kgem_bo_destroy(&sna->kgem, info->cache.bo);
@@ -1108,6 +1110,7 @@ sna_dri_page_flip(struct sna *sna, struct sna_dri_frame_event *info)
assert(sna_pixmap_get_buffer(sna->front) == info->front);
assert(get_drawable_pixmap(info->draw)->drawable.height * bo->pitch <= kgem_bo_size(bo));
assert(info->scanout[0].bo);
+ assert(info->scanout[0].bo->scanout);
assert(info->scanout[1].bo == NULL);
assert(bo->refcnt);
@@ -1118,6 +1121,7 @@ sna_dri_page_flip(struct sna *sna, struct sna_dri_frame_event *info)
info->scanout[1] = info->scanout[0];
info->scanout[0].bo = ref(bo);
info->scanout[0].name = info->back->name;
+ assert(info->scanout[0].bo->scanout);
tmp.bo = get_private(info->front)->bo;
tmp.name = info->front->name;
@@ -1606,9 +1610,11 @@ sna_dri_flip_continue(struct sna *sna, struct sna_dri_frame_event *info)
if (!info->count)
return false;
+ assert(info->scanout[0].bo->scanout);
info->scanout[1] = info->scanout[0];
info->scanout[0].bo = ref(get_private(info->front)->bo);
info->scanout[0].name = info->front->name;
+ assert(info->scanout[0].bo->scanout);
sna->dri.flip_pending = info;
} else {
if (!info->draw)
@@ -1953,6 +1959,7 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw,
info->scanout[0].bo = ref(get_private(front)->bo);
info->scanout[0].name = info->front->name;
+ assert(info->scanout[0].bo->scanout);
sna_dri_add_frame_event(draw, info);
sna_dri_reference_buffer(front);
@@ -2004,6 +2011,7 @@ out:
info->scanout[0].bo = ref(get_private(front)->bo);
info->scanout[0].name = info->front->name;
+ assert(info->scanout[0].bo->scanout);
sna_dri_add_frame_event(draw, info);
sna_dri_reference_buffer(front);