Matthew Poremba has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/65094?usp=email )
Change subject: dev-amdgpu: Rework PM4 NOP packet
......................................................................
dev-amdgpu: Rework PM4 NOP packet
The PM4 NOP header is used to insert spaces in the PM4 ring and can
therefore be any size. This includes zero. A size of zero is denoted by
a value of 0x3fff in the NOP packet header. Currently we assume this
means the remainder of the PM4 queue up to the wptr is empty/NOPs. This
is not always true.
This changeset reworks the PM4 NOP packet to handle the value of 0x3fff
as a special value and advances the rptr by 0 bytes. This fixes issues
where there were additional packets in the queue which were being
skipped over by fast forwarding. Since those packets could be anything,
that leads to undefined behavior afterwards.
Change-Id: I3f5c3f4b7dd50f93ba503fea97454a9d41771e30
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65094
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
---
M src/dev/amdgpu/pm4_packet_processor.cc
1 file changed, 26 insertions(+), 3 deletions(-)
Approvals:
Matt Sinclair: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/dev/amdgpu/pm4_packet_processor.cc
b/src/dev/amdgpu/pm4_packet_processor.cc
index 67c150a..48496f6 100644
--- a/src/dev/amdgpu/pm4_packet_processor.cc
+++ b/src/dev/amdgpu/pm4_packet_processor.cc
@@ -202,9 +202,7 @@
case IT_NOP: {
DPRINTF(PM4PacketProcessor, "PM4 nop, count %p\n", header.count);
DPRINTF(PM4PacketProcessor, "rptr %p wptr %p\n", q->rptr(),
q->wptr());
- if (header.count == 0x3fff) {
- q->fastforwardRptr();
- } else {
+ if (header.count != 0x3fff) {
q->incRptr((header.count + 1) * sizeof(uint32_t));
}
decodeNext(q);
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/65094?usp=email
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: I3f5c3f4b7dd50f93ba503fea97454a9d41771e30
Gerrit-Change-Number: 65094
Gerrit-PatchSet: 3
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Alexandru Duțu (Alex) <alexandru.d...@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