summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-19 08:30:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-19 08:35:28 +0100
commit853beff4306d5a168e310af82d0ddf9db319fdce (patch)
treeb4023b14566cb27ab4696fe670aca078c0495241
parent8c1e60a15431b193b57d94a27b8e8de7c5a7e683 (diff)
sna/dri:Add some DBG and assertions to validate names passed back to clients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_dri.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index b1fba200..1f65b0fd 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -227,11 +227,15 @@ sna_dri_create_buffer(DrawablePtr draw,
pixmap = get_drawable_pixmap(draw);
buffer = sna_pixmap_get_buffer(pixmap);
if (buffer) {
- DBG(("%s: reusing front buffer attachment\n",
- __FUNCTION__));
-
private = get_private(buffer);
+
+ DBG(("%s: reusing front buffer attachment, pixmap=%ld, handle=%d, name=%d\n",
+ __FUNCTION__, pixmap->drawable.serialNumber,
+ private->bo->handle, buffer->name));
+
assert(private->pixmap == pixmap);
+ assert(sna_pixmap(pixmap)->gpu_bo == private->bo);
+ assert(kgem_bo_flink(&sna->kgem, private->bo) == buffer->name);
private->refcnt++;
return buffer;
@@ -429,6 +433,8 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
pixmap->drawable.width,
pixmap->drawable.height);
sna_damage_destroy(&priv->cpu_damage);
+ list_del(&priv->list);
+ priv->cpu = false;
priv->undamaged = false;
assert(bo->refcnt);
@@ -957,6 +963,8 @@ sna_dri_page_flip(struct sna *sna, struct sna_dri_frame_event *info)
DBG(("%s()\n", __FUNCTION__));
+ assert(sna_pixmap_get_buffer(sna->front) == info->front);
+
info->count = sna_page_flip(sna, bo, info, info->pipe);
if (info->count == 0)
return false;
@@ -1152,6 +1160,7 @@ sna_dri_exchange_buffers(DrawablePtr draw,
DBG(("%s: front_bo pitch=%d, size=%d\n",
__FUNCTION__, front_bo->pitch, kgem_bo_size(front_bo)));
+ assert(sna_pixmap_get_buffer(pixmap) == front);
assert(pixmap->drawable.height * back_bo->pitch <= kgem_bo_size(back_bo));
assert(pixmap->drawable.height * front_bo->pitch <= kgem_bo_size(front_bo));
@@ -1322,6 +1331,8 @@ sna_dri_flip_continue(struct sna *sna,
DBG(("%s()\n", __FUNCTION__));
+ assert(sna_pixmap_get_buffer(get_drawable_pixmap(draw)) == info->front);
+
name = info->back->name;
bo = get_private(info->back)->bo;
assert(get_drawable_pixmap(draw)->drawable.height * bo->pitch <= kgem_bo_size(bo));