v3d: Add a separate flag for CLIF ABI output versus human-readable CLs.
authorEric Anholt <eric@anholt.net>
Mon, 30 Jul 2018 18:29:26 +0000 (11:29 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 30 Jul 2018 21:29:01 +0000 (14:29 -0700)
A few of the upcoming changes would make the V3D_DEBUG=cl output less
readable, so let's make proper CLIF file production be under a separate
V3D_DEBUG=clif flag.

src/broadcom/clif/clif_dump.c
src/broadcom/clif/clif_dump.h
src/broadcom/clif/clif_private.h
src/broadcom/common/v3d_debug.c
src/broadcom/common/v3d_debug.h
src/gallium/drivers/v3d/v3d_job.c
src/gallium/drivers/vc4/vc4_cl_dump.c

index 6bee7a481b024c9cf216752b8f847cfeeac8afc2..a637ba5999fe44161a6aa07eecaa43af2e885705 100644 (file)
@@ -51,13 +51,14 @@ clif_dump_add_address_to_worklist(struct clif_dump *clif,
 
 struct clif_dump *
 clif_dump_init(const struct v3d_device_info *devinfo,
-               FILE *out)
+               FILE *out, bool pretty)
 {
         struct clif_dump *clif = rzalloc(NULL, struct clif_dump);
 
         clif->devinfo = devinfo;
         clif->out = out;
         clif->spec = v3d_spec_load(devinfo);
+        clif->pretty = pretty;
 
         list_inithead(&clif->worklist);
 
index f89447b9bd9765bcd4265b990e6fdcda97e2a487..f0a8f9a1f1481553844200b8165c9eed2ed5f427 100644 (file)
@@ -31,7 +31,7 @@ struct v3d_device_info;
 struct clif_dump;
 
 struct clif_dump *clif_dump_init(const struct v3d_device_info *devinfo,
-                                 FILE *output);
+                                 FILE *output, bool pretty);
 void clif_dump(struct clif_dump *clif);
 void clif_dump_destroy(struct clif_dump *clif);
 
index ea96784289a8ae4fea0906577894045693f17e65..8753ba229f8a3217220df5a57434796b033f2888 100644 (file)
@@ -47,6 +47,12 @@ 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 {
index 4fe8698018805299e9aead35d0ee9bd62e0c94be..97404448e58946a0ef4d08fb71b4e228155417b0 100644 (file)
@@ -41,6 +41,7 @@ uint32_t V3D_DEBUG = 0;
 
 static const struct debug_control debug_control[] = {
         { "cl",          V3D_DEBUG_CL},
+        { "clif",        V3D_DEBUG_CLIF},
         { "qpu",         V3D_DEBUG_QPU},
         { "vir",         V3D_DEBUG_VIR},
         { "nir",         V3D_DEBUG_NIR},
index 75eb2718f30c7fec854e8a121ffb9495f3cd2da3..d9f5255e216fb1555b8c48048ba0ef64fb036bb0 100644 (file)
@@ -54,6 +54,7 @@ extern uint32_t V3D_DEBUG;
 #define V3D_DEBUG_PERF                 (1 << 10)
 #define V3D_DEBUG_NORAST               (1 << 11)
 #define V3D_DEBUG_ALWAYS_FLUSH         (1 << 12)
+#define V3D_DEBUG_CLIF                 (1 << 13)
 
 #ifdef HAVE_ANDROID_PLATFORM
 #define LOG_TAG "BROADCOM-MESA"
index 54b2c8dfac7cf56a62deca68b6fc22c63222416a..d7df04c03c94c9dc4d75ff1b72b90aa017f95cf2 100644 (file)
@@ -344,11 +344,12 @@ v3d_get_job_for_fbo(struct v3d_context *v3d)
 static void
 v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
 {
-        if (!(V3D_DEBUG & V3D_DEBUG_CL))
+        if (!(V3D_DEBUG & (V3D_DEBUG_CL | V3D_DEBUG_CLIF)))
                 return;
 
         struct clif_dump *clif = clif_dump_init(&v3d->screen->devinfo,
-                                                stderr);
+                                                stderr,
+                                                V3D_DEBUG & V3D_DEBUG_CL);
 
         struct set_entry *entry;
         set_foreach(job->bos, entry) {
index bb26b057a447609ef88cabe3d6410478052a0f7a..a6ae0cf80d71e65e20e201837600000f3f45a60b 100644 (file)
@@ -42,7 +42,7 @@ vc4_dump_cl(void *cl, uint32_t size, bool is_render)
         };
         struct v3d_spec *spec = v3d_spec_load(&devinfo);
 
-        struct clif_dump *clif = clif_dump_init(&devinfo, stderr);
+        struct clif_dump *clif = clif_dump_init(&devinfo, stderr, true);
 
         uint32_t offset = 0, hw_offset = 0;
         uint8_t *p = cl;