[Mesa-dev] [PATCH] intel/genxml: recognize 0x, 0o and 0b when setting default value
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Thu May 3 09:52:58 UTC 2018
Nice addition :)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
On 02/05/18 22:48, Caio Marcelo de Oliveira Filho wrote:
> Remove the need of converting values that are documented in
> hexadecimal. This patch would allow writing
>
> <field name="3D Command Sub Opcode" ... default="0x1B"/>
>
> instead of
>
> <field name="3D Command Sub Opcode" ... default="27"/>
> ---
> src/intel/genxml/gen_pack_header.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py
> index 8989f625d3..6a4c8033a7 100644
> --- a/src/intel/genxml/gen_pack_header.py
> +++ b/src/intel/genxml/gen_pack_header.py
> @@ -241,7 +241,8 @@ class Field(object):
> self.prefix = None
>
> if "default" in attrs:
> - self.default = int(attrs["default"])
> + # Base 0 recognizes 0x, 0o, 0b prefixes in addition to decimal ints.
> + self.default = int(attrs["default"], base=0)
> else:
> self.default = None
>
More information about the mesa-dev
mailing list