Lines Matching defs:clif
36 clif_dump_add_address_to_worklist(struct clif_dump *clif,
41 rzalloc(clif, struct reloc_worklist_entry);
48 list_addtail(&entry->link, &clif->worklist);
57 struct clif_dump *clif = rzalloc(NULL, struct clif_dump);
59 clif->devinfo = devinfo;
60 clif->out = out;
61 clif->spec = v3d_spec_load(devinfo);
62 clif->pretty = pretty;
64 list_inithead(&clif->worklist);
66 return clif;
70 clif_dump_destroy(struct clif_dump *clif)
72 ralloc_free(clif);
76 clif_lookup_bo(struct clif_dump *clif, uint32_t addr)
78 for (int i = 0; i < clif->bo_count; i++) {
79 struct clif_bo *bo = &clif->bo[i];
91 clif_lookup_vaddr(struct clif_dump *clif, uint32_t addr, void **vaddr)
93 struct clif_bo *bo = clif_lookup_bo(clif, addr);
105 clif_dump_packet(struct clif_dump *clif, uint32_t offset, const uint8_t *cl,
108 if (clif->devinfo->ver >= 41)
109 return v3d41_clif_dump_packet(clif, offset, cl, size, reloc_mode);
111 return v3d33_clif_dump_packet(clif, offset, cl, size, reloc_mode);
115 clif_dump_cl(struct clif_dump *clif, uint32_t start, uint32_t end,
118 struct clif_bo *bo = clif_lookup_bo(clif, start);
120 out(clif, "Failed to look up address 0x%08x\n",
131 if (end && !clif_lookup_vaddr(clif, end, &end_vaddr)) {
132 out(clif, "Failed to look up address 0x%08x\n",
138 out(clif, "@format ctrllist /* [%s+0x%08x] */\n",
143 while (clif_dump_packet(clif, start, cl, &size, reloc_mode)) {
158 clif_dump_gl_shader_state_record(struct clif_dump *clif,
162 struct v3d_group *state = v3d_spec_find_struct(clif->spec,
164 struct v3d_group *attr = v3d_spec_find_struct(clif->spec,
170 out(clif, "@format shadrec_gl_main\n");
171 v3d_print_group(clif, state, 0, vaddr + offset);
175 out(clif, "@format shadrec_gl_attr /* %d */\n", i);
176 v3d_print_group(clif, attr, 0, vaddr + offset);
184 clif_process_worklist(struct clif_dump *clif)
187 &clif->worklist, link) {
189 if (!clif_lookup_vaddr(clif, reloc->addr, &vaddr)) {
190 out(clif, "Failed to look up address 0x%08x\n",
197 clif_dump_cl(clif, reloc->addr, reloc->cl.end, true);
203 clif_dump_cl(clif, reloc->addr,
218 clif_dump_if_blank(struct clif_dump *clif, struct clif_bo *bo,
226 out(clif, "\n");
227 out(clif, "@format blank %d /* [%s+0x%08x..0x%08x] */\n", end - start,
236 clif_dump_binary(struct clif_dump *clif, struct clif_bo *bo,
242 if (clif_dump_if_blank(clif, bo, start, end))
245 out(clif, "@format binary /* [%s+0x%08x] */\n",
251 if (clif_dump_if_blank(clif, bo, offset, end))
255 out(clif, "0x%08x ", *(uint32_t *)(bo->vaddr + offset));
258 out(clif, "0x%02x ", *(uint8_t *)(bo->vaddr + offset));
263 out(clif, "\n");
268 out(clif, "\n");
276 clif_dump_buffers(struct clif_dump *clif)
280 &clif->worklist, link) {
284 ralloc_array(clif, struct reloc_worklist_entry *, num_relocs);
287 &clif->worklist, link) {
297 struct clif_bo *new_bo = clif_lookup_bo(clif, reloc->addr);
300 out(clif, "Failed to look up address 0x%08x\n",
308 clif_dump_binary(clif, bo,
313 out(clif, "\n");
314 out(clif, "@buffer %s\n", new_bo->name);
322 clif_dump_binary(clif, bo, offset, reloc_offset);
327 offset = clif_dump_cl(clif, reloc->addr, reloc->cl.end,
329 out(clif, "\n");
333 offset += clif_dump_gl_shader_state_record(clif,
339 offset = clif_dump_cl(clif, reloc->addr,
344 out(clif, "\n");
348 clif_dump_binary(clif, bo, offset, bo->size);
352 for (int i = 0; i < clif->bo_count; i++) {
353 bo = &clif->bo[i];
356 out(clif, "@buffer %s\n", bo->name);
357 clif_dump_binary(clif, bo, 0, bo->size);
358 out(clif, "\n");
363 clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end)
366 clif_dump_add_address_to_worklist(clif, reloc_cl, start);
378 clif_dump(struct clif_dump *clif, const struct drm_v3d_submit_cl *submit)
380 clif_dump_add_cl(clif, submit->bcl_start, submit->bcl_end);
381 clif_dump_add_cl(clif, submit->rcl_start, submit->rcl_end);
383 qsort(clif->bo, clif->bo_count, sizeof(clif->bo[0]),
389 for (int i = 0; i < clif->bo_count; i++) {
390 out(clif, "@createbuf_aligned 4096 %s\n", clif->bo[i].name);
396 clif_process_worklist(clif);
401 clif_dump_buffers(clif);
403 out(clif, "@add_bin 0\n ");
404 out_address(clif, submit->bcl_start);
405 out(clif, "\n ");
406 out_address(clif, submit->bcl_end);
407 out(clif, "\n ");
408 out_address(clif, submit->qma);
409 out(clif, "\n %d\n ", submit->qms);
410 out_address(clif, submit->qts);
411 out(clif, "\n");
412 out(clif, "@wait_bin_all_cores\n");
414 out(clif, "@add_render 0\n ");
415 out_address(clif, submit->rcl_start);
416 out(clif, "\n ");
417 out_address(clif, submit->rcl_end);
418 out(clif, "\n ");
419 out_address(clif, submit->qma);
420 out(clif, "\n");
421 out(clif, "@wait_render_all_cores\n");
425 clif_dump_add_bo(struct clif_dump *clif, const char *name,
428 if (clif->bo_count >= clif->bo_array_size) {
429 clif->bo_array_size = MAX2(4, clif->bo_array_size * 2);
430 clif->bo = reralloc(clif, clif->bo, struct clif_bo,
431 clif->bo_array_size);
435 for (int i = 0; i < clif->bo_count; i++)
436 assert(strcmp(clif->bo[i].name, name) != 0);
438 clif->bo[clif->bo_count].name = ralloc_strdup(clif, name);
439 clif->bo[clif->bo_count].offset = offset;
440 clif->bo[clif->bo_count].size = size;
441 clif->bo[clif->bo_count].vaddr = vaddr;
442 clif->bo[clif->bo_count].dumped = false;
443 clif->bo_count++;