From 046cf5041235cbd413ca9d0ada28ffcdd0651cb3 Mon Sep 17 00:00:00 2001 From: mailwl Date: Mon, 9 Jun 2025 11:27:37 +0300 Subject: [PATCH] PM4 type 2 in acb (#3047) * Stub PM4 type 0 * fix command size * revert command size to actual * return unreachable for PM4t0 * remove skipping command body --- src/video_core/amdgpu/liverpool.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index e031d0ebc..464f02e3a 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -228,9 +228,12 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::spantype; switch (type) { + default: + UNREACHABLE_MSG("Wrong PM4 type {}", type); + break; case 0: - case 1: - UNREACHABLE_MSG("Unsupported PM4 type {}", type); + UNREACHABLE_MSG("Unimplemented PM4 type 0, base reg: {}, size: {}", + header->type0.base.Value(), header->type0.NumWords()); break; case 2: // Type-2 packet are used for padding purposes @@ -826,6 +829,19 @@ Liverpool::Task Liverpool::ProcessCompute(const u32* acb, u32 acb_dwords, u32 vq break; } + if (header->type == 2) { + // Type-2 packet are used for padding purposes + next_dw_off = 1; + acb += next_dw_off; + acb_dwords -= next_dw_off; + + if constexpr (!is_indirect) { + *queue.read_addr += next_dw_off; + *queue.read_addr %= queue.ring_size_dw; + } + continue; + } + if (header->type != 3) { // No other types of packets were spotted so far UNREACHABLE_MSG("Invalid PM4 type {}", header->type.Value());