Lines Matching refs:ring

19 	submit->hw_fence = msm_fence_alloc(submit->ring->fctx);  in msm_job_run()
51 struct msm_ringbuffer *ring; in msm_ringbuffer_new() local
59 ring = kzalloc(sizeof(*ring), GFP_KERNEL); in msm_ringbuffer_new()
60 if (!ring) { in msm_ringbuffer_new()
65 ring->gpu = gpu; in msm_ringbuffer_new()
66 ring->id = id; in msm_ringbuffer_new()
68 ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ, in msm_ringbuffer_new()
70 gpu->aspace, &ring->bo, &ring->iova); in msm_ringbuffer_new()
72 if (IS_ERR(ring->start)) { in msm_ringbuffer_new()
73 ret = PTR_ERR(ring->start); in msm_ringbuffer_new()
74 ring->start = NULL; in msm_ringbuffer_new()
78 msm_gem_object_set_name(ring->bo, "ring%d", id); in msm_ringbuffer_new()
80 ring->end = ring->start + (MSM_GPU_RINGBUFFER_SZ >> 2); in msm_ringbuffer_new()
81 ring->next = ring->start; in msm_ringbuffer_new()
82 ring->cur = ring->start; in msm_ringbuffer_new()
84 ring->memptrs = memptrs; in msm_ringbuffer_new()
85 ring->memptrs_iova = memptrs_iova; in msm_ringbuffer_new()
90 ret = drm_sched_init(&ring->sched, &msm_sched_ops, in msm_ringbuffer_new()
92 NULL, NULL, to_msm_bo(ring->bo)->name); in msm_ringbuffer_new()
97 INIT_LIST_HEAD(&ring->submits); in msm_ringbuffer_new()
98 spin_lock_init(&ring->submit_lock); in msm_ringbuffer_new()
99 spin_lock_init(&ring->preempt_lock); in msm_ringbuffer_new()
101 snprintf(name, sizeof(name), "gpu-ring-%d", ring->id); in msm_ringbuffer_new()
103 ring->fctx = msm_fence_context_alloc(gpu->dev, &ring->memptrs->fence, name); in msm_ringbuffer_new()
105 return ring; in msm_ringbuffer_new()
108 msm_ringbuffer_destroy(ring); in msm_ringbuffer_new()
112 void msm_ringbuffer_destroy(struct msm_ringbuffer *ring) in msm_ringbuffer_destroy() argument
114 if (IS_ERR_OR_NULL(ring)) in msm_ringbuffer_destroy()
117 drm_sched_fini(&ring->sched); in msm_ringbuffer_destroy()
119 msm_fence_context_free(ring->fctx); in msm_ringbuffer_destroy()
121 msm_gem_kernel_put(ring->bo, ring->gpu->aspace); in msm_ringbuffer_destroy()
123 kfree(ring); in msm_ringbuffer_destroy()