[PATCH] tests/amdgpu: update bad length case

Prike Liang Prike.Liang at amd.com
Thu Aug 1 08:25:48 UTC 2024


In the bad length case, when the header length is bigger than packet
stream length then CPFW will pending on the stream data and raise a
CP halt error which requires do the pipe reset. As to the orignal case
of header length is smaller than PM4 stream length then the PM4 stream
data may will create a bad opcode error which only requires the queue
reset. So for testing the pipe reset need to update the header length
bigger than the PM4 stream data length.

Signed-off-by: Prike Liang <Prike.Liang at amd.com>
---
 lib/amdgpu/amd_ip_blocks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/amdgpu/amd_ip_blocks.c b/lib/amdgpu/amd_ip_blocks.c
index f675b97dd..edfd16e76 100644
--- a/lib/amdgpu/amd_ip_blocks.c
+++ b/lib/amdgpu/amd_ip_blocks.c
@@ -201,7 +201,7 @@ gfx_ring_bad_write_linear(const struct amdgpu_ip_funcs *func,
 	if (cmd_error == CMD_STREAM_EXEC_INVALID_OPCODE)
 		ring_context->pm4[i++] = PACKET3(0xf2, 2 +  ring_context->write_length);
 	else if (cmd_error == CMD_STREAM_EXEC_INVALID_PACKET_LENGTH)
-		ring_context->pm4[i++] = PACKET3(PACKET3_WRITE_DATA, (ring_context->write_length - 2));
+		ring_context->pm4[i++] = PACKET3(PACKET3_WRITE_DATA, (ring_context->write_length + 4));
 	else
 		ring_context->pm4[i++] = PACKET3(PACKET3_WRITE_DATA, 2 +  ring_context->write_length);
 
-- 
2.34.1



More information about the igt-dev mailing list