Lines Matching refs:msm_ring
122 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in current_cmd() local
123 assert(!LIST_IS_EMPTY(&msm_ring->cmd_list)); in current_cmd()
124 return LIST_LAST_ENTRY(&msm_ring->cmd_list, struct msm_cmd, list); in current_cmd()
139 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in ring_cmd_new() local
175 msm_ring->offset = 0; in ring_cmd_new()
178 msm_ring->offset = suballoc_offset; in ring_cmd_new()
191 list_addtail(&cmd->list, &msm_ring->cmd_list); in ring_cmd_new()
192 msm_ring->cmd_count++; in ring_cmd_new()
203 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in append_bo() local
206 idx = APPEND(&msm_ring->submit, bos); in append_bo()
207 idx = APPEND(msm_ring, bos); in append_bo()
209 msm_ring->submit.bos[idx].flags = 0; in append_bo()
210 msm_ring->submit.bos[idx].handle = bo->handle; in append_bo()
211 msm_ring->submit.bos[idx].presumed = to_msm_bo(bo)->presumed; in append_bo()
213 msm_ring->bos[idx] = fd_bo_ref(bo); in append_bo()
221 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in bo2idx() local
225 if (msm_bo->current_ring_seqno == msm_ring->seqno) { in bo2idx()
230 if (!msm_ring->bo_table) in bo2idx()
231 msm_ring->bo_table = drmHashCreate(); in bo2idx()
233 if (!drmHashLookup(msm_ring->bo_table, bo->handle, &val)) { in bo2idx()
239 drmHashInsert(msm_ring->bo_table, bo->handle, val); in bo2idx()
241 msm_bo->current_ring_seqno = msm_ring->seqno; in bo2idx()
246 msm_ring->submit.bos[idx].flags |= MSM_SUBMIT_BO_READ; in bo2idx()
248 msm_ring->submit.bos[idx].flags |= MSM_SUBMIT_BO_WRITE; in bo2idx()
261 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in get_cmd() local
266 if (!msm_ring->cmd_table) in get_cmd()
267 msm_ring->cmd_table = drmHashCreate(); in get_cmd()
278 !drmHashLookup(msm_ring->cmd_table, (unsigned long)target_cmd, &val)) { in get_cmd()
280 cmd = &msm_ring->submit.cmds[i]; in get_cmd()
285 assert(msm_ring->submit.bos[cmd->submit_idx].handle == in get_cmd()
292 i = APPEND(&msm_ring->submit, cmds); in get_cmd()
293 APPEND(msm_ring, cmds); in get_cmd()
294 msm_ring->cmds[i] = target_cmd; in get_cmd()
295 cmd = &msm_ring->submit.cmds[i]; in get_cmd()
305 drmHashInsert(msm_ring->cmd_table, (unsigned long)target_cmd, in get_cmd()
321 static void delete_cmds(struct msm_ringbuffer *msm_ring) in delete_cmds() argument
325 LIST_FOR_EACH_ENTRY_SAFE(cmd, tmp, &msm_ring->cmd_list, list) { in delete_cmds()
332 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in flush_reset() local
335 for (i = 0; i < msm_ring->nr_bos; i++) { in flush_reset()
336 struct msm_bo *msm_bo = to_msm_bo(msm_ring->bos[i]); in flush_reset()
343 for (i = 0; i < msm_ring->nr_cmds; i++) { in flush_reset()
344 struct msm_cmd *msm_cmd = msm_ring->cmds[i]; in flush_reset()
353 msm_ring->submit.nr_cmds = 0; in flush_reset()
354 msm_ring->submit.nr_bos = 0; in flush_reset()
355 msm_ring->nr_cmds = 0; in flush_reset()
356 msm_ring->nr_bos = 0; in flush_reset()
358 if (msm_ring->bo_table) { in flush_reset()
359 drmHashDestroy(msm_ring->bo_table); in flush_reset()
360 msm_ring->bo_table = NULL; in flush_reset()
363 if (msm_ring->cmd_table) { in flush_reset()
364 drmHashDestroy(msm_ring->cmd_table); in flush_reset()
365 msm_ring->cmd_table = NULL; in flush_reset()
368 if (msm_ring->is_growable) { in flush_reset()
369 delete_cmds(msm_ring); in flush_reset()
395 static void dump_submit(struct msm_ringbuffer *msm_ring) in dump_submit() argument
399 for (i = 0; i < msm_ring->submit.nr_bos; i++) { in dump_submit()
400 struct drm_msm_gem_submit_bo *bo = &msm_ring->submit.bos[i]; in dump_submit()
403 for (i = 0; i < msm_ring->submit.nr_cmds; i++) { in dump_submit()
404 struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i]; in dump_submit()
421 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(stateobj); in handle_stateobj_relocs() local
427 struct fd_bo *bo = msm_ring->bos[idx]; in handle_stateobj_relocs()
430 if (msm_ring->submit.bos[idx].flags & MSM_SUBMIT_BO_READ) in handle_stateobj_relocs()
432 if (msm_ring->submit.bos[idx].flags & MSM_SUBMIT_BO_WRITE) in handle_stateobj_relocs()
443 for (i = 0; i < msm_ring->nr_cmds; i++) { in handle_stateobj_relocs()
444 struct msm_cmd *msm_cmd = msm_ring->cmds[i]; in handle_stateobj_relocs()
445 struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i]; in handle_stateobj_relocs()
447 if (msm_ring->cmds[i]->ring == stateobj) in handle_stateobj_relocs()
463 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in msm_ringbuffer_flush() local
486 for (i = 0; i < msm_ring->submit.nr_cmds; i++) { in msm_ringbuffer_flush()
487 struct msm_cmd *msm_cmd = msm_ring->cmds[i]; in msm_ringbuffer_flush()
503 cmd = &msm_ring->submit.cmds[i]; in msm_ringbuffer_flush()
509 req.bos = VOID2U64(msm_ring->submit.bos), in msm_ringbuffer_flush()
510 req.nr_bos = msm_ring->submit.nr_bos; in msm_ringbuffer_flush()
511 req.cmds = VOID2U64(msm_ring->submit.cmds), in msm_ringbuffer_flush()
512 req.nr_cmds = msm_ring->submit.nr_cmds; in msm_ringbuffer_flush()
520 dump_submit(msm_ring); in msm_ringbuffer_flush()
523 for (i = 0; i < msm_ring->submit.nr_cmds; i++) { in msm_ringbuffer_flush()
524 struct msm_cmd *msm_cmd = msm_ring->cmds[i]; in msm_ringbuffer_flush()
534 for (i = 0; i < msm_ring->submit.nr_cmds; i++) { in msm_ringbuffer_flush()
535 struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i]; in msm_ringbuffer_flush()
536 struct msm_cmd *msm_cmd = msm_ring->cmds[i]; in msm_ringbuffer_flush()
669 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); in msm_ringbuffer_destroy() local
672 delete_cmds(msm_ring); in msm_ringbuffer_destroy()
674 free(msm_ring->submit.cmds); in msm_ringbuffer_destroy()
675 free(msm_ring->submit.bos); in msm_ringbuffer_destroy()
676 free(msm_ring->bos); in msm_ringbuffer_destroy()
677 free(msm_ring->cmds); in msm_ringbuffer_destroy()
678 free(msm_ring); in msm_ringbuffer_destroy()
695 struct msm_ringbuffer *msm_ring; in msm_ringbuffer_new() local
698 msm_ring = calloc(1, sizeof(*msm_ring)); in msm_ringbuffer_new()
699 if (!msm_ring) { in msm_ringbuffer_new()
707 msm_ring->is_growable = TRUE; in msm_ringbuffer_new()
710 list_inithead(&msm_ring->cmd_list); in msm_ringbuffer_new()
711 msm_ring->seqno = ++to_msm_device(pipe->dev)->ring_cnt; in msm_ringbuffer_new()
713 ring = &msm_ring->base; in msm_ringbuffer_new()