[PATCH v2 2/2] drm/etnaviv: fix power register offset on GC300

Doug Brown doug at schmorgal.com
Fri Sep 9 15:00:52 UTC 2022


Hi Lucas,

On 9/9/2022 1:48 AM, Lucas Stach wrote:

>> @@ -83,10 +83,15 @@ static void etnaviv_core_dump_registers(struct core_dump_iterator *iter,
>>   {
>>   	struct etnaviv_dump_registers *reg = iter->data;
>>   	unsigned int i;
>> +	u32 addr;
>>   
>>   	for (i = 0; i < ARRAY_SIZE(etnaviv_dump_registers); i++, reg++) {
>> -		reg->reg = cpu_to_le32(etnaviv_dump_registers[i]);
>> -		reg->value = cpu_to_le32(gpu_read(gpu, etnaviv_dump_registers[i]));
>> +		addr = etnaviv_dump_registers[i];
>> +		if (addr >= VIVS_PM_POWER_CONTROLS &&
>> +		    addr <= VIVS_PM_PULSE_EATER)
>> +			addr = gpu_fix_power_address(gpu, addr);
>> +		reg->reg = cpu_to_le32(addr);
> 
> As the dumpdecoder tool would then need to reverse this address offset,
> I think it would be preferable to keep writing the canonical (not fixed
> up) register address into the dump. That way only the kernel needs to
> know about this special offset on GC300.

Ahh, I had no idea about how it worked on that side of things. Makes
complete sense. Thanks for reviewing! Will submit V3 with this and
everything else you mentioned fixed.

Doug


More information about the dri-devel mailing list