From: Marek Olšák Date: Thu, 20 Aug 2020 08:03:13 +0000 (-0400) Subject: amd/registers: sort registers by offset in json X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2f23afe668ff7f83d2c31ba0115d47a4cb12565;p=mesa.git amd/registers: sort registers by offset in json Acked-by: Samuel Pitoiset Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/amd/registers/regdb.py b/src/amd/registers/regdb.py index fc9a0a2788e..0167365d7c8 100644 --- a/src/amd/registers/regdb.py +++ b/src/amd/registers/regdb.py @@ -213,7 +213,7 @@ class RegisterDatabase(object): Perform some basic canonicalization: - enum entries are sorted by value - register type fields are sorted by starting bit - - __register_mappings is sorted by name + - __register_mappings is sorted by offset - the chips field of register mappings is sorted Lazily computes the set of all chips mentioned by register mappings. @@ -230,10 +230,10 @@ class RegisterDatabase(object): self.__regmap_by_addr = defaultdict(list) self.__chips = set() - # Merge regiseter mappings using sort order and garbage collect enums + # Merge register mappings using sort order and garbage collect enums # and register types. old_register_mappings = self.__register_mappings - old_register_mappings.sort(key=lambda regmap: regmap.name) + old_register_mappings.sort(key=lambda regmap: regmap.map.at) self.__register_mappings = [] for regmap in old_register_mappings: