From a20fb7f9f894f199fd678301356af1bbe030885e Mon Sep 17 00:00:00 2001 From: Mac Date: Wed, 23 Sep 2026 01:25:36 +0530 Subject: [PATCH] agc: trace per-frame packet parameters only with graphics debug dump The per-frame ACB submit, indirect dispatch, reset-queue and patch-address parameter dumps, and the flip-pending poll, are logged only with the graphics debug dump, the way the DCB submit path already is. Otherwise they were about 7.5 MB of log a minute in the Spider-Man world. --- src/graphics/presentation/videoOut.cpp | 4 +- src/libs/agc.cpp | 60 +++++++++++++------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/graphics/presentation/videoOut.cpp b/src/graphics/presentation/videoOut.cpp index 4d653af74..41ce05429 100644 --- a/src/graphics/presentation/videoOut.cpp +++ b/src/graphics/presentation/videoOut.cpp @@ -1556,7 +1556,9 @@ KYTY_SYSV_ABI int VideoOutIsFlipPending(int handle) { VideoOutFlipStatus status {}; DriverState().GetFlipQueue().GetFlipStatus(*ctx, status); - LOGF("\t flipPendingNum = %d\n", status.flipPendingNum); + if (Config::GraphicsDebugDumpEnabled()) { + LOGF("\t flipPendingNum = %d\n", status.flipPendingNum); + } return status.flipPendingNum; } diff --git a/src/libs/agc.cpp b/src/libs/agc.cpp index 531523d36..8c4ba62dd 100644 --- a/src/libs/agc.cpp +++ b/src/libs/agc.cpp @@ -2110,7 +2110,7 @@ uint32_t KYTY_SYSV_ABI AgcCbQueueEndOfPipeActionGetSize() { uint32_t* KYTY_SYSV_ABI AgcAcbResetQueue(CommandBuffer* buf, uint32_t op) { PRINT_NAME(); - LOGF("\t op = 0x%08" PRIx32 "\n", op); + AgcTrace("\t op = 0x%08" PRIx32 "\n", op); EXIT_NOT_IMPLEMENTED(buf == nullptr); EXIT_NOT_IMPLEMENTED((op & ~0x1c2u) != 0); @@ -2130,9 +2130,9 @@ uint32_t* KYTY_SYSV_ABI AgcAcbResetQueue(CommandBuffer* buf, uint32_t op) { uint32_t* KYTY_SYSV_ABI AgcDcbResetQueue(CommandBuffer* buf, uint32_t op, uint32_t state) { PRINT_NAME(); - LOGF("\t op = 0x%08" PRIx32 "\n" - "\t state = 0x%08" PRIx32 "\n", - op, state); + AgcTrace("\t op = 0x%08" PRIx32 "\n" + "\t state = 0x%08" PRIx32 "\n", + op, state); EXIT_NOT_IMPLEMENTED(buf == nullptr); EXIT_NOT_IMPLEMENTED((op & ~0xfffu) != 0); @@ -2749,9 +2749,9 @@ uint32_t* KYTY_SYSV_ABI AgcDcbSetBaseIndirectArgs(CommandBuffer* buf, uint32_t s const volatile void* indirect_base_addr) { PRINT_NAME(); - LOGF("\t shader_type = %" PRIu32 "\n" - "\t indirect_base_addr = 0x%016" PRIx64 "\n", - shader_type, reinterpret_cast(indirect_base_addr)); + AgcTrace("\t shader_type = %" PRIu32 "\n" + "\t indirect_base_addr = 0x%016" PRIx64 "\n", + shader_type, reinterpret_cast(indirect_base_addr)); EXIT_NOT_IMPLEMENTED(buf == nullptr); @@ -2941,9 +2941,9 @@ uint32_t* KYTY_SYSV_ABI AgcDcbDispatchIndirect(CommandBuffer* buf, uint32_t data uint32_t flags) { PRINT_NAME(); - LOGF("\t data_offset = 0x%" PRIx32 "\n" - "\t flags = 0x%08" PRIx32 "\n", - data_offset_in_bytes, flags); + AgcTrace("\t data_offset = 0x%" PRIx32 "\n" + "\t flags = 0x%08" PRIx32 "\n", + data_offset_in_bytes, flags); EXIT_NOT_IMPLEMENTED(buf == nullptr); @@ -3294,9 +3294,9 @@ uint32_t* KYTY_SYSV_ABI AgcAcbDispatchIndirect(CommandBuffer* buf, uint32_t modifier) { PRINT_NAME(); - LOGF("\t indirect_args = 0x%016" PRIx64 "\n" - "\t modifier = 0x%08" PRIx32 "\n", - reinterpret_cast(indirect_args), modifier); + AgcTrace("\t indirect_args = 0x%016" PRIx64 "\n" + "\t modifier = 0x%08" PRIx32 "\n", + reinterpret_cast(indirect_args), modifier); if (buf == nullptr) { return nullptr; @@ -3724,9 +3724,9 @@ int KYTY_SYSV_ABI AgcCondExecPatchSetCommandAddress(uint32_t* cmd const volatile uint32_t* command) { PRINT_NAME(); - LOGF("\t cmd = 0x%016" PRIx64 "\n" - "\t command = 0x%016" PRIx64 "\n", - reinterpret_cast(cmd), reinterpret_cast(command)); + AgcTrace("\t cmd = 0x%016" PRIx64 "\n" + "\t command = 0x%016" PRIx64 "\n", + reinterpret_cast(cmd), reinterpret_cast(command)); if (cmd == nullptr || command == nullptr) { return GRAPHICS5_ERROR_INVALID_PACKET; @@ -3868,9 +3868,9 @@ static uint32_t* get_agc_wait_packet(uint32_t* cmd) { int KYTY_SYSV_ABI AgcWaitRegMemPatchAddress(uint32_t* cmd, const volatile void* address) { PRINT_NAME(); - LOGF("\t cmd = 0x%016" PRIx64 "\n" - "\t address = 0x%016" PRIx64 "\n", - reinterpret_cast(cmd), reinterpret_cast(address)); + AgcTrace("\t cmd = 0x%016" PRIx64 "\n" + "\t address = 0x%016" PRIx64 "\n", + reinterpret_cast(cmd), reinterpret_cast(address)); auto* wait = get_agc_wait_packet(cmd); if (wait == nullptr) { @@ -3913,9 +3913,9 @@ int KYTY_SYSV_ABI AgcQueueEndOfPipeActionPatchAddress(uint32_t* cmd, // Not sure - LOGF("\t cmd = 0x%016" PRIx64 "\n" - "\t address = 0x%016" PRIx64 "\n", - reinterpret_cast(cmd), reinterpret_cast(address)); + AgcTrace("\t cmd = 0x%016" PRIx64 "\n" + "\t address = 0x%016" PRIx64 "\n", + reinterpret_cast(cmd), reinterpret_cast(address)); EXIT_NOT_IMPLEMENTED(cmd == nullptr); @@ -4246,7 +4246,7 @@ static void submit_acb(uint32_t queue, uint32_t* acb, uint32_t size_in_dwords) { } for (uint32_t i = 0; i < std::min(size_in_dwords, 8); i++) { - LOGF("\t acb[%u] = 0x%08" PRIx32 "\n", i, acb[i]); + AgcTrace("\t acb[%u] = 0x%08" PRIx32 "\n", i, acb[i]); } GraphicsDbgDumpDcb("a", size_in_dwords, acb); @@ -4322,17 +4322,17 @@ int KYTY_SYSV_ABI AgcDriverSubmitMultiCommandBuffers(void* queue_cont int KYTY_SYSV_ABI AgcDriverSubmitAcb(uint32_t queue, const Packet* packet) { PRINT_NAME(); - LOGF("\t queue = 0x%08" PRIx32 "\n" - "\t packet = 0x%016" PRIx64 "\n", - queue, reinterpret_cast(packet)); + AgcTrace("\t queue = 0x%08" PRIx32 "\n" + "\t packet = 0x%016" PRIx64 "\n", + queue, reinterpret_cast(packet)); if (packet == nullptr) { return OK; } - LOGF("\t acb = 0x%016" PRIx64 "\n" - "\t size = 0x%08" PRIx32 "\n" - "\t flags = 0x%02" PRIx8 "\n", - reinterpret_cast(packet->addr), packet->dw_num, packet->flags); + AgcTrace("\t acb = 0x%016" PRIx64 "\n" + "\t size = 0x%08" PRIx32 "\n" + "\t flags = 0x%02" PRIx8 "\n", + reinterpret_cast(packet->addr), packet->dw_num, packet->flags); submit_acb(queue, packet->addr, packet->dw_num); return OK;