Lines Matching refs:krec
56 struct nouveau_pushbuf_krec *krec; member
83 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_kref_fits() local
94 if (krec->vram_used + bo->size > dev->vram_limit) in pushbuf_kref_fits()
96 krec->vram_used += bo->size; in pushbuf_kref_fits()
104 if (krec->gart_used + bo->size <= dev->gart_limit) { in pushbuf_kref_fits()
105 krec->gart_used += bo->size; in pushbuf_kref_fits()
113 krec->vram_used + bo->size <= dev->vram_limit) { in pushbuf_kref_fits()
115 krec->vram_used += bo->size; in pushbuf_kref_fits()
123 kref = krec->buffer; in pushbuf_kref_fits()
124 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_kref_fits()
130 krec->vram_used + kbo->size > dev->vram_limit) in pushbuf_kref_fits()
134 krec->gart_used -= kbo->size; in pushbuf_kref_fits()
135 krec->vram_used += kbo->size; in pushbuf_kref_fits()
136 if (krec->gart_used + bo->size <= dev->gart_limit) { in pushbuf_kref_fits()
137 krec->gart_used += bo->size; in pushbuf_kref_fits()
152 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_kref() local
184 if (krec->vram_used + bo->size > dev->vram_limit) in pushbuf_kref()
186 krec->vram_used += bo->size; in pushbuf_kref()
187 krec->gart_used -= bo->size; in pushbuf_kref()
194 if (krec->nr_buffer == NOUVEAU_GEM_MAX_BUFFERS || in pushbuf_kref()
198 kref = &krec->buffer[krec->nr_buffer++]; in pushbuf_kref()
223 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_krel() local
231 krel = &krec->reloc[krec->nr_reloc++]; in pushbuf_krel()
235 krel->reloc_bo_index = pkref - krec->buffer; in pushbuf_krel()
237 krel->bo_index = bkref - krec->buffer; in pushbuf_krel()
263 pushbuf_dump(struct nouveau_pushbuf_krec *krec, int krec_id, int chid) in pushbuf_dump() argument
273 krec_id, krec->nr_push, krec->nr_buffer, krec->nr_reloc); in pushbuf_dump()
275 kref = krec->buffer; in pushbuf_dump()
276 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_dump()
282 krel = krec->reloc; in pushbuf_dump()
283 for (i = 0; i < krec->nr_reloc; i++, krel++) { in pushbuf_dump()
290 kpsh = krec->push; in pushbuf_dump()
291 for (i = 0; i < krec->nr_push; i++, kpsh++) { in pushbuf_dump()
292 kref = krec->buffer + kpsh->bo_index; in pushbuf_dump()
309 struct nouveau_pushbuf_krec *krec = nvpb->list; in pushbuf_submit() local
328 while (krec && krec->nr_push) { in pushbuf_submit()
330 req.nr_buffers = krec->nr_buffer; in pushbuf_submit()
331 req.buffers = (uint64_t)(unsigned long)krec->buffer; in pushbuf_submit()
332 req.nr_relocs = krec->nr_reloc; in pushbuf_submit()
333 req.nr_push = krec->nr_push; in pushbuf_submit()
334 req.relocs = (uint64_t)(unsigned long)krec->reloc; in pushbuf_submit()
335 req.push = (uint64_t)(unsigned long)krec->push; in pushbuf_submit()
342 pushbuf_dump(krec, krec_id++, fifo->channel); in pushbuf_submit()
360 pushbuf_dump(krec, krec_id++, fifo->channel); in pushbuf_submit()
364 kref = krec->buffer; in pushbuf_submit()
365 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_submit()
384 krec = krec->next; in pushbuf_submit()
394 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_flush() local
404 krec->next = malloc(sizeof(*krec)); in pushbuf_flush()
405 nvpb->krec = krec->next; in pushbuf_flush()
408 kref = krec->buffer; in pushbuf_flush()
409 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_flush()
416 krec = nvpb->krec; in pushbuf_flush()
417 krec->vram_used = 0; in pushbuf_flush()
418 krec->gart_used = 0; in pushbuf_flush()
419 krec->nr_buffer = 0; in pushbuf_flush()
420 krec->nr_reloc = 0; in pushbuf_flush()
421 krec->nr_push = 0; in pushbuf_flush()
436 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_refn_fail() local
439 kref = krec->buffer + sref; in pushbuf_refn_fail()
440 while (krec->nr_buffer-- > sref) { in pushbuf_refn_fail()
446 krec->nr_buffer = sref; in pushbuf_refn_fail()
447 krec->nr_reloc = srel; in pushbuf_refn_fail()
455 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_refn() local
457 int sref = krec->nr_buffer; in pushbuf_refn()
469 pushbuf_refn_fail(push, sref, krec->nr_reloc); in pushbuf_refn()
484 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_validate() local
495 sref = krec->nr_buffer; in pushbuf_validate()
496 srel = krec->nr_reloc; in pushbuf_validate()
567 nvpb->krec = calloc(1, sizeof(*nvpb->krec)); in nouveau_pushbuf_new()
568 nvpb->list = nvpb->krec; in nouveau_pushbuf_new()
569 if (!nvpb->krec) { in nouveau_pushbuf_new()
608 struct nouveau_pushbuf_krec *krec; in nouveau_pushbuf_del() local
609 while ((krec = nvpb->list)) { in nouveau_pushbuf_del()
610 kref = krec->buffer; in nouveau_pushbuf_del()
611 while (krec->nr_buffer--) { in nouveau_pushbuf_del()
617 nvpb->list = krec->next; in nouveau_pushbuf_del()
618 free(krec); in nouveau_pushbuf_del()
641 struct nouveau_pushbuf_krec *krec = nvpb->krec; in nouveau_pushbuf_space() local
672 krec->nr_reloc + relocs >= NOUVEAU_GEM_MAX_RELOCS || in nouveau_pushbuf_space()
673 krec->nr_push + pushes >= NOUVEAU_GEM_MAX_PUSH) { in nouveau_pushbuf_space()
674 if (nvpb->bo && krec->nr_buffer) in nouveau_pushbuf_space()
705 struct nouveau_pushbuf_krec *krec = nvpb->krec; in nouveau_pushbuf_data() local
724 kpsh = &krec->push[krec->nr_push++]; in nouveau_pushbuf_data()
725 kpsh->bo_index = kref - krec->buffer; in nouveau_pushbuf_data()