diff options
author | Eric Anholt <[email protected]> | 2017-10-24 17:52:31 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-10-30 13:31:16 -0700 |
commit | 10fa685b537fa6c0ed16620278d6126d323adf0f (patch) | |
tree | 1629af9888c81d5b1bd3f986f98012bc9c6cc2f7 /src/broadcom/clif/clif_dump.c | |
parent | 125f2a751e0062077504f3651840e71d58c88af2 (diff) |
broadcom/clif: Move the CL printing part of CL dumps to a helper.
This will let me reuse the printing for processing branches to other CLs.
Diffstat (limited to 'src/broadcom/clif/clif_dump.c')
-rw-r--r-- | src/broadcom/clif/clif_dump.c | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/src/broadcom/clif/clif_dump.c b/src/broadcom/clif/clif_dump.c index 339fc3835b0..af72834e5dc 100644 --- a/src/broadcom/clif/clif_dump.c +++ b/src/broadcom/clif/clif_dump.c @@ -220,35 +220,8 @@ clif_dump_gl_shader_state_record(struct clif_dump *clif, } static void -clif_process_worklist(struct clif_dump *clif) +clif_dump_cl(struct clif_dump *clif, uint32_t start, uint32_t end) { - while (!list_empty(&clif->worklist)) { - struct reloc_worklist_entry *reloc = - list_first_entry(&clif->worklist, - struct reloc_worklist_entry, link); - list_del(&reloc->link); - - void *vaddr; - if (!clif->lookup_vaddr(clif->data, reloc->addr, &vaddr)) { - out(clif, "Failed to look up address 0x%08x\n", - reloc->addr); - continue; - } - - switch (reloc->type) { - case reloc_gl_shader_state: - clif_dump_gl_shader_state_record(clif, reloc, vaddr); - break; - } - out(clif, "\n"); - } -} - -void -clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end) -{ - uint32_t size; - void *start_vaddr; if (!clif->lookup_vaddr(clif->data, start, &start_vaddr)) { out(clif, "Failed to look up address 0x%08x\n", @@ -266,6 +239,7 @@ clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end) return; } + uint32_t size; uint8_t *cl = start_vaddr; while (clif_dump_packet(clif, start, cl, &size)) { cl += size; @@ -274,7 +248,37 @@ clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end) if (cl == end_vaddr) break; } +} +static void +clif_process_worklist(struct clif_dump *clif) +{ + while (!list_empty(&clif->worklist)) { + struct reloc_worklist_entry *reloc = + list_first_entry(&clif->worklist, + struct reloc_worklist_entry, link); + list_del(&reloc->link); + + void *vaddr; + if (!clif->lookup_vaddr(clif->data, reloc->addr, &vaddr)) { + out(clif, "Failed to look up address 0x%08x\n", + reloc->addr); + continue; + } + + switch (reloc->type) { + case reloc_gl_shader_state: + clif_dump_gl_shader_state_record(clif, reloc, vaddr); + break; + } + out(clif, "\n"); + } +} + +void +clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end) +{ + clif_dump_cl(clif, start, end); out(clif, "\n"); clif_process_worklist(clif); |