Skip to content

Commit 690a26f

Browse files
committed
cffdec: Fix decode on pixel 2 blob's COMPUTE_CHECKPOINT.
dEQP-GLES31.functional.image_load_store.buffer.image_size.writeonly_7 produces: t7 opcode: CP_COMPUTE_CHECKPOINT (6e) (8 dwords) { ADDR_0_LO = 0x15000 } { ADDR_0_HI = 0x5 } 0x18 { ADDR_1_LEN = 3 } 0xf { ADDR_1_LO = 0x2e010 } { ADDR_1_HI = 0x5 } and it was asserting due to sizedwords==7. Without the assert, we were dereffing a len past the end of the packet. This len value we were loading is also suspiciously not the location of the ADDR_1_LEN field in the packet's XML. But then, the command stream at ADDR_1 was clearly 0xf long, and that puts ADDR_1_LEN at the spot we would expect compared to SET_RENDER_MODE's ADDR_1.
1 parent 51d4176 commit 690a26f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cffdump/cffdec.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2289,11 +2289,11 @@ cp_compute_checkpoint(uint32_t *dwords, uint32_t sizedwords, int level)
22892289
assert(is_64b());
22902290
assert(options->gpu_id >= 500);
22912291

2292-
assert(sizedwords == 8);
2292+
assert(sizedwords == 7 || sizedwords == 8);
22932293

22942294
addr = dwords[5];
22952295
addr |= ((uint64_t)dwords[6]) << 32;
2296-
len = dwords[7];
2296+
len = dwords[4];
22972297

22982298
printl(3, "%saddr: 0x%016lx\n", levels[level], addr);
22992299
printl(3, "%slen: 0x%x\n", levels[level], len);

rnndb/adreno/adreno_pm4.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1276,10 +1276,10 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords)
12761276
<reg32 offset="2" name="2">
12771277
</reg32>
12781278
<!-- second buffer looks like some cmdstream.. length in dwords: -->
1279-
<reg32 offset="3" name="3">
1279+
<reg32 offset="3" name="3"/>
1280+
<reg32 offset="4" name="4">
12801281
<bitfield name="ADDR_1_LEN" low="0" high="31" type="uint"/>
12811282
</reg32>
1282-
<reg32 offset="4" name="4"/>
12831283
<reg32 offset="5" name="5">
12841284
<bitfield name="ADDR_1_LO" low="0" high="31"/>
12851285
</reg32>

0 commit comments

Comments
 (0)