On Wednesday, July 11, 2018 4:43:52 AM PDT Sergii Romantsov wrote:
> SNB doesn't have a difinition of 3DSTATE_CONSTANT_BODY, thats
> why we got segmentation fault when used INTEL_DEBUG=bat.
> Fixed by avoiding parsing of 3DSTATE_CONSTANT_BODY if gen_spec
> is not observed.
> 
> Fixes: 169d8e011ae (intel: Fix 3DSTATE_CONSTANT buffer decoding.)
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107190
> Signed-off-by: Sergii Romantsov <sergii.romant...@globallogic.com>
> ---
>  src/intel/common/gen_batch_decoder.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/intel/common/gen_batch_decoder.c 
> b/src/intel/common/gen_batch_decoder.c
> index fe7536d..973221b 100644
> --- a/src/intel/common/gen_batch_decoder.c
> +++ b/src/intel/common/gen_batch_decoder.c
> @@ -561,6 +561,10 @@ decode_3dstate_constant(struct gen_batch_decode_ctx 
> *ctx, const uint32_t *p)
>     struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
>     struct gen_group *body =
>        gen_spec_find_struct(ctx->spec, "3DSTATE_CONSTANT_BODY");
> +   if (body == NULL) {
> +      fprintf(ctx->fp, "did not find 3DSTATE_CONSTANT_BODY info\n");
> +      return;
> +   }
>  
>     uint32_t read_length[4] = {0};
>     uint64_t read_addr[4];
> 

Could we refactor gen6.xml to have a 3DSTATE_CONSTANT_BODY structure
instead?  It would be layed out a bit differently than the Gen7+ one,
but we've essentially duplicated the same fields in 3DSTATE_CONSTANT_VS,
GS, and PS.  Then, this decoding should actually work, which would be
nicer...

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to