v3d: Include commands to run the BCL and RCL in CLIF dumps.
authorEric Anholt <eric@anholt.net>
Wed, 27 Jun 2018 23:58:55 +0000 (16:58 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 30 Jul 2018 21:29:01 +0000 (14:29 -0700)
src/broadcom/clif/clif_dump.c
src/broadcom/clif/clif_dump.h
src/broadcom/clif/clif_private.h
src/gallium/drivers/v3d/v3d_job.c

index a637ba5999fe44161a6aa07eecaa43af2e885705..9562686c6d34dde3c2d4419b04b8f061b550fe0d 100644 (file)
@@ -24,6 +24,7 @@
 #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"
@@ -202,11 +203,6 @@ clif_process_worklist(struct clif_dump *clif)
         }
 }
 
-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)
 {
@@ -216,6 +212,35 @@ 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)
index f0a8f9a1f1481553844200b8165c9eed2ed5f427..8de3a2cbea49fb1934736906dac3fe2a5c4624cf 100644 (file)
 
 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,
index 8753ba229f8a3217220df5a57434796b033f2888..109701c3bc77619bf90e621bc31136c203b3b216 100644 (file)
@@ -105,4 +105,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 */
index d7df04c03c94c9dc4d75ff1b72b90aa017f95cf2..3645305f4f0878fbb1d19262426cf371981d51d9 100644 (file)
@@ -363,16 +363,7 @@ v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
                 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);
 }