Lines Matching refs:msm_ring
127 struct msm_ringbuffer *msm_ring,
185 struct msm_ringbuffer *msm_ring, uint32_t size) in msm_submit_suballoc_ring_bo() argument
208 msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, 0x8000); in msm_submit_suballoc_ring_bo()
209 msm_ring->offset = 0; in msm_submit_suballoc_ring_bo()
211 msm_ring->ring_bo = fd_bo_ref(suballoc_bo); in msm_submit_suballoc_ring_bo()
212 msm_ring->offset = suballoc_offset; in msm_submit_suballoc_ring_bo()
217 msm_submit->suballoc_ring = fd_ringbuffer_ref(&msm_ring->base); in msm_submit_suballoc_ring_bo()
228 struct msm_ringbuffer *msm_ring; in msm_submit_new_ringbuffer() local
230 msm_ring = slab_alloc_st(&msm_submit->ring_pool); in msm_submit_new_ringbuffer()
232 msm_ring->u.submit = submit; in msm_submit_new_ringbuffer()
237 msm_ring->base.refcnt = 1; in msm_submit_new_ringbuffer()
240 msm_submit_suballoc_ring_bo(submit, msm_ring, size); in msm_submit_new_ringbuffer()
245 msm_ring->offset = 0; in msm_submit_new_ringbuffer()
246 msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, size); in msm_submit_new_ringbuffer()
249 if (!msm_ringbuffer_init(msm_ring, size, flags)) in msm_submit_new_ringbuffer()
254 msm_submit->primary = fd_ringbuffer_ref(&msm_ring->base); in msm_submit_new_ringbuffer()
257 return &msm_ring->base; in msm_submit_new_ringbuffer()
317 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in msm_submit_flush() local
326 void *relocs = handle_stateobj_relocs(msm_submit, msm_ring); in msm_submit_flush()
331 append_bo(msm_submit, msm_ring->ring_bo); in msm_submit_flush()
332 cmds[i].submit_offset = msm_ring->offset; in msm_submit_flush()
335 cmds[i].nr_relocs = msm_ring->cmd->nr_relocs; in msm_submit_flush()
340 for (unsigned j = 0; j < msm_ring->u.nr_cmds; j++) { in msm_submit_flush()
347 msm_ring->u.cmds[j]->ring_bo); in msm_submit_flush()
348 cmds[i].submit_offset = msm_ring->offset; in msm_submit_flush()
349 cmds[i].size = msm_ring->u.cmds[j]->size; in msm_submit_flush()
351 cmds[i].nr_relocs = msm_ring->u.cmds[j]->nr_relocs; in msm_submit_flush()
352 cmds[i].relocs = VOID2U64(msm_ring->u.cmds[j]->relocs); in msm_submit_flush()
458 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in finalize_current_cmd() local
462 if (!msm_ring->cmd) in finalize_current_cmd()
465 debug_assert(msm_ring->cmd->ring_bo == msm_ring->ring_bo); in finalize_current_cmd()
467 unsigned idx = APPEND(&msm_ring->u, cmds); in finalize_current_cmd()
469 msm_ring->u.cmds[idx] = msm_ring->cmd; in finalize_current_cmd()
470 msm_ring->cmd = NULL; in finalize_current_cmd()
472 msm_ring->u.cmds[idx]->size = offset_bytes(ring->cur, ring->start); in finalize_current_cmd()
478 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in msm_ringbuffer_grow() local
479 struct fd_pipe *pipe = msm_ring->u.submit->pipe; in msm_ringbuffer_grow()
485 fd_bo_del(msm_ring->ring_bo); in msm_ringbuffer_grow()
486 msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size); in msm_ringbuffer_grow()
487 msm_ring->cmd = cmd_new(msm_ring->ring_bo); in msm_ringbuffer_grow()
489 ring->start = fd_bo_map(msm_ring->ring_bo); in msm_ringbuffer_grow()
499 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in msm_ringbuffer_emit_reloc() local
504 unsigned idx = APPEND(&msm_ring->u, reloc_bos); in msm_ringbuffer_emit_reloc()
506 msm_ring->u.reloc_bos[idx] = fd_bo_ref(reloc->bo); in msm_ringbuffer_emit_reloc()
513 pipe = msm_ring->u.pipe; in msm_ringbuffer_emit_reloc()
516 to_msm_submit(msm_ring->u.submit); in msm_ringbuffer_emit_reloc()
520 pipe = msm_ring->u.submit->pipe; in msm_ringbuffer_emit_reloc()
524 unsigned idx = APPEND(msm_ring->cmd, relocs); in msm_ringbuffer_emit_reloc()
526 r = &msm_ring->cmd->relocs[idx]; in msm_ringbuffer_emit_reloc()
533 msm_ring->offset; in msm_ringbuffer_emit_reloc()
538 idx = APPEND(msm_ring->cmd, relocs); in msm_ringbuffer_emit_reloc()
539 r = &msm_ring->cmd->relocs[idx]; in msm_ringbuffer_emit_reloc()
546 msm_ring->offset; in msm_ringbuffer_emit_reloc()
575 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in msm_ringbuffer_emit_reloc_ring() local
598 struct msm_submit *msm_submit = to_msm_submit(msm_ring->u.submit); in msm_ringbuffer_emit_reloc_ring()
604 append_ring(msm_ring->u.ring_set, target); in msm_ringbuffer_emit_reloc_ring()
606 struct msm_submit *msm_submit = to_msm_submit(msm_ring->u.submit); in msm_ringbuffer_emit_reloc_ring()
624 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in msm_ringbuffer_destroy() local
626 fd_bo_del(msm_ring->ring_bo); in msm_ringbuffer_destroy()
627 if (msm_ring->cmd) in msm_ringbuffer_destroy()
628 cmd_free(msm_ring->cmd); in msm_ringbuffer_destroy()
631 for (unsigned i = 0; i < msm_ring->u.nr_reloc_bos; i++) { in msm_ringbuffer_destroy()
632 fd_bo_del(msm_ring->u.reloc_bos[i]); in msm_ringbuffer_destroy()
635 _mesa_set_destroy(msm_ring->u.ring_set, unref_rings); in msm_ringbuffer_destroy()
637 free(msm_ring->u.reloc_bos); in msm_ringbuffer_destroy()
638 free(msm_ring); in msm_ringbuffer_destroy()
640 struct fd_submit *submit = msm_ring->u.submit; in msm_ringbuffer_destroy()
642 for (unsigned i = 0; i < msm_ring->u.nr_cmds; i++) { in msm_ringbuffer_destroy()
643 cmd_free(msm_ring->u.cmds[i]); in msm_ringbuffer_destroy()
646 free(msm_ring->u.cmds); in msm_ringbuffer_destroy()
647 slab_free_st(&to_msm_submit(submit)->ring_pool, msm_ring); in msm_ringbuffer_destroy()
660 msm_ringbuffer_init(struct msm_ringbuffer *msm_ring, uint32_t size, in msm_ringbuffer_init() argument
663 struct fd_ringbuffer *ring = &msm_ring->base; in msm_ringbuffer_init()
665 debug_assert(msm_ring->ring_bo); in msm_ringbuffer_init()
667 uint8_t *base = fd_bo_map(msm_ring->ring_bo); in msm_ringbuffer_init()
668 ring->start = (void *)(base + msm_ring->offset); in msm_ringbuffer_init()
677 msm_ring->u.cmds = NULL; in msm_ringbuffer_init()
678 msm_ring->u.nr_cmds = msm_ring->u.max_cmds = 0; in msm_ringbuffer_init()
680 msm_ring->cmd = cmd_new(msm_ring->ring_bo); in msm_ringbuffer_init()
688 struct msm_ringbuffer *msm_ring = malloc(sizeof(*msm_ring)); in msm_ringbuffer_new_object() local
690 msm_ring->u.pipe = pipe; in msm_ringbuffer_new_object()
691 msm_ring->offset = 0; in msm_ringbuffer_new_object()
692 msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size); in msm_ringbuffer_new_object()
693 msm_ring->base.refcnt = 1; in msm_ringbuffer_new_object()
695 msm_ring->u.reloc_bos = NULL; in msm_ringbuffer_new_object()
696 msm_ring->u.nr_reloc_bos = msm_ring->u.max_reloc_bos = 0; in msm_ringbuffer_new_object()
698 msm_ring->u.ring_set = _mesa_set_create(NULL, in msm_ringbuffer_new_object()
701 return msm_ringbuffer_init(msm_ring, size, _FD_RINGBUFFER_OBJECT); in msm_ringbuffer_new_object()