nvk: Add a generic event_report_semaphore path

and use it for the 2D engine.
This commit is contained in:
Mel Henning 2025-11-25 18:17:24 -05:00
parent 212b9dcd38
commit 268ef76470

View file

@ -189,8 +189,7 @@ nvk_event_report_semaphore(struct nvk_cmd_buffer *cmd,
.operation = OPERATION_RELEASE,
.structure_size = STRUCTURE_SIZE_ONE_WORD,
});
} else {
assert(subc == SUBC_NV90B5);
} else if (subc == SUBC_NV90B5) {
struct nv_push *p = nvk_cmd_buffer_push(cmd, 6);
P_MTHD(p, NV90B5, SET_SEMAPHORE_A);
@ -204,6 +203,22 @@ nvk_event_report_semaphore(struct nvk_cmd_buffer *cmd,
.flush_enable = FLUSH_ENABLE_TRUE,
/* Note: FLUSH_TYPE=SYS implicitly for NVC3B5+ */
});
} else {
/* This should work for any engine. This assert is here as a reminder
* to check for an engine-specific version, since those will typically
* have perf benefits.
*/
assert(subc == SUBC_NV902D);
struct nv_push *p = nvk_cmd_buffer_push(cmd, 5);
__push_mthd(p, nvk_cmd_buffer_last_subchannel(cmd), NV906F_SEMAPHOREA);
P_NV906F_SEMAPHOREA(p, addr >> 32);
P_NV906F_SEMAPHOREB(p, (addr & UINT32_MAX) >> 2);
P_NV906F_SEMAPHOREC(p, value);
P_NV906F_SEMAPHORED(p, {
.operation = OPERATION_RELEASE,
.release_wfi = RELEASE_WFI_EN,
.release_size = RELEASE_SIZE_4BYTE,
});
}
}