[Mesa-dev] [PATCH 4/4] ac/debug: take ASIC generation into account when printing registers
Nicolai Hähnle
nhaehnle at gmail.com
Tue Sep 5 06:51:50 UTC 2017
On 05.09.2017 01:05, Marek Olšák wrote:
> gfx9d.h contains almost no named values. Does it obtain named values
> from sid.h when the same field is also present in gfx9d.h?
Yes, the following snippet does that:
>> + # Copy values for corresponding fields from older ASICs if they were
>> + # not redefined
>> + for reg in self.registers:
>> + old_reg = False
>> + for field in reg.fields:
>> + if len(field.values) > 0:
>> + continue
>> + if old_reg is False:
>> + for old_reg in itertools.chain(
>> + *(asic.registers for asic in reversed(older_asics))):
>> + if old_reg.name == reg.name:
>> + break
>> + else:
>> + old_reg = None
>> + if old_reg is not None:
>> + for old_field in old_reg.fields:
>> + if old_field.name == field.name:
>> + field.values = old_field.values
>> + break
Cheers,
Nicolai
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list