Matthew Poremba has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/57589 )
(
12 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: dev-amdgpu: Handle framebuffer reads from device cache
......................................................................
dev-amdgpu: Handle framebuffer reads from device cache
Reads to the frame buffer are currently handled by either the MMIO trace
or from the GART table if the address is in the GART aperture. In some
cases the MMIO trace will not contain the address or the data may have
been written previously and be different from the MMIO trace. To handle
this, return the data that was written previously by the driver. The
priority order from lowest to highest is: MMIO trace, device cache,
special framebuffer registers.
Change-Id: Ia45ae19555508fcd780926fedbd7a65c3d294727
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57589
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, 29 insertions(+), 1 deletion(-)
Approvals:
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 6714908..3c5b179 100644
--- a/src/dev/amdgpu/amdgpu_device.cc
+++ b/src/dev/amdgpu/amdgpu_device.cc
@@ -179,8 +179,14 @@
{
DPRINTF(AMDGPUDevice, "Read framebuffer address %#lx\n", offset);
+ /* Try MMIO trace for frame writes first. */
mmioReader.readFromTrace(pkt, FRAMEBUFFER_BAR, offset);
+ /* If the driver wrote something, use that value over the trace. */
+ if (frame_regs.find(offset) != frame_regs.end()) {
+ pkt->setUintX(frame_regs[offset], ByteOrder::little);
+ }
+
/* Handle special counter addresses in framebuffer. */
if (offset == 0xa28000) {
/* Counter addresses expect the read to return previous value + 1.
*/
@@ -247,8 +253,9 @@
Addr aperture_offset = offset - aperture;
// Record the value
- frame_regs[aperture_offset] = pkt->getLE<uint32_t>();
+ frame_regs[offset] = pkt->getLE<uint32_t>();
if (aperture == gpuvm.gartBase()) {
+ frame_regs[aperture_offset] = pkt->getLE<uint32_t>();
DPRINTF(AMDGPUDevice, "GART translation %p -> %p\n",
aperture_offset,
bits(frame_regs[aperture_offset], 48, 12));
gpuvm.gartTable[aperture_offset] = pkt->getLE<uint32_t>();
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/57589
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: Ia45ae19555508fcd780926fedbd7a65c3d294727
Gerrit-Change-Number: 57589
Gerrit-PatchSet: 18
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.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