v3d: Move GL shader state dumping out of per-version compilation.
authorEric Anholt <eric@anholt.net>
Thu, 28 Jun 2018 19:33:43 +0000 (12:33 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 29 Jun 2018 20:36:28 +0000 (13:36 -0700)
It doesn't depend on V3D_VER, since it's just calling v3d_print_group.

src/broadcom/clif/clif_dump.c
src/broadcom/clif/clif_private.h
src/broadcom/clif/v3dx_dump.c

index 1f57a6dbad541c9b77d5e07a67229dec48cac643..ea9cee00e936b078ed05590a6bd6364f4a58e428 100644 (file)
@@ -118,6 +118,29 @@ clif_dump_cl(struct clif_dump *clif, uint32_t start, uint32_t end)
         }
 }
 
         }
 }
 
+static void
+clif_dump_gl_shader_state_record(struct clif_dump *clif,
+                                 struct reloc_worklist_entry *reloc,
+                                 void *vaddr)
+{
+        struct v3d_group *state = v3d_spec_find_struct(clif->spec,
+                                                       "GL Shader State Record");
+        struct v3d_group *attr = v3d_spec_find_struct(clif->spec,
+                                                      "GL Shader State Attribute Record");
+        assert(state);
+        assert(attr);
+
+        out(clif, "GL Shader State Record at 0x%08x\n", reloc->addr);
+        v3d_print_group(clif->out, state, 0, vaddr, "");
+        vaddr += v3d_group_get_length(state);
+
+        for (int i = 0; i < reloc->shader_state.num_attrs; i++) {
+                out(clif, "  Attribute %d\n", i);
+                v3d_print_group(clif->out, attr, 0, vaddr, "");
+                vaddr += v3d_group_get_length(attr);
+        }
+}
+
 static void
 clif_process_worklist(struct clif_dump *clif)
 {
 static void
 clif_process_worklist(struct clif_dump *clif)
 {
@@ -136,15 +159,9 @@ clif_process_worklist(struct clif_dump *clif)
 
                 switch (reloc->type) {
                 case reloc_gl_shader_state:
 
                 switch (reloc->type) {
                 case reloc_gl_shader_state:
-                        if (clif->devinfo->ver >= 41) {
-                                v3d41_clif_dump_gl_shader_state_record(clif,
-                                                                       reloc,
-                                                                       vaddr);
-                        } else {
-                                v3d33_clif_dump_gl_shader_state_record(clif,
-                                                                       reloc,
-                                                                       vaddr);
-                        }
+                        clif_dump_gl_shader_state_record(clif,
+                                                         reloc,
+                                                         vaddr);
                         break;
                 case reloc_generic_tile_list:
                         clif_dump_cl(clif, reloc->addr,
                         break;
                 case reloc_generic_tile_list:
                         clif_dump_cl(clif, reloc->addr,
index 87de17697d84e3e1d7c6063c3b1aaf59a56bbed8..376daef80d949efb8cc823da0dd08fc6f23fa2bb 100644 (file)
@@ -69,19 +69,10 @@ clif_dump_add_address_to_worklist(struct clif_dump *clif,
 
 bool v3d33_clif_dump_packet(struct clif_dump *clif, uint32_t offset,
                             const uint8_t *cl, uint32_t *size);
 
 bool v3d33_clif_dump_packet(struct clif_dump *clif, uint32_t offset,
                             const uint8_t *cl, uint32_t *size);
-void v3d33_clif_dump_gl_shader_state_record(struct clif_dump *clif,
-                                            struct reloc_worklist_entry *reloc,
-                                            void *vaddr);
 bool v3d41_clif_dump_packet(struct clif_dump *clif, uint32_t offset,
                             const uint8_t *cl, uint32_t *size);
 bool v3d41_clif_dump_packet(struct clif_dump *clif, uint32_t offset,
                             const uint8_t *cl, uint32_t *size);
-void v3d41_clif_dump_gl_shader_state_record(struct clif_dump *clif,
-                                            struct reloc_worklist_entry *reloc,
-                                            void *vaddr);
 bool v3d42_clif_dump_packet(struct clif_dump *clif, uint32_t offset,
                             const uint8_t *cl, uint32_t *size);
 bool v3d42_clif_dump_packet(struct clif_dump *clif, uint32_t offset,
                             const uint8_t *cl, uint32_t *size);
-void v3d42_clif_dump_gl_shader_state_record(struct clif_dump *clif,
-                                            struct reloc_worklist_entry *reloc,
-                                            void *vaddr);
 
 static inline void
 out(struct clif_dump *clif, const char *fmt, ...)
 
 static inline void
 out(struct clif_dump *clif, const char *fmt, ...)
index b1d16551d7144fbca3dc414f6874edbd9cb2dfbe..72c0d444b7a0068b6f63ce7ea5e8a96fc93a928c 100644 (file)
@@ -138,26 +138,3 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
 
         return true;
 }
 
         return true;
 }
-
-void
-v3dX(clif_dump_gl_shader_state_record)(struct clif_dump *clif,
-                                       struct reloc_worklist_entry *reloc,
-                                       void *vaddr)
-{
-        struct v3d_group *state = v3d_spec_find_struct(clif->spec,
-                                                       "GL Shader State Record");
-        struct v3d_group *attr = v3d_spec_find_struct(clif->spec,
-                                                      "GL Shader State Attribute Record");
-        assert(state);
-        assert(attr);
-
-        out(clif, "GL Shader State Record at 0x%08x\n", reloc->addr);
-        v3d_print_group(clif->out, state, 0, vaddr, "");
-        vaddr += v3d_group_get_length(state);
-
-        for (int i = 0; i < reloc->shader_state.num_attrs; i++) {
-                out(clif, "  Attribute %d\n", i);
-                v3d_print_group(clif->out, attr, 0, vaddr, "");
-                vaddr += v3d_group_get_length(attr);
-        }
-}