summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-06-28 12:33:43 -0700
committerEric Anholt <[email protected]>2018-06-29 13:36:28 -0700
commita77cb724da62920476073566728fbaf9db341dc4 (patch)
tree9dfa532d184485c730f80c8ab5f7bd061006540e /src
parentc2901ff80fdd11375dfc67002f29f3965d5b988f (diff)
v3d: Move GL shader state dumping out of per-version compilation.
It doesn't depend on V3D_VER, since it's just calling v3d_print_group.
Diffstat (limited to 'src')
-rw-r--r--src/broadcom/clif/clif_dump.c35
-rw-r--r--src/broadcom/clif/clif_private.h9
-rw-r--r--src/broadcom/clif/v3dx_dump.c23
3 files changed, 26 insertions, 41 deletions
diff --git a/src/broadcom/clif/clif_dump.c b/src/broadcom/clif/clif_dump.c
index 1f57a6dbad5..ea9cee00e93 100644
--- a/src/broadcom/clif/clif_dump.c
+++ b/src/broadcom/clif/clif_dump.c
@@ -119,6 +119,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)
{
while (!list_empty(&clif->worklist)) {
@@ -136,15 +159,9 @@ clif_process_worklist(struct clif_dump *clif)
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,
diff --git a/src/broadcom/clif/clif_private.h b/src/broadcom/clif/clif_private.h
index 87de17697d8..376daef80d9 100644
--- a/src/broadcom/clif/clif_private.h
+++ b/src/broadcom/clif/clif_private.h
@@ -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);
-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);
-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);
-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, ...)
diff --git a/src/broadcom/clif/v3dx_dump.c b/src/broadcom/clif/v3dx_dump.c
index b1d16551d71..72c0d444b7a 100644
--- a/src/broadcom/clif/v3dx_dump.c
+++ b/src/broadcom/clif/v3dx_dump.c
@@ -138,26 +138,3 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
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);
- }
-}