dev-amdgpu: Fix frame writes for <32-bit writes

In theory a packet between one and eight bytes can be written to frame
buffer memory from the driver. In gem5 pkt->getLE<utin32_t>() will
assert if the packet size is <32-bits. Change to pkt->getUintX(...) to
fix this issue.

Change-Id: If8554013e4ea7bac90985487991d0bf8bdc765ea
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58852
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Matthew Poremba
2022-04-14 16:17:39 -05:00
parent 29a39d9472
commit 8a53add7f8

View File

@@ -253,7 +253,7 @@ AMDGPUDevice::writeFrame(PacketPtr pkt, Addr offset)
Addr aperture_offset = offset - aperture;
// Record the value
frame_regs[offset] = pkt->getLE<uint32_t>();
frame_regs[offset] = pkt->getUintX(ByteOrder::little);
if (aperture == gpuvm.gartBase()) {
frame_regs[aperture_offset] = pkt->getLE<uint32_t>();
DPRINTF(AMDGPUDevice, "GART translation %p -> %p\n", aperture_offset,