summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/lima/lima_util.c7
-rw-r--r--src/gallium/drivers/lima/lima_util.h10
2 files changed, 10 insertions, 7 deletions
diff --git a/src/gallium/drivers/lima/lima_util.c b/src/gallium/drivers/lima/lima_util.c
index 4ad88f5829a..dca9307c991 100644
--- a/src/gallium/drivers/lima/lima_util.c
+++ b/src/gallium/drivers/lima/lima_util.c
@@ -165,12 +165,9 @@ lima_dump_free(struct lima_dump *dump)
}
void
-lima_dump_command_stream_print(struct lima_dump *dump, void *data,
- int size, bool is_float, const char *fmt, ...)
+_lima_dump_command_stream_print(struct lima_dump *dump, void *data,
+ int size, bool is_float, const char *fmt, ...)
{
- if (!dump)
- return;
-
va_list ap;
va_start(ap, fmt);
vfprintf(dump->fp, fmt, ap);
diff --git a/src/gallium/drivers/lima/lima_util.h b/src/gallium/drivers/lima/lima_util.h
index 30c97d2f872..3749523f3a1 100644
--- a/src/gallium/drivers/lima/lima_util.h
+++ b/src/gallium/drivers/lima/lima_util.h
@@ -45,7 +45,13 @@ void lima_dump_rsw_command_stream_print(struct lima_dump *dump, void *data,
int size, uint32_t start);
void lima_dump_texture_descriptor(struct lima_dump *dump, void *data,
int size, uint32_t start, uint32_t offset);
-void lima_dump_command_stream_print(struct lima_dump *dump, void *data,
- int size, bool is_float, const char *fmt, ...);
+
+void _lima_dump_command_stream_print(struct lima_dump *dump, void *data,
+ int size, bool is_float, const char *fmt, ...);
+#define lima_dump_command_stream_print(dump, ...) \
+ do { \
+ if (dump) \
+ _lima_dump_command_stream_print(dump, __VA_ARGS__); \
+ } while (0)
#endif