[Mesa-dev] [PATCH] i965: Support decoding INTERFACE_DESCRIPTOR_DATA with INTEL_DEBUG=bat

Scott D Phillips scott.d.phillips at intel.com
Mon Nov 20 23:39:11 UTC 2017


Jordan Justen <jordan.l.justen at intel.com> writes:

> This will dump the INTERFACE_DESCRIPTOR_DATA along with the associated
> samplers & surfaces.
>
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>

Reviewed-by: Scott D Phillips <scott.d.phillips at intel.com>

> ---
>  src/mesa/drivers/dri/i965/intel_batchbuffer.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> index 3412b1d0a5f..216073129ba 100644
> --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> @@ -564,6 +564,30 @@ do_batch_dump(struct brw_context *brw)
>           decode_struct(brw, spec, "DEPTH_STENCIL_STATE", state,
>                         state_gtt_offset, p[1] & ~0x3fu, color);
>           break;
> +      case MEDIA_INTERFACE_DESCRIPTOR_LOAD: {
> +         struct gen_group *group =
> +            gen_spec_find_struct(spec, "RENDER_SURFACE_STATE");
> +         if (!group)
> +            break;
> +
> +         uint32_t idd_offset = p[3] & ~0x1fu;
> +         decode_struct(brw, spec, "INTERFACE_DESCRIPTOR_DATA", state,
> +                       state_gtt_offset, idd_offset, color);
> +
> +         uint32_t ss_offset = state[idd_offset / 4 + 3] & ~0x1fu;
> +         decode_structs(brw, spec, "SAMPLER_STATE", state,
> +                        state_gtt_offset, ss_offset, 4 * 4, color);
> +
> +         uint32_t bt_offset = state[idd_offset / 4 + 4] & ~0x1fu;
> +         int bt_entries = brw_state_batch_size(brw, bt_offset) / 4;
> +         uint32_t *bt_pointers = &state[bt_offset / 4];
> +         for (int i = 0; i < bt_entries; i++) {
> +            fprintf(stderr, "SURFACE_STATE - BTI = %d\n", i);
> +            gen_print_group(stderr, group, state_gtt_offset + bt_pointers[i],
> +                            &state[bt_pointers[i] / 4], color);
> +         }
> +         break;
> +      }
>        }
>     }
>  
> -- 
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list