sna: A few more buffer cache management assertions

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-08-20 17:35:44 +01:00
parent ae6b3c7508
commit fb349ced91
1 changed files with 5 additions and 0 deletions

View File

@ -1333,6 +1333,9 @@ static void _kgem_bo_delete_buffer(struct kgem *kgem, struct kgem_bo *bo)
static void kgem_bo_move_to_snoop(struct kgem *kgem, struct kgem_bo *bo)
{
assert(bo->refcnt == 0);
assert(bo->exec == NULL);
if (num_pages(bo) > kgem->max_cpu_size >> 13) {
DBG(("%s handle=%d discarding large CPU buffer (%d >%d pages)\n",
__FUNCTION__, bo->handle, num_pages(bo), kgem->max_cpu_size >> 13));
@ -1953,7 +1956,9 @@ static void kgem_cleanup(struct kgem *kgem)
list_del(&bo->request);
bo->rq = NULL;
bo->exec = NULL;
bo->domain = DOMAIN_NONE;
bo->dirty = false;
if (bo->refcnt == 0)
kgem_bo_free(kgem, bo);
}