[Mesa-dev] [PATCH 05/14] intel: aubinator: simplify decoding

Eric Engestrom eric.engestrom at intel.com
Thu Aug 2 13:21:08 UTC 2018


On Thursday, 2018-08-02 10:39:17 +0100, Lionel Landwerlin wrote:
> Since we don't support streaming an aub file, we can drop the decoding
> status enum.
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  src/intel/tools/aubinator.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
> index 3fec04c24c4..7caccb31d4d 100644
> --- a/src/intel/tools/aubinator.c
> +++ b/src/intel/tools/aubinator.c
> @@ -712,13 +712,7 @@ aub_file_open(const char *filename)
>  
>  #define MAKE_GEN(major, minor) ( ((major) << 8) | (minor) )
>  
> -enum {
> -   AUB_ITEM_DECODE_OK,
> -   AUB_ITEM_DECODE_FAILED,
> -   AUB_ITEM_DECODE_NEED_MORE_DATA,
> -};
> -
> -static int
> +static bool

You'll need to add #include <stdbool.h>

With that, 2-6 are
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>

>  aub_file_decode_batch(struct aub_file *file)
>  {
>     uint32_t *p, h, *new_cursor;
> @@ -741,7 +735,7 @@ aub_file_decode_batch(struct aub_file *file)
>        fprintf(outfile, "unknown opcode %d at %td/%td\n",
>                OPCODE(h), file->cursor - file->map,
>                file->end - file->map);
> -      return AUB_ITEM_DECODE_FAILED;
> +      return false;
>     }
>  
>     new_cursor = p + header_length + bias;
> @@ -782,7 +776,7 @@ aub_file_decode_batch(struct aub_file *file)
>     }
>     file->cursor = new_cursor;
>  
> -   return AUB_ITEM_DECODE_OK;
> +   return true;
>  }
>  
>  static int
> @@ -914,7 +908,7 @@ int main(int argc, char *argv[])
>     file = aub_file_open(input_file);
>  
>     while (aub_file_more_stuff(file) &&
> -          aub_file_decode_batch(file) == AUB_ITEM_DECODE_OK);
> +          aub_file_decode_batch(file));
>  
>     fflush(stdout);
>     /* close the stdout which is opened to write the output */
> -- 
> 2.18.0
> 
> _______________________________________________
> 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