sna: Add a few more asserts around handling of buffers

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-10-02 15:01:53 +01:00
parent c724098f22
commit 660e9e14bd
1 changed files with 3 additions and 1 deletions

View File

@ -2407,7 +2407,7 @@ static void kgem_finish_buffers(struct kgem *kgem)
}
if (bo->mmapped) {
int used;
uint32_t used;
assert(!bo->need_io);
@ -2417,6 +2417,7 @@ static void kgem_finish_buffers(struct kgem *kgem)
(kgem->has_llc || bo->mmapped == MMAPPED_GTT || bo->base.snoop)) {
DBG(("%s: retaining upload buffer (%d/%d)\n",
__FUNCTION__, bo->used, bytes(&bo->base)));
assert(used >= bo->used);
bo->used = used;
list_move(&bo->base.list,
&kgem->active_buffers);
@ -5985,6 +5986,7 @@ init:
done:
bo->used = ALIGN(bo->used, UPLOAD_ALIGNMENT);
assert(bo->used && bo->used <= bytes(&bo->base));
assert(bo->mem);
*ret = (char *)bo->mem + offset;
return kgem_create_proxy(kgem, &bo->base, offset, size);