drm: Use weston_log_scope_puts when we don't have a format string

We can use __VA_OPT__ to make a macro that automatically selects between
the puts and printf log scope variants.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2026-03-30 15:43:02 -05:00 committed by Pekka Paalanen
parent ec5a7ee8fe
commit 978052f9ed

View file

@ -117,8 +117,15 @@
* system. To avoid confusing side effects, we explicitly cast to the widest
* possible type and use a matching format specifier.
*/
#define drm_debug(b, ...) \
weston_log_scope_printf((b)->debug, __VA_ARGS__)
#define DO_DRM_DEBUG_COMPLEX(scope, ...) \
weston_log_scope_printf(scope, __VA_ARGS__)
#define DO_DRM_DEBUG(scope, string) \
weston_log_scope_puts(scope, string)
#define drm_debug(b, format, ...) \
DO_DRM_DEBUG ## __VA_OPT__(_COMPLEX) \
((b)->debug, format __VA_OPT__(,) __VA_ARGS__)
#define MAX_CLONED_CONNECTORS 4