summaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-09-28 13:36:54 -0700
committerEric Anholt <[email protected]>2017-10-10 11:42:05 -0700
commitd0dfc4bd5f3711ac48de88aa51fc6f442eaa0b20 (patch)
tree5123ba9af772a20efa43c0e9b21207e711dac437 /src/broadcom
parent7f3b8906979ba5f2c1876b4eb2c0b85314107511 (diff)
broadcom/vc5: Fix CLIF dumping of lists that aren't capped by a HALT.
The HW will halt when you hit a HALT packet, or when you hit the end address. Tell CLIF if there's an end address is so that it can stop correctly. (There was usually a 0 byte after the CL, so it would stop anyway).
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/clif/clif_dump.c27
-rw-r--r--src/broadcom/clif/clif_dump.h2
2 files changed, 21 insertions, 8 deletions
diff --git a/src/broadcom/clif/clif_dump.c b/src/broadcom/clif/clif_dump.c
index 8e9e248c0e4..339fc3835b0 100644
--- a/src/broadcom/clif/clif_dump.c
+++ b/src/broadcom/clif/clif_dump.c
@@ -245,21 +245,34 @@ clif_process_worklist(struct clif_dump *clif)
}
void
-clif_dump_add_cl(struct clif_dump *clif, uint32_t address)
+clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end)
{
uint32_t size;
- void *vaddr;
- if (!clif->lookup_vaddr(clif->data, address, &vaddr)) {
+ void *start_vaddr;
+ if (!clif->lookup_vaddr(clif->data, start, &start_vaddr)) {
out(clif, "Failed to look up address 0x%08x\n",
- address);
+ start);
return;
}
- uint8_t *cl = vaddr;
- while (clif_dump_packet(clif, address, cl, &size)) {
+ /* The end address is optional (for example, a BRANCH instruction
+ * won't set an end), but is used for BCL/RCL termination.
+ */
+ void *end_vaddr = NULL;
+ if (end && !clif->lookup_vaddr(clif->data, end, &end_vaddr)) {
+ out(clif, "Failed to look up address 0x%08x\n",
+ end);
+ return;
+ }
+
+ uint8_t *cl = start_vaddr;
+ while (clif_dump_packet(clif, start, cl, &size)) {
cl += size;
- address += size;
+ start += size;
+
+ if (cl == end_vaddr)
+ break;
}
out(clif, "\n");
diff --git a/src/broadcom/clif/clif_dump.h b/src/broadcom/clif/clif_dump.h
index 1201d83cb45..d46cc84710e 100644
--- a/src/broadcom/clif/clif_dump.h
+++ b/src/broadcom/clif/clif_dump.h
@@ -37,6 +37,6 @@ struct clif_dump *clif_dump_init(const struct v3d_device_info *devinfo,
void *data);
void clif_dump_destroy(struct clif_dump *clif);
-void clif_dump_add_cl(struct clif_dump *clif, uint32_t offset);
+void clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end);
#endif