bkref = cli_kref_get(push->client, bo);
krel = &krec->reloc[krec->nr_reloc++];
+ assert(pkref);
+ assert(bkref);
krel->reloc_bo_index = pkref - krec->buffer;
krel->reloc_bo_offset = (push->cur - nvpb->ptr) * 4;
krel->bo_index = bkref - krec->buffer;
&req, sizeof(req));
nvpb->suffix0 = req.suffix0;
nvpb->suffix1 = req.suffix1;
- dev->vram_limit = (req.vram_available * 80) / 100;
- dev->gart_limit = (req.gart_available * 80) / 100;
+ dev->vram_limit = (req.vram_available *
+ nouveau_device(dev)->vram_limit_percent) / 100;
+ dev->gart_limit = (req.gart_available *
+ nouveau_device(dev)->gart_limit_percent) / 100;
#else
if (dbg_on(31))
ret = -EINVAL;
}
}
- return 0;
+ return ret;
}
int
push->client = client;
push->channel = immediate ? chan : NULL;
push->flags = NOUVEAU_BO_RD;
- if (fifo->pushbuf & NOUVEAU_GEM_DOMAIN_VRAM) {
- push->flags |= NOUVEAU_BO_VRAM;
- nvpb->type = NOUVEAU_BO_VRAM;
- }
if (fifo->pushbuf & NOUVEAU_GEM_DOMAIN_GART) {
push->flags |= NOUVEAU_BO_GART;
nvpb->type = NOUVEAU_BO_GART;
+ } else
+ if (fifo->pushbuf & NOUVEAU_GEM_DOMAIN_VRAM) {
+ push->flags |= NOUVEAU_BO_VRAM;
+ nvpb->type = NOUVEAU_BO_VRAM;
}
nvpb->type |= NOUVEAU_BO_MAP;
if (bo) {
kref = cli_kref_get(push->client, bo);
+ assert(kref);
kpsh = &krec->push[krec->nr_push++];
kpsh->bo_index = kref - krec->buffer;
kpsh->offset = offset;
nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo,
uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor)
{
- *push->cur++ = pushbuf_krel(push, bo, data, flags, vor, tor);
+ *push->cur = pushbuf_krel(push, bo, data, flags, vor, tor);
+ push->cur++;
}
int
if (cli_push_get(push->client, bo) == push) {
kref = cli_kref_get(push->client, bo);
+ assert(kref);
if (kref->read_domains)
flags |= NOUVEAU_BO_RD;
if (kref->write_domains)