Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/58852 )

Change subject: dev-amdgpu: Fix frame writes for <32-bit writes
......................................................................

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...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/dev/amdgpu/amdgpu_device.cc
1 file changed, 21 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/dev/amdgpu/amdgpu_device.cc b/src/dev/amdgpu/amdgpu_device.cc
index 3c5b179..132a81a 100644
--- a/src/dev/amdgpu/amdgpu_device.cc
+++ b/src/dev/amdgpu/amdgpu_device.cc
@@ -253,7 +253,7 @@
     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,

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58852
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If8554013e4ea7bac90985487991d0bf8bdc765ea
Gerrit-Change-Number: 58852
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to