Lines Matching full:ring

17 	struct msm_fence_context *fctx = submit->ring->fctx;  in msm_job_run()
33 /* TODO move submit path over to using a per-ring lock.. */ in msm_job_run()
59 struct msm_ringbuffer *ring; in msm_ringbuffer_new() local
67 ring = kzalloc(sizeof(*ring), GFP_KERNEL); in msm_ringbuffer_new()
68 if (!ring) { in msm_ringbuffer_new()
73 ring->gpu = gpu; in msm_ringbuffer_new()
74 ring->id = id; in msm_ringbuffer_new()
76 ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ, in msm_ringbuffer_new()
78 gpu->aspace, &ring->bo, &ring->iova); in msm_ringbuffer_new()
80 if (IS_ERR(ring->start)) { in msm_ringbuffer_new()
81 ret = PTR_ERR(ring->start); in msm_ringbuffer_new()
82 ring->start = NULL; in msm_ringbuffer_new()
86 msm_gem_object_set_name(ring->bo, "ring%d", id); in msm_ringbuffer_new()
88 ring->end = ring->start + (MSM_GPU_RINGBUFFER_SZ >> 2); in msm_ringbuffer_new()
89 ring->next = ring->start; in msm_ringbuffer_new()
90 ring->cur = ring->start; in msm_ringbuffer_new()
92 ring->memptrs = memptrs; in msm_ringbuffer_new()
93 ring->memptrs_iova = memptrs_iova; in msm_ringbuffer_new()
98 ret = drm_sched_init(&ring->sched, &msm_sched_ops, in msm_ringbuffer_new()
100 NULL, NULL, to_msm_bo(ring->bo)->name, gpu->dev->dev); in msm_ringbuffer_new()
105 INIT_LIST_HEAD(&ring->submits); in msm_ringbuffer_new()
106 spin_lock_init(&ring->submit_lock); in msm_ringbuffer_new()
107 spin_lock_init(&ring->preempt_lock); in msm_ringbuffer_new()
109 snprintf(name, sizeof(name), "gpu-ring-%d", ring->id); in msm_ringbuffer_new()
111 ring->fctx = msm_fence_context_alloc(gpu->dev, &ring->memptrs->fence, name); in msm_ringbuffer_new()
113 return ring; in msm_ringbuffer_new()
116 msm_ringbuffer_destroy(ring); in msm_ringbuffer_new()
120 void msm_ringbuffer_destroy(struct msm_ringbuffer *ring) in msm_ringbuffer_destroy() argument
122 if (IS_ERR_OR_NULL(ring)) in msm_ringbuffer_destroy()
125 drm_sched_fini(&ring->sched); in msm_ringbuffer_destroy()
127 msm_fence_context_free(ring->fctx); in msm_ringbuffer_destroy()
129 msm_gem_kernel_put(ring->bo, ring->gpu->aspace); in msm_ringbuffer_destroy()
131 kfree(ring); in msm_ringbuffer_destroy()