Merge pull request #443 from oneandonlydean/fix/agc-write-data-pfp

fix(agc): accept WRITE_DATA with ENGINE_SEL = PFP
This commit is contained in:
Dean
2026-10-04 11:32:58 +13:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
@@ -380,7 +380,7 @@ void Validate(std::span<const std::uint32_t> packet, std::uint32_t queue) {
break;
case 0x37: {
require(packet.size() >= 5, "WRITE_DATA has no data");
require((packet[1] & ~0x00110f00u) == 0, "WRITE_DATA engine, cache or reserved fields are not implemented");
require((packet[1] & ~0x40110f00u) == 0, "WRITE_DATA engine, cache or reserved fields are not implemented");
const auto destination = (packet[1] >> 8u) & 0xfu;
require(destination == 1 || destination == 2 || (queue != 0 && destination == 5), "WRITE_DATA register or GDS destination is not implemented");
require((packet[2] & 3u) == 0, "misaligned WRITE_DATA destination");
@@ -288,6 +288,9 @@ void testMemory() {
check(data[0] == 11 && data[1] == 12, "WRITE_DATA increment failed");
execute(state, makePacket(0x37, {0x10100, low(data.data()), high(data.data()), 21, 22}));
check(data[0] == 22 && data[1] == 12, "WRITE_DATA fixed destination failed");
execute(state, makePacket(0x37, {0x40000100, low(data.data()), high(data.data()), 41, 42}));
check(data[0] == 41 && data[1] == 42, "WRITE_DATA from the PFP failed");
expectFailure([&] { AgcDriver::Pm4::Validate(makePacket(0x37, {0x80000100, low(data.data()), high(data.data()), 51}), 0); }, "engine");
execute(state, makePacket(0x81, {4, 31, 32}));
execute(state, makePacket(0x83, {4, 2, low(data.data()), high(data.data())}));
check(data[0] == 31 && data[1] == 32, "constant RAM round trip failed");