sibradzic / upp

A tool for parsing, dumping and modifying data in Radeon PowerPlay tables
GNU General Public License v3.0
154 stars 24 forks source link

Error when trying to undump the pp_table #47

Open Faugus opened 4 months ago

Faugus commented 4 months ago

Arch Linux 6.9.9 RX 7800 XT upp v0.2.2

I'm getting this error when trying to undump the pp_table, even without changing anything in the text file:

CHKSUM: 0x20 (off by 0), CRC: 0xABA7F1E5
Looking into MasterDataTable at offset 0x0500
Invalid PowerPlayInfo offset, checking for $PS1P magic...
Found $PS1P at 0xF4810
OFFSET at 0xB4920
Looking into PowerPlayInfo at offset 0xF4920
Found 5424 bytes long PowerPlayInfo table v20.0 at offset 0xF4920
Saving PowerPlay table to vbios.pp_table
[faugus@archlinux rom-test]$ upp --pp-file=vbios.pp_table dump > vbios.pp_table.dump
[faugus@archlinux rom-test]$ upp --pp-file=vbios.pp_table undump -d vbios.pp_table.dump -w
ERROR: Invalid variable assignment 'overdrive_table/cap/0=1 (GFXCLK_LIMITS)'.  Assignment must be specified in <variable-path>=<value>  format. For example: /PowerTuneTable/TDP=75
[faugus@archlinux rom-test]$
sibradzic commented 4 months ago

H @Faugus, thanks for reporting. Looks like a regression after a https://github.com/sibradzic/upp/commit/16838afe3e6cc013a0e464cbdceb734ae258094e (cc @cfwen)

This needs to be fixed, in the mean time please use v0.2.0 as a workaround.

cfwen commented 2 months ago

This issue is caused by comments after value in dump file, for example

overdrive_table:
  revision: 131
  reserve:
    reserve 0: 0
    reserve 1: 0
    reserve 2: 0
  feature_count: 22
  setting_count: 41
  cap:
    cap 0: 1 (GFXCLK_LIMITS)
cfwen commented 2 months ago

I also find another issue when set a variable with negative value, for example

python3 -m upp.upp --pp-file=vbios.pp_table set /smc_pptable/SkuTable/FanAbnormalTempLimitOffset=-20

will fail due to incorrect type.

I fixed both issues in this MR