diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 7495fb94..0dff41cd 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -4625,8 +4625,9 @@ void kgem_buffer_read_sync(struct kgem *kgem, struct kgem_bo *_bo) struct kgem_buffer *bo; uint32_t offset = _bo->delta, length = _bo->size.bytes; + /* We expect the caller to have already submitted the batch */ assert(_bo->io); - assert(_bo->exec == &_kgem_dummy_exec); + assert(_bo->exec == NULL); assert(_bo->rq == NULL); assert(_bo->proxy); diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 4fbdd708..4639fc49 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2022,6 +2022,7 @@ out: if (flags & MOVE_WRITE) { priv->source_count = SOURCE_BIAS; assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL); + assert(!priv->flush || !list_is_empty(&priv->list)); } if ((flags & MOVE_ASYNC_HINT) == 0 && priv->cpu_bo) { DBG(("%s: syncing cpu bo\n", __FUNCTION__)); @@ -3432,6 +3433,7 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region, sna_add_flush_pixmap(sna, priv, priv->gpu_bo); } } + assert(!priv->flush || !list_is_empty(&priv->list)); priv->cpu = true; blt: diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 435d22ef..3e8f5f97 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -170,6 +170,7 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna, return NULL; } + assert(priv->cpu_damage == NULL); if (priv->flush++) return priv->gpu_bo; @@ -189,13 +190,6 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna, /* Don't allow this named buffer to be replaced */ priv->pinned = 1; - if (priv->gpu_bo->exec || priv->cpu_damage) { - DBG(("%s: marking pixmap=%ld for flushing\n", - __FUNCTION__, pixmap->drawable.serialNumber)); - list_move(&priv->list, &sna->flush_pixmaps); - sna->kgem.flush = true; - } - return priv->gpu_bo; } @@ -340,6 +334,8 @@ sna_dri_create_buffer(DrawablePtr draw, pixmap->refcnt++; } + assert(bo->flush == true); + return buffer; err: