Lines Matching full:ring

13 	struct msm_ringbuffer *ring;  in msm_ringbuffer_new()  local
20 ring = kzalloc(sizeof(*ring), GFP_KERNEL); in msm_ringbuffer_new()
21 if (!ring) { in msm_ringbuffer_new()
26 ring->gpu = gpu; in msm_ringbuffer_new()
27 ring->id = id; in msm_ringbuffer_new()
29 ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ, in msm_ringbuffer_new()
31 gpu->aspace, &ring->bo, &ring->iova); in msm_ringbuffer_new()
33 if (IS_ERR(ring->start)) { in msm_ringbuffer_new()
34 ret = PTR_ERR(ring->start); in msm_ringbuffer_new()
35 ring->start = 0; in msm_ringbuffer_new()
39 msm_gem_object_set_name(ring->bo, "ring%d", id); in msm_ringbuffer_new()
41 ring->end = ring->start + (MSM_GPU_RINGBUFFER_SZ >> 2); in msm_ringbuffer_new()
42 ring->next = ring->start; in msm_ringbuffer_new()
43 ring->cur = ring->start; in msm_ringbuffer_new()
45 ring->memptrs = memptrs; in msm_ringbuffer_new()
46 ring->memptrs_iova = memptrs_iova; in msm_ringbuffer_new()
48 INIT_LIST_HEAD(&ring->submits); in msm_ringbuffer_new()
49 spin_lock_init(&ring->lock); in msm_ringbuffer_new()
51 snprintf(name, sizeof(name), "gpu-ring-%d", ring->id); in msm_ringbuffer_new()
53 ring->fctx = msm_fence_context_alloc(gpu->dev, name); in msm_ringbuffer_new()
55 return ring; in msm_ringbuffer_new()
58 msm_ringbuffer_destroy(ring); in msm_ringbuffer_new()
62 void msm_ringbuffer_destroy(struct msm_ringbuffer *ring) in msm_ringbuffer_destroy() argument
64 if (IS_ERR_OR_NULL(ring)) in msm_ringbuffer_destroy()
67 msm_fence_context_free(ring->fctx); in msm_ringbuffer_destroy()
69 msm_gem_kernel_put(ring->bo, ring->gpu->aspace, false); in msm_ringbuffer_destroy()
71 kfree(ring); in msm_ringbuffer_destroy()