Lines Matching refs:ring
39 struct fd_ringbuffer *ring; in fd_ringbuffer_new_flags() local
48 ring = pipe->funcs->ringbuffer_new(pipe, size, flags); in fd_ringbuffer_new_flags()
49 if (!ring) in fd_ringbuffer_new_flags()
52 ring->flags = flags; in fd_ringbuffer_new_flags()
53 ring->pipe = pipe; in fd_ringbuffer_new_flags()
54 ring->start = ring->funcs->hostptr(ring); in fd_ringbuffer_new_flags()
55 ring->end = &(ring->start[ring->size/4]); in fd_ringbuffer_new_flags()
57 ring->cur = ring->last_start = ring->start; in fd_ringbuffer_new_flags()
59 return ring; in fd_ringbuffer_new_flags()
74 drm_public void fd_ringbuffer_del(struct fd_ringbuffer *ring) in fd_ringbuffer_del() argument
76 if (!atomic_dec_and_test(&ring->refcnt)) in fd_ringbuffer_del()
79 fd_ringbuffer_reset(ring); in fd_ringbuffer_del()
80 ring->funcs->destroy(ring); in fd_ringbuffer_del()
84 fd_ringbuffer_ref(struct fd_ringbuffer *ring) in fd_ringbuffer_ref() argument
86 STATIC_ASSERT(sizeof(ring->refcnt) <= sizeof(ring->__pad)); in fd_ringbuffer_ref()
87 atomic_inc(&ring->refcnt); in fd_ringbuffer_ref()
88 return ring; in fd_ringbuffer_ref()
95 drm_public void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, in fd_ringbuffer_set_parent() argument
99 assert(!(ring->flags & FD_RINGBUFFER_OBJECT)); in fd_ringbuffer_set_parent()
100 ring->parent = parent; in fd_ringbuffer_set_parent()
103 drm_public void fd_ringbuffer_reset(struct fd_ringbuffer *ring) in fd_ringbuffer_reset() argument
105 uint32_t *start = ring->start; in fd_ringbuffer_reset()
106 if (ring->pipe->id == FD_PIPE_2D) in fd_ringbuffer_reset()
107 start = &ring->start[0x140]; in fd_ringbuffer_reset()
108 ring->cur = ring->last_start = start; in fd_ringbuffer_reset()
109 if (ring->funcs->reset) in fd_ringbuffer_reset()
110 ring->funcs->reset(ring); in fd_ringbuffer_reset()
113 drm_public int fd_ringbuffer_flush(struct fd_ringbuffer *ring) in fd_ringbuffer_flush() argument
115 return ring->funcs->flush(ring, ring->last_start, -1, NULL); in fd_ringbuffer_flush()
118 drm_public int fd_ringbuffer_flush2(struct fd_ringbuffer *ring, int in_fence_fd, in fd_ringbuffer_flush2() argument
121 return ring->funcs->flush(ring, ring->last_start, in_fence_fd, out_fence_fd); in fd_ringbuffer_flush2()
124 drm_public void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords) in fd_ringbuffer_grow() argument
126 assert(ring->funcs->grow); /* unsupported on kgsl */ in fd_ringbuffer_grow()
129 if (ring->size < 0x100000) in fd_ringbuffer_grow()
130 ring->size *= 2; in fd_ringbuffer_grow()
132 ring->funcs->grow(ring, ring->size); in fd_ringbuffer_grow()
134 ring->start = ring->funcs->hostptr(ring); in fd_ringbuffer_grow()
135 ring->end = &(ring->start[ring->size/4]); in fd_ringbuffer_grow()
137 ring->cur = ring->last_start = ring->start; in fd_ringbuffer_grow()
140 drm_public uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) in fd_ringbuffer_timestamp() argument
142 return ring->last_timestamp; in fd_ringbuffer_timestamp()
145 drm_public void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, in fd_ringbuffer_reloc() argument
148 assert(ring->pipe->gpu_id < 500); in fd_ringbuffer_reloc()
149 ring->funcs->emit_reloc(ring, reloc); in fd_ringbuffer_reloc()
152 drm_public void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring, in fd_ringbuffer_reloc2() argument
155 ring->funcs->emit_reloc(ring, reloc); in fd_ringbuffer_reloc2()
158 drm_public uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring) in fd_ringbuffer_cmd_count() argument
160 if (!ring->funcs->cmd_count) in fd_ringbuffer_cmd_count()
162 return ring->funcs->cmd_count(ring); in fd_ringbuffer_cmd_count()
166 fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring, in fd_ringbuffer_emit_reloc_ring_full() argument
169 return ring->funcs->emit_reloc_ring(ring, target, cmd_idx); in fd_ringbuffer_emit_reloc_ring_full()
173 fd_ringbuffer_size(struct fd_ringbuffer *ring) in fd_ringbuffer_size() argument
179 assert(ring->flags & FD_RINGBUFFER_OBJECT); in fd_ringbuffer_size()
180 return offset_bytes(ring->cur, ring->start); in fd_ringbuffer_size()