Files
DroidDeck/tools/vkbridge/common/vkb_log.h
T
The412Banner ee0fb08268 Mali bridge (#517, by ASEbrahim) on the non-Adreno test branch
Squash of Droid-Deck/DroidDeck#517 (ASEbrahim/DroidDeck mali-bridge @ 6b823341): the Vulkan
bridge (tools/vkbridge) that runs the guest's Vulkan on the phone's own driver, with BC1-BC7,
clip/cull distance, vertex-divisor and depth-clip emulation and dma-heap memory sharing for Mali.
All of the bridge is ASEbrahim's work; squashed only to carry it on this test branch.

Combined with #570 on this branch, a device draws through exactly one path:
- Adreno: Turnip, unchanged (checked first; the bridge setting is ignored there).
- PowerVR / Xclipse with the system HAL and a render node: the system-Vulkan path (#570).
- Anything else with the Setup toggle on (Mali): the bridge.
2026-10-12 18:34:49 -04:00

25 lines
912 B
C

/* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef VKB_LOG_H
#define VKB_LOG_H
#include <stdarg.h>
#define VKB_LOG_ERROR 0
#define VKB_LOG_WARN 1
#define VKB_LOG_INFO 2
#define VKB_LOG_DEBUG 3
/* Each side provides the sink (client: stderr + optional file; server: logcat + file). */
void vkb_log(int level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
int vkb_log_level(void);
#define VKB_ERR(...) vkb_log(VKB_LOG_ERROR, __VA_ARGS__)
#define VKB_WARN(...) vkb_log(VKB_LOG_WARN, __VA_ARGS__)
#define VKB_INFO(...) vkb_log(VKB_LOG_INFO, __VA_ARGS__)
#define VKB_DBG(...) do { if (vkb_log_level() >= VKB_LOG_DEBUG) vkb_log(VKB_LOG_DEBUG, __VA_ARGS__); } while (0)
/* Logs a message only the first time this call site is reached. */
#define VKB_ONCE(level, ...) do { static int once_; if (!__atomic_exchange_n(&once_, 1, __ATOMIC_RELAXED)) vkb_log(level, __VA_ARGS__); } while (0)
#endif