Lines Matching refs:krec
57 struct nouveau_pushbuf_krec *krec; member
84 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_kref_fits() local
95 if (krec->vram_used + bo->size > dev->vram_limit) in pushbuf_kref_fits()
97 krec->vram_used += bo->size; in pushbuf_kref_fits()
105 if (krec->gart_used + bo->size <= dev->gart_limit) { in pushbuf_kref_fits()
106 krec->gart_used += bo->size; in pushbuf_kref_fits()
114 krec->vram_used + bo->size <= dev->vram_limit) { in pushbuf_kref_fits()
116 krec->vram_used += bo->size; in pushbuf_kref_fits()
124 kref = krec->buffer; in pushbuf_kref_fits()
125 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_kref_fits()
131 krec->vram_used + kbo->size > dev->vram_limit) in pushbuf_kref_fits()
135 krec->gart_used -= kbo->size; in pushbuf_kref_fits()
136 krec->vram_used += kbo->size; in pushbuf_kref_fits()
137 if (krec->gart_used + bo->size <= dev->gart_limit) { in pushbuf_kref_fits()
138 krec->gart_used += bo->size; in pushbuf_kref_fits()
153 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_kref() local
185 if (krec->vram_used + bo->size > dev->vram_limit) in pushbuf_kref()
187 krec->vram_used += bo->size; in pushbuf_kref()
188 krec->gart_used -= bo->size; in pushbuf_kref()
195 if (krec->nr_buffer == NOUVEAU_GEM_MAX_BUFFERS || in pushbuf_kref()
199 kref = &krec->buffer[krec->nr_buffer++]; in pushbuf_kref()
224 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_krel() local
232 krel = &krec->reloc[krec->nr_reloc++]; in pushbuf_krel()
236 krel->reloc_bo_index = pkref - krec->buffer; in pushbuf_krel()
238 krel->bo_index = bkref - krec->buffer; in pushbuf_krel()
264 pushbuf_dump(struct nouveau_pushbuf_krec *krec, int krec_id, int chid) in pushbuf_dump() argument
274 krec_id, krec->nr_push, krec->nr_buffer, krec->nr_reloc); in pushbuf_dump()
276 kref = krec->buffer; in pushbuf_dump()
277 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_dump()
284 krel = krec->reloc; in pushbuf_dump()
285 for (i = 0; i < krec->nr_reloc; i++, krel++) { in pushbuf_dump()
292 kpsh = krec->push; in pushbuf_dump()
293 for (i = 0; i < krec->nr_push; i++, kpsh++) { in pushbuf_dump()
294 kref = krec->buffer + kpsh->bo_index; in pushbuf_dump()
314 struct nouveau_pushbuf_krec *krec = nvpb->list; in pushbuf_submit() local
333 while (krec && krec->nr_push) { in pushbuf_submit()
335 req.nr_buffers = krec->nr_buffer; in pushbuf_submit()
336 req.buffers = (uint64_t)(unsigned long)krec->buffer; in pushbuf_submit()
337 req.nr_relocs = krec->nr_reloc; in pushbuf_submit()
338 req.nr_push = krec->nr_push; in pushbuf_submit()
339 req.relocs = (uint64_t)(unsigned long)krec->reloc; in pushbuf_submit()
340 req.push = (uint64_t)(unsigned long)krec->push; in pushbuf_submit()
349 pushbuf_dump(krec, krec_id++, fifo->channel); in pushbuf_submit()
367 pushbuf_dump(krec, krec_id++, fifo->channel); in pushbuf_submit()
371 kref = krec->buffer; in pushbuf_submit()
372 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_submit()
391 krec = krec->next; in pushbuf_submit()
401 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_flush() local
411 krec->next = malloc(sizeof(*krec)); in pushbuf_flush()
412 nvpb->krec = krec->next; in pushbuf_flush()
415 kref = krec->buffer; in pushbuf_flush()
416 for (i = 0; i < krec->nr_buffer; i++, kref++) { in pushbuf_flush()
423 krec = nvpb->krec; in pushbuf_flush()
424 krec->vram_used = 0; in pushbuf_flush()
425 krec->gart_used = 0; in pushbuf_flush()
426 krec->nr_buffer = 0; in pushbuf_flush()
427 krec->nr_reloc = 0; in pushbuf_flush()
428 krec->nr_push = 0; in pushbuf_flush()
443 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_refn_fail() local
446 kref = krec->buffer + sref; in pushbuf_refn_fail()
447 while (krec->nr_buffer-- > sref) { in pushbuf_refn_fail()
453 krec->nr_buffer = sref; in pushbuf_refn_fail()
454 krec->nr_reloc = srel; in pushbuf_refn_fail()
462 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_refn() local
464 int sref = krec->nr_buffer; in pushbuf_refn()
476 pushbuf_refn_fail(push, sref, krec->nr_reloc); in pushbuf_refn()
491 struct nouveau_pushbuf_krec *krec = nvpb->krec; in pushbuf_validate() local
502 sref = krec->nr_buffer; in pushbuf_validate()
503 srel = krec->nr_reloc; in pushbuf_validate()
574 nvpb->krec = calloc(1, sizeof(*nvpb->krec)); in nouveau_pushbuf_new()
575 nvpb->list = nvpb->krec; in nouveau_pushbuf_new()
576 if (!nvpb->krec) { in nouveau_pushbuf_new()
615 struct nouveau_pushbuf_krec *krec; in nouveau_pushbuf_del() local
616 while ((krec = nvpb->list)) { in nouveau_pushbuf_del()
617 kref = krec->buffer; in nouveau_pushbuf_del()
618 while (krec->nr_buffer--) { in nouveau_pushbuf_del()
624 nvpb->list = krec->next; in nouveau_pushbuf_del()
625 free(krec); in nouveau_pushbuf_del()
648 struct nouveau_pushbuf_krec *krec = nvpb->krec; in nouveau_pushbuf_space() local
679 krec->nr_reloc + relocs >= NOUVEAU_GEM_MAX_RELOCS || in nouveau_pushbuf_space()
680 krec->nr_push + pushes >= NOUVEAU_GEM_MAX_PUSH) { in nouveau_pushbuf_space()
681 if (nvpb->bo && krec->nr_buffer) in nouveau_pushbuf_space()
712 struct nouveau_pushbuf_krec *krec = nvpb->krec; in nouveau_pushbuf_data() local
731 kpsh = &krec->push[krec->nr_push++]; in nouveau_pushbuf_data()
732 kpsh->bo_index = kref - krec->buffer; in nouveau_pushbuf_data()