X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fbroadcom%2Fclif%2Fclif_private.h;h=597d0b5067392f8550de6df8ccffcb4a675ead04;hb=d0b644d9f9d9673d3fe28c8c200209f553adeda1;hp=0d762c4b74702118078afa1f06a2e50ce5cf1646;hpb=01b4952773e874b5fa0cc8190d846f7bbb1c18b6;p=mesa.git diff --git a/src/broadcom/clif/clif_private.h b/src/broadcom/clif/clif_private.h index 0d762c4b747..597d0b50673 100644 --- a/src/broadcom/clif/clif_private.h +++ b/src/broadcom/clif/clif_private.h @@ -33,6 +33,7 @@ struct clif_bo { uint32_t offset; uint32_t size; void *vaddr; + bool dumped; }; struct clif_dump { @@ -47,9 +48,16 @@ struct clif_dump { struct clif_bo *bo; int bo_count; int bo_array_size; + + /** + * Flag to switch from CLIF ABI to slightly more human-readable + * output. + */ + bool pretty; }; enum reloc_worklist_type { + reloc_cl, reloc_gl_shader_state, reloc_generic_tile_list, }; @@ -61,6 +69,9 @@ struct reloc_worklist_entry { uint32_t addr; union { + struct { + uint32_t end; + } cl; struct { uint32_t num_attrs; } shader_state; @@ -70,17 +81,20 @@ struct reloc_worklist_entry { }; }; +struct clif_bo * +clif_lookup_bo(struct clif_dump *clif, uint32_t addr); + struct reloc_worklist_entry * clif_dump_add_address_to_worklist(struct clif_dump *clif, enum reloc_worklist_type type, uint32_t addr); bool v3d33_clif_dump_packet(struct clif_dump *clif, uint32_t offset, - const uint8_t *cl, uint32_t *size); + const uint8_t *cl, uint32_t *size, bool reloc_mode); bool v3d41_clif_dump_packet(struct clif_dump *clif, uint32_t offset, - const uint8_t *cl, uint32_t *size); + const uint8_t *cl, uint32_t *size, bool reloc_mode); bool v3d42_clif_dump_packet(struct clif_dump *clif, uint32_t offset, - const uint8_t *cl, uint32_t *size); + const uint8_t *cl, uint32_t *size, bool reloc_mode); static inline void out(struct clif_dump *clif, const char *fmt, ...) @@ -92,4 +106,18 @@ out(struct clif_dump *clif, const char *fmt, ...) va_end(args); } +static inline void +out_address(struct clif_dump *clif, uint32_t addr) +{ + struct clif_bo *bo = clif_lookup_bo(clif, addr); + if (bo) { + out(clif, "[%s+0x%08x] /* 0x%08x */", + bo->name, addr - bo->offset, addr); + } else if (addr) { + out(clif, "/* XXX: BO unknown */ 0x%08x", addr); + } else { + out(clif, "[null]"); + } +} + #endif /* CLIF_PRIVATE_H */