intel/decoder: Use get_state_size() over guessed counts in more cases
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 23 May 2019 01:11:50 +0000 (18:11 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 28 May 2019 20:44:16 +0000 (13:44 -0700)
This makes the following packets use actual driver provided sizes rather
than guessing an arbitrary number:

  - CC_VIEWPORT
  - SF_CLIP_VIEWPORT
  - BLEND_STATE
  - COLOR_CALC_STATE
  - SCISSOR_RECT

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
src/intel/common/gen_batch_decoder.c

index 5cac983..e44c352 100644 (file)
@@ -706,6 +706,8 @@ decode_dynamic_state_pointers(struct gen_batch_decode_ctx *ctx,
       state = gen_spec_find_struct(ctx->spec, struct_type);
    }
 
+   count = update_count(ctx, state_offset, state->dw_length, count);
+
    for (int i = 0; i < count; i++) {
       fprintf(ctx->fp, "%s %d\n", struct_type, i);
       ctx_print_group(ctx, state, state_addr, state_map);