if (bo->offset == nouveau_bo(bo)->offset &&
bo->flags == nouveau_bo(bo)->flags) {
+
while ((r = ptr_to_pbrel(pbbo->relocs))) {
pbbo->relocs = r->next;
free(r);
}
+ nouveau_bo_del(&bo);
nvpb->buffers = pbbo->next;
free(pbbo);
continue;
free(r);
}
+ nouveau_bo_del(&bo);
nvpb->buffers = pbbo->next;
free(pbbo);
}
{
struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(chan->pushbuf);
struct nouveau_pushbuf_bo *pbbo = ptr_to_pbbo(nvpb->buffers);
+ struct nouveau_bo *ref = NULL;
while (pbbo) {
if (pbbo->handle == bo->handle)
nvpb->buffers = pbbo_to_ptr(pbbo);
nvpb->nr_buffers++;
- pbbo->handle = bo_to_ptr(bo);
+ nouveau_bo_ref(bo->device, bo->handle, &ref);
+ pbbo->handle = bo_to_ptr(ref);
pbbo->flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART;
pbbo->relocs = 0;
pbbo->nr_relocs = 0;
pbbo->flags |= (flags & NOUVEAU_BO_RDWR);
pbbo->flags &= (flags | NOUVEAU_BO_RDWR);
- r->handle = bo_to_ptr(r);
r->ptr = ptr;
r->flags = flags;
r->data = data;