From: Jordan Justen Date: Thu, 17 Aug 2017 01:19:39 +0000 (-0700) Subject: intel/genxml: Handle field names with different spacing/hyphen X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=acce7d346027ae61f74eb3fa56679636eed5cb08;p=mesa.git intel/genxml: Handle field names with different spacing/hyphen If a field name differs slightly between two generations then this change will still add the fields into the same group. For example, these will be treated as equal: * "Software Exception" and "Software Exception" * "Per Thread" and "Per-Thread" Signed-off-by: Jordan Justen Reviewed-by: Kenneth Graunke Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/genxml/gen_bits_header.py b/src/intel/genxml/gen_bits_header.py index 8c87edb2e55..6dd0d7c6b75 100644 --- a/src/intel/genxml/gen_bits_header.py +++ b/src/intel/genxml/gen_bits_header.py @@ -182,12 +182,13 @@ class Container(object): self.length_by_gen[gen] = xml_attrs['length'] def get_field(self, field_name, create=False): - if field_name not in self.fields: + key = to_alphanum(field_name) + if key not in self.fields: if create: - self.fields[field_name] = Field(self, field_name) + self.fields[key] = Field(self, field_name) else: return None - return self.fields[field_name] + return self.fields[key] def has_prop(self, prop): if prop == 'length':