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;
63 clif->nobin = nobin;
65 list_inithead(&clif->worklist);
67 return clif;
71 clif_dump_destroy(struct clif_dump *clif)
73 ralloc_free(clif);
77 clif_lookup_bo(struct clif_dump *clif, uint32_t addr)
79 for (int i = 0; i < clif->bo_count; i++) {
80 struct clif_bo *bo = &clif->bo[i];
92 clif_lookup_vaddr(struct clif_dump *clif, uint32_t addr, void **vaddr)
94 struct clif_bo *bo = clif_lookup_bo(clif, addr);
106 clif_dump_packet(struct clif_dump *clif, uint32_t offset, const uint8_t *cl,
109 if (clif->devinfo->ver >= 42)
110 return v3d42_clif_dump_packet(clif, offset, cl, size, reloc_mode);
111 else if (clif->devinfo->ver >= 41)
112 return v3d41_clif_dump_packet(clif, offset, cl, size, reloc_mode);
114 return v3d33_clif_dump_packet(clif, offset, cl, size, reloc_mode);
118 clif_dump_cl(struct clif_dump *clif, uint32_t start, uint32_t end,
121 struct clif_bo *bo = clif_lookup_bo(clif, start);
123 out(clif, "Failed to look up address 0x%08x\n",
134 if (end && !clif_lookup_vaddr(clif, end, &end_vaddr)) {
135 out(clif, "Failed to look up address 0x%08x\n",
141 out(clif, "@format ctrllist /* [%s+0x%08x] */\n",
146 while (clif_dump_packet(clif, start, cl, &size, reloc_mode)) {
161 clif_dump_gl_shader_state_record(struct clif_dump *clif,
165 struct v3d_group *state = v3d_spec_find_struct(clif->spec,
167 struct v3d_group *attr = v3d_spec_find_struct(clif->spec,
173 out(clif, "@format shadrec_gl_main\n");
174 v3d_print_group(clif, state, 0, vaddr + offset);
178 out(clif, "@format shadrec_gl_attr /* %d */\n", i);
179 v3d_print_group(clif, attr, 0, vaddr + offset);
187 clif_process_worklist(struct clif_dump *clif)
190 &clif->worklist, link) {
192 if (!clif_lookup_vaddr(clif, reloc->addr, &vaddr)) {
193 out(clif, "Failed to look up address 0x%08x\n",
200 clif_dump_cl(clif, reloc->addr, reloc->cl.end, true);
206 clif_dump_cl(clif, reloc->addr,
221 clif_dump_if_blank(struct clif_dump *clif, struct clif_bo *bo,
229 out(clif, "\n");
230 out(clif, "@format blank %d /* [%s+0x%08x..0x%08x] */\n", end - start,
239 clif_dump_binary(struct clif_dump *clif, struct clif_bo *bo,
242 if (clif->pretty && clif->nobin)
248 if (clif_dump_if_blank(clif, bo, start, end))
251 out(clif, "@format binary /* [%s+0x%08x] */\n",
257 if (clif_dump_if_blank(clif, bo, offset, end))
261 out(clif, "0x%08x ", *(uint32_t *)(bo->vaddr + offset));
264 out(clif, "0x%02x ", *(uint8_t *)(bo->vaddr + offset));
269 out(clif, "\n");
274 out(clif, "\n");
282 clif_dump_buffers(struct clif_dump *clif)
286 &clif->worklist, link) {
290 ralloc_array(clif, struct reloc_worklist_entry *, num_relocs);
293 &clif->worklist, link) {
303 struct clif_bo *new_bo = clif_lookup_bo(clif, reloc->addr);
306 out(clif, "Failed to look up address 0x%08x\n",
314 clif_dump_binary(clif, bo,
319 out(clif, "\n");
320 out(clif, "@buffer %s\n", new_bo->name);
328 clif_dump_binary(clif, bo, offset, reloc_offset);
333 offset = clif_dump_cl(clif, reloc->addr, reloc->cl.end,
335 out(clif, "\n");
339 offset += clif_dump_gl_shader_state_record(clif,
345 offset = clif_dump_cl(clif, reloc->addr,
350 out(clif, "\n");
354 clif_dump_binary(clif, bo, offset, bo->size);
358 for (int i = 0; i < clif->bo_count; i++) {
359 bo = &clif->bo[i];
362 out(clif, "@buffer %s\n", bo->name);
363 clif_dump_binary(clif, bo, 0, bo->size);
364 out(clif, "\n");
369 clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end)
372 clif_dump_add_address_to_worklist(clif, reloc_cl, start);
384 clif_dump(struct clif_dump *clif, const struct drm_v3d_submit_cl *submit)
386 clif_dump_add_cl(clif, submit->bcl_start, submit->bcl_end);
387 clif_dump_add_cl(clif, submit->rcl_start, submit->rcl_end);
389 qsort(clif->bo, clif->bo_count, sizeof(clif->bo[0]),
395 for (int i = 0; i < clif->bo_count; i++) {
396 out(clif, "@createbuf_aligned 4096 %s\n", clif->bo[i].name);
402 clif_process_worklist(clif);
407 clif_dump_buffers(clif);
409 out(clif, "@add_bin 0\n ");
410 out_address(clif, submit->bcl_start);
411 out(clif, "\n ");
412 out_address(clif, submit->bcl_end);
413 out(clif, "\n ");
414 out_address(clif, submit->qma);
415 out(clif, "\n %d\n ", submit->qms);
416 out_address(clif, submit->qts);
417 out(clif, "\n");
418 out(clif, "@wait_bin_all_cores\n");
420 out(clif, "@add_render 0\n ");
421 out_address(clif, submit->rcl_start);
422 out(clif, "\n ");
423 out_address(clif, submit->rcl_end);
424 out(clif, "\n ");
425 out_address(clif, submit->qma);
426 out(clif, "\n");
427 out(clif, "@wait_render_all_cores\n");
431 clif_dump_add_bo(struct clif_dump *clif, const char *name,
434 if (clif->bo_count >= clif->bo_array_size) {
435 clif->bo_array_size = MAX2(4, clif->bo_array_size * 2);
436 clif->bo = reralloc(clif, clif->bo, struct clif_bo,
437 clif->bo_array_size);
441 for (int i = 0; i < clif->bo_count; i++)
442 assert(strcmp(clif->bo[i].name, name) != 0);
444 clif->bo[clif->bo_count].name = ralloc_strdup(clif, name);
445 clif->bo[clif->bo_count].offset = offset;
446 clif->bo[clif->bo_count].size = size;
447 clif->bo[clif->bo_count].vaddr = vaddr;
448 clif->bo[clif->bo_count].dumped = false;
449 clif->bo_count++;