#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "drm-uapi/v3d_drm.h"
#include "clif_dump.h"
#include "clif_private.h"
#include "util/list.h"
}
}
-void clif_dump(struct clif_dump *clif)
-{
- clif_process_worklist(clif);
-}
-
void
clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end)
{
entry->cl.end = end;
}
+void
+clif_dump(struct clif_dump *clif, const struct drm_v3d_submit_cl *submit)
+{
+ clif_dump_add_cl(clif, submit->bcl_start, submit->bcl_end);
+ clif_dump_add_cl(clif, submit->rcl_start, submit->rcl_end);
+
+ clif_process_worklist(clif);
+
+ out(clif, "@add_bin 0\n ");
+ out_address(clif, submit->bcl_start);
+ out(clif, "\n ");
+ out_address(clif, submit->bcl_end);
+ out(clif, "\n ");
+ out_address(clif, submit->qma);
+ out(clif, "\n %d\n ", submit->qms);
+ out_address(clif, submit->qts);
+ out(clif, "\n");
+ out(clif, "@wait_bin_all_cores\n");
+
+ out(clif, "@add_render 0\n ");
+ out_address(clif, submit->rcl_start);
+ out(clif, "\n ");
+ out_address(clif, submit->rcl_end);
+ out(clif, "\n ");
+ out_address(clif, submit->qma);
+ out(clif, "\n");
+ out(clif, "@wait_render_all_cores\n");
+}
+
void
clif_dump_add_bo(struct clif_dump *clif, const char *name,
uint32_t offset, uint32_t size, void *vaddr)
struct v3d_device_info;
struct clif_dump;
+struct drm_v3d_submit_cl;
struct clif_dump *clif_dump_init(const struct v3d_device_info *devinfo,
FILE *output, bool pretty);
-void clif_dump(struct clif_dump *clif);
+void clif_dump(struct clif_dump *clif, const struct drm_v3d_submit_cl *submit);
void clif_dump_destroy(struct clif_dump *clif);
void clif_dump_add_bo(struct clif_dump *clif, const char *name,
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 */
ralloc_free(name);
}
- fprintf(stderr, "BCL: 0x%08x..0x%08x\n",
- job->submit.bcl_start, job->submit.bcl_end);
-
- clif_dump_add_cl(clif, job->submit.bcl_start, job->submit.bcl_end);
-
- fprintf(stderr, "RCL: 0x%08x..0x%08x\n",
- job->submit.rcl_start, job->submit.rcl_end);
- clif_dump_add_cl(clif, job->submit.rcl_start, job->submit.rcl_end);
-
- clif_dump(clif);
+ clif_dump(clif, &job->submit);
clif_dump_destroy(clif);
}