mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
cs selftest: fill SDMA with a value that repeats one byte
On the R9700 the self-test failed at sdma_result with the fill reading 0xedededed where it expected 0x5eed5eed: the GPU did what it was told. Upstream's emit_fill_buffer for SDMA 5.2, 6 and 7 is a CONSTANT_FILL with FILLSIZE 0, which writes the value's low byte to every byte; upstream only ever fills with 0, where byte and dword fills agree. A render-node probe on the R9700 (SDMA 7.0) confirmed it in GTT and in VRAM: FILLSIZE 0 with 0x5eed5eed writes 0xed bytes, FILLSIZE 2 (as Mesa emits) writes the dword, and the copy back is exact. Fences, placement, caching and readback were all correct. The self-test now fills with 0x5e5e5e5e, which reads the same under either fill size. The CS fixture's software SDMA fills bytes from the value's low byte as these generations do, so the old expectation now fails offline the same way it failed on the GPU (fill 0xedededed).
This commit is contained in:
1 parent
84b40028d2
commit
0c7a3b67d0
4 files changed
+16
-5
No files matched your search
@@ -44,7 +44,11 @@
|
||||
|
||||
#define ST_COMPUTE_GTT_VALUE 0xc0de0001u
|
||||
#define ST_COMPUTE_VRAM_VALUE 0xc0de0002u
|
||||
#define ST_FILL_VALUE 0x5eed5eedu
|
||||
/* Upstream's SDMA 5.2, 6 and 7 emit_fill_buffer is a CONSTANT_FILL with
|
||||
* FILLSIZE 0: it writes the value's low byte to every byte (upstream only
|
||||
* ever clears with 0). The fill value repeats one byte, so the check holds
|
||||
* on every generation, whichever fill size its packet uses. */
|
||||
#define ST_FILL_VALUE 0x5e5e5e5eu
|
||||
|
||||
enum { BO_DATA, BO_IB, BO_FENCE, BO_VRAM, BO_COUNT };
|
||||
|
||||
|
||||
@@ -539,11 +539,18 @@ static uint64_t sdma_packet(struct engine *e, const uint32_t *dw, uint64_t avail
|
||||
break;
|
||||
}
|
||||
case FX_SDMA_FILL: {
|
||||
/* As SDMA 5.2-7's CONSTANT_FILL with FILLSIZE 0 (what their
|
||||
* emit_fill_buffer emits): the value's low byte, per byte. */
|
||||
uint64_t dst = ((uint64_t)dw[2] << 32) | dw[1];
|
||||
uint8_t pattern[256];
|
||||
|
||||
STAT(fills);
|
||||
for (uint32_t off = 0; off < dw[4]; off += 4)
|
||||
gpu_access(e, vmid, dst + off, (void *)(uintptr_t)&dw[3], 4, true);
|
||||
memset(pattern, dw[3] & 0xff, sizeof(pattern));
|
||||
for (uint32_t off = 0; off < dw[4]; off += sizeof(pattern)) {
|
||||
uint32_t n = dw[4] - off < sizeof(pattern) ? dw[4] - off : sizeof(pattern);
|
||||
|
||||
gpu_access(e, vmid, dst + off, pattern, n, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FX_SDMA_VM_FLUSH:
|
||||
|
||||
@@ -55,7 +55,7 @@ int main(void)
|
||||
CHECK(res.family == 152 /* AMDGPU_FAMILY_GC_12_0_0 */ && res.device_id == 0x7551);
|
||||
CHECK(res.compute_rings == 1 && res.sdma_rings == 1);
|
||||
CHECK(res.compute_value == 0xc0de0001u && res.vram_value == 0xc0de0002u &&
|
||||
res.fill_value == 0x5eed5eedu && res.user_fence == (uint32_t)res.compute_seq);
|
||||
res.fill_value == 0x5e5e5e5eu && res.user_fence == (uint32_t)res.compute_seq);
|
||||
/* The VRAM buffer went to GTT through TTM (a GART window) and
|
||||
* its copy from there still holds what it held. */
|
||||
CHECK(res.version == 2 && res.steps == RT_CS_STEP_COUNT);
|
||||
|
||||
@@ -14,7 +14,7 @@ spec.loader.exec_module(tool)
|
||||
assert tool.LAYOUT.size == 240 and len(tool.STEPS) == 20 and len(tool.FIELDS) == 22
|
||||
assert tool.LAYOUT_V1.size == 200 and len(tool.STEPS_V1) == 18 and len(tool.FIELDS_V1) == 16
|
||||
COMMON = (152, 0x40, 0x7551, 4, 1, 3, 0x400000, 0xc00000, 7, 9, 1_500_000, 2_000_000,
|
||||
0xc0de0001, 0xc0de0002, 0x5eed5eed, 7)
|
||||
0xc0de0001, 0xc0de0002, 0x5e5e5e5e, 7)
|
||||
|
||||
|
||||
def blob(status, failed, passed, version=2, steps=20):
|
||||
|
||||
Reference in new issue
Block a user