[Mesa-dev] [PATCH] intel/batch_decoder: decoding of 3DSTATE_CONSTANT_BODY.

Kenneth Graunke kenneth at whitecape.org
Wed Jul 11 18:18:55 UTC 2018


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.romantsov at 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...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180711/3b1eb76d/attachment.sig>


More information about the mesa-dev mailing list