aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/gpu_logging/freedreno_debug.cpp
diff options
context:
space:
mode:
authorMrPurple666 <antoniosacramento666usa@gmail.com>2026-02-01 02:02:23 +0100
committercrueter <crueter@eden-emu.dev>2026-02-01 02:02:23 +0100
commit6637810fe6c6610f73f0b1b12e56e9b48268d0ee (patch)
tree294b8dd7efc3df043b7502634ac14d6170c911eb /src/video_core/gpu_logging/freedreno_debug.cpp
parent8118557c17480d2eb5f1510de841f88cde13f2be (diff)
[android] gpu logs functions (#3389)
Since Android is a pain when it comes to checking GPU logs in more depth, this is a better way to see what's going on, especially for testers... This should be expanded to Mali, Xclipse, and Tensor in the future. Since I don't own any of these devices, it's up to developers with similar capabilities to add support for this system. ~~The GPU log sharing button should also be added in the future... For now, they are available in the same location as the traditional logs.~~ Added on 572810e022 Co-authored-by: DraVee <dravee@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3389 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: MrPurple666 <antoniosacramento666usa@gmail.com> Co-committed-by: MrPurple666 <antoniosacramento666usa@gmail.com>
Diffstat (limited to 'src/video_core/gpu_logging/freedreno_debug.cpp')
-rw-r--r--src/video_core/gpu_logging/freedreno_debug.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/video_core/gpu_logging/freedreno_debug.cpp b/src/video_core/gpu_logging/freedreno_debug.cpp
new file mode 100644
index 0000000000..14ffe04f78
--- /dev/null
+++ b/src/video_core/gpu_logging/freedreno_debug.cpp
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifdef ANDROID
+
+#include "video_core/gpu_logging/freedreno_debug.h"
+#include "common/logging/log.h"
+
+#include <cstdlib>
+
+namespace GPU::Logging::Freedreno {
+
+bool FreedrenoDebugger::is_initialized = false;
+
+void FreedrenoDebugger::Initialize() {
+ if (is_initialized) {
+ return;
+ }
+
+ is_initialized = true;
+ LOG_INFO(Render_Vulkan, "[Freedreno Debug] Initialized");
+}
+
+void FreedrenoDebugger::SetTUDebugFlags(const std::string& flags) {
+ if (flags.empty()) {
+ return;
+ }
+
+ // Set TU_DEBUG environment variable
+ // Note: This should be set BEFORE Vulkan driver is loaded
+ setenv("TU_DEBUG", flags.c_str(), 1);
+
+ LOG_INFO(Render_Vulkan, "[Freedreno Debug] TU_DEBUG set to: {}", flags);
+}
+
+void FreedrenoDebugger::EnableCommandStreamDump(bool frames_only) {
+ // Enable FD_RD_DUMP for command stream capture
+ const char* dump_flags = frames_only ? "frames" : "all";
+ setenv("FD_RD_DUMP", dump_flags, 1);
+
+ LOG_INFO(Render_Vulkan, "[Freedreno Debug] Command stream dump enabled: {}", dump_flags);
+}
+
+std::string FreedrenoDebugger::GetBreadcrumbs() {
+ // Breadcrumb reading requires driver-specific implementation
+ // This is a stub for future implementation
+ return "Breadcrumb capture not yet implemented";
+}
+
+} // namespace GPU::Logging::Freedreno
+
+#endif // ANDROID