Fix async compute completion interrupts

This commit is contained in:
nmzik
2026-09-14 10:56:35 +04:00
parent 29e9ea6344
commit d63fb62367
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -1292,6 +1292,7 @@ void CommandProcessor::WriteAtEndOfPipe(uint32_t cache_policy, uint32_t event_wr
break; break;
case 0x14: case 0x14:
case 0x28: case 0x28:
case 0x2f:
if (event_index == 0x00) { if (event_index == 0x00) {
write64(false); write64(false);
return; return;
@@ -1299,7 +1300,6 @@ void CommandProcessor::WriteAtEndOfPipe(uint32_t cache_policy, uint32_t event_wr
break; break;
case 0x2b: case 0x2b:
case 0x2d: case 0x2d:
case 0x2f:
case 0x30: case 0x30:
if (event_index == 0x00 && !with_interrupt) { if (event_index == 0x00 && !with_interrupt) {
write64(false); write64(false);
+19
View File
@@ -2663,6 +2663,25 @@ public:
interrupt_event.udata == &compute_interrupt_udata && interrupt_event.udata == &compute_interrupt_udata &&
compute_clock_label != 0; compute_clock_label != 0;
constexpr uint64_t compute_done_value = 0x1234567887654321ull;
uint64_t compute_done_label = 0;
auto compute_done_commands = make_interrupt_packet(
2, 2, &compute_done_label, compute_done_value, 0x678u);
compute_done_commands[1] = 0x62fu; // CS_DONE, shader-done index, no GCR action.
gpu.SubmitCompute(0x20, compute_done_commands);
gpu.Done();
finish_gpu();
interrupt_count = 0;
const auto compute_done_wait =
wait_for_interrupt(interrupt_event, interrupt_count);
Require("GpuCommandLane", "CS_DONE write-confirm interrupt",
compute_done_wait == 0 && interrupt_count == 1 &&
interrupt_event.ident == 0x20 && interrupt_event.data == 0x678u &&
interrupt_event.udata == &compute_interrupt_udata &&
compute_done_label == compute_done_value,
"CS_DONE lost its full 64-bit label write or write-confirm interrupt");
interrupt_count = 0; interrupt_count = 0;
const auto extra_interrupt_wait = const auto extra_interrupt_wait =
wait_for_interrupt(interrupt_event, interrupt_count); wait_for_interrupt(interrupt_event, interrupt_count);