[Mesa-dev] [PATCH 4/5] intel: decoder: fix starting dword of struct fields

Kenneth Graunke kenneth at whitecape.org
Wed May 2 16:02:29 UTC 2018


On Wednesday, May 2, 2018 2:57:50 AM PDT Lionel Landwerlin wrote:
> On 02/05/18 07:44, Kenneth Graunke wrote:
> > On Tuesday, May 1, 2018 4:43:05 PM PDT Lionel Landwerlin wrote:
> >> Struct fields might span several dwords, but iter_dword is incremented
> >> up to the last dword of the current field before we print out the
> >> struct's fields. We can't use iter_dword for computing the offset into
> >> the pointer of data to decode.
> >>
> >> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> >> ---
> >>   src/intel/common/gen_decoder.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
> >> index 93fa4864ee3..a0a9634c5d9 100644
> >> --- a/src/intel/common/gen_decoder.c
> >> +++ b/src/intel/common/gen_decoder.c
> >> @@ -1064,7 +1064,7 @@ gen_print_group(FILE *outfile, struct gen_group *group, uint64_t offset,
> >>            if (iter.struct_desc) {
> >>               uint64_t struct_offset = offset + 4 * iter_dword;
> >>               gen_print_group(outfile, iter.struct_desc, struct_offset,
> >> -                            &p[iter_dword], iter.start_bit % 32, color);
> >> +                            &p[iter.start_bit / 32], iter.start_bit % 32, color);
> >>            }
> >>         }
> >>      }
> >>
> > Does struct_offset need to use iter.start_bit / 32 then, too?
> Good catch!
> Thanks,
> 
> -
> Lionel

With uint64_t struct_offset = offset + 4 * (iter.start_bit / 32);
this would be:

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- 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/20180502/12ad58c5/attachment.sig>


More information about the mesa-dev mailing list