[Mesa-dev] [PATCH 04/11] aubinator: Drop decode_structure() helper.

Kenneth Graunke kenneth at whitecape.org
Mon Mar 20 09:13:13 UTC 2017


It made more sense when decode_group() took a bunch of extra options,
but now that there's only one...we may as well pass 0 and call it a day.
---
 src/intel/tools/aubinator.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 05eb3d1be94..1f6a1fe4b1d 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -162,13 +162,6 @@ decode_group(struct gen_spec *spec, struct gen_group *strct,
 }
 
 static void
-decode_structure(struct gen_spec *spec, struct gen_group *strct,
-                 const uint32_t *p)
-{
-   decode_group(spec, strct, p, 0);
-}
-
-static void
 dump_binding_table(struct gen_spec *spec, uint32_t offset)
 {
    uint32_t *pointers, i;
@@ -195,7 +188,7 @@ dump_binding_table(struct gen_spec *spec, uint32_t offset)
          fprintf(outfile, "pointer %u: %08x\n", i, pointers[i]);
       }
 
-      decode_structure(spec, surface_state, gtt + start);
+      decode_group(spec, surface_state, gtt + start, 0);
    }
 }
 
@@ -307,7 +300,7 @@ dump_samplers(struct gen_spec *spec, uint32_t offset)
    start = dynamic_state_base + offset;
    for (i = 0; i < 4; i++) {
       fprintf(outfile, "sampler state %d\n", i);
-      decode_structure(spec, sampler_state, gtt + start + i * 16);
+      decode_group(spec, sampler_state, gtt + start + i * 16, 0);
    }
 }
 
@@ -331,7 +324,7 @@ handle_media_interface_descriptor_load(struct gen_spec *spec, uint32_t *p)
    descriptors = gtt + start;
    for (i = 0; i < length; i++, descriptors += 8) {
       fprintf(outfile, "descriptor %u: %08x\n", i, *descriptors);
-      decode_structure(spec, descriptor_structure, descriptors);
+      decode_group(spec, descriptor_structure, descriptors, 0);
 
       start = instruction_base + descriptors[0];
       if (!valid_offset(start)) {
@@ -599,7 +592,7 @@ handle_3dstate_viewport_state_pointers_cc(struct gen_spec *spec, uint32_t *p)
    start = dynamic_state_base + (p[1] & ~0x1fu);
    for (uint32_t i = 0; i < 4; i++) {
       fprintf(outfile, "viewport %d\n", i);
-      decode_structure(spec, cc_viewport, gtt + start + i * 8);
+      decode_group(spec, cc_viewport, gtt + start + i * 8, 0);
    }
 }
 
@@ -615,7 +608,7 @@ handle_3dstate_viewport_state_pointers_sf_clip(struct gen_spec *spec,
    start = dynamic_state_base + (p[1] & ~0x3fu);
    for (uint32_t i = 0; i < 4; i++) {
       fprintf(outfile, "viewport %d\n", i);
-      decode_structure(spec, sf_clip_viewport, gtt + start + i * 64);
+      decode_group(spec, sf_clip_viewport, gtt + start + i * 64, 0);
    }
 }
 
@@ -628,7 +621,7 @@ handle_3dstate_blend_state_pointers(struct gen_spec *spec, uint32_t *p)
    blend_state = gen_spec_find_struct(spec, "BLEND_STATE");
 
    start = dynamic_state_base + (p[1] & ~0x3fu);
-   decode_structure(spec, blend_state, gtt + start);
+   decode_group(spec, blend_state, gtt + start, 0);
 }
 
 static void
@@ -640,7 +633,7 @@ handle_3dstate_cc_state_pointers(struct gen_spec *spec, uint32_t *p)
    cc_state = gen_spec_find_struct(spec, "COLOR_CALC_STATE");
 
    start = dynamic_state_base + (p[1] & ~0x3fu);
-   decode_structure(spec, cc_state, gtt + start);
+   decode_group(spec, cc_state, gtt + start, 0);
 }
 
 static void
@@ -652,7 +645,7 @@ handle_3dstate_scissor_state_pointers(struct gen_spec *spec, uint32_t *p)
    scissor_rect = gen_spec_find_struct(spec, "SCISSOR_RECT");
 
    start = dynamic_state_base + (p[1] & ~0x1fu);
-   decode_structure(spec, scissor_rect, gtt + start);
+   decode_group(spec, scissor_rect, gtt + start, 0);
 }
 
 static void
@@ -663,7 +656,7 @@ handle_load_register_imm(struct gen_spec *spec, uint32_t *p)
    if (reg != NULL) {
       fprintf(outfile, "register %s (0x%x): 0x%x\n",
               reg->name, reg->register_offset, p[2]);
-      decode_structure(spec, reg, &p[2]);
+      decode_group(spec, reg, &p[2], 0);
    }
 }
 
-- 
2.12.0



More information about the mesa-dev mailing list