Lines Matching refs:cl

48 static inline void cl_pack_emit_reloc(struct vc4_cl *cl, const struct vc4_cl_reloc *);
69 void vc4_init_cl(struct vc4_job *job, struct vc4_cl *cl);
70 void vc4_reset_cl(struct vc4_cl *cl);
76 static inline uint32_t cl_offset(struct vc4_cl *cl)
78 return (char *)cl->next - (char *)cl->base;
82 cl_advance(struct vc4_cl_out **cl, uint32_t n)
84 (*cl) = (struct vc4_cl_out *)((char *)(*cl) + n);
88 cl_start(struct vc4_cl *cl)
90 return cl->next;
94 cl_end(struct vc4_cl *cl, struct vc4_cl_out *next)
96 cl->next = next;
97 assert(cl_offset(cl) <= cl->size);
116 cl_u8(struct vc4_cl_out **cl, uint8_t n)
118 *(uint8_t *)(*cl) = n;
119 cl_advance(cl, 1);
123 cl_u16(struct vc4_cl_out **cl, uint16_t n)
125 put_unaligned_16(*cl, n);
126 cl_advance(cl, 2);
130 cl_u32(struct vc4_cl_out **cl, uint32_t n)
132 put_unaligned_32(*cl, n);
133 cl_advance(cl, 4);
137 cl_aligned_u32(struct vc4_cl_out **cl, uint32_t n)
139 *(uint32_t *)(*cl) = n;
140 cl_advance(cl, 4);
144 cl_ptr(struct vc4_cl_out **cl, void *ptr)
146 *(struct vc4_cl_out **)(*cl) = ptr;
147 cl_advance(cl, sizeof(void *));
151 cl_f(struct vc4_cl_out **cl, float f)
153 cl_u32(cl, fui(f));
157 cl_aligned_f(struct vc4_cl_out **cl, float f)
159 cl_aligned_u32(cl, fui(f));
163 cl_start_shader_reloc(struct vc4_cl *cl, uint32_t n)
165 assert(cl->reloc_count == 0);
167 cl->reloc_count = n;
169 cl->reloc_next = cl->next;
172 cl_advance(&cl->next, n * 4);
174 return cl->next;
178 cl_reloc(struct vc4_job *job, struct vc4_cl *cl, struct vc4_cl_out **cl_out,
181 *(uint32_t *)cl->reloc_next = vc4_gem_hindex(job, bo);
182 cl_advance(&cl->reloc_next, 4);
185 cl->reloc_count--;
192 cl_aligned_reloc(struct vc4_job *job, struct vc4_cl *cl,
196 *(uint32_t *)cl->reloc_next = vc4_gem_hindex(job, bo);
197 cl_advance(&cl->reloc_next, 4);
200 cl->reloc_count--;
219 void cl_ensure_space(struct vc4_cl *cl, uint32_t size);
227 cl_get_emit_space(struct vc4_cl_out **cl, size_t size)
229 void *addr = *cl;
230 cl_advance(cl, size);
250 #define cl_emit(cl, packet, name) \
257 struct vc4_cl_out *cl_out = cl_start(cl); \
258 cl_packet_pack(packet)(cl, (uint8_t *)cl_out, &name); \
262 cl_end(cl, cl_out); \
266 #define cl_emit_prepacked(cl, packet) do { \
267 memcpy((cl)->next, packet, sizeof(*packet)); \
268 cl_advance(&(cl)->next, sizeof(*packet)); \
280 cl_pack_emit_reloc(struct vc4_cl *cl, const struct vc4_cl_reloc *reloc)
282 *(uint32_t *)cl->reloc_next = vc4_gem_hindex(cl->job, reloc->bo);
283 cl_advance(&cl->reloc_next, 4);
286 cl->reloc_count--;