[Mesa-dev] [PATCH] radeonsi/compute: Share COMPUTE_DBG macro with r600g
Tom Stellard
thomas.stellard at amd.com
Fri Jul 18 12:14:16 PDT 2014
---
src/gallium/drivers/r600/evergreen_compute.h | 13 -------------
src/gallium/drivers/radeon/r600_pipe_common.h | 5 +++++
src/gallium/drivers/radeonsi/si_compute.c | 5 +++++
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/src/gallium/drivers/r600/evergreen_compute.h b/src/gallium/drivers/r600/evergreen_compute.h
index e760790..4fb53a1 100644
--- a/src/gallium/drivers/r600/evergreen_compute.h
+++ b/src/gallium/drivers/r600/evergreen_compute.h
@@ -59,17 +59,4 @@ void r600_compute_global_transfer_flush_region( struct pipe_context *, struct pi
void r600_compute_global_transfer_inline_write( struct pipe_context *, struct pipe_resource *, unsigned level,
unsigned usage, const struct pipe_box *, const void *data, unsigned stride, unsigned layer_stride);
-
-static inline void COMPUTE_DBG(struct r600_screen *rscreen, const char *fmt, ...)
-{
- if (!(rscreen->b.debug_flags & DBG_COMPUTE)) {
- return;
- }
-
- va_list ap;
- va_start(ap, fmt);
- _debug_vprintf(fmt, ap);
- va_end(ap);
-}
-
#endif
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 8f1a0a5..cee9622 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -515,6 +515,11 @@ static inline unsigned r600_tex_aniso_filter(unsigned filter)
/* else */ return 4;
}
+#define COMPUTE_DBG(rscreen, fmt, args...) \
+ do { \
+ if ((rscreen->b.debug_flags & DBG_COMPUTE)) fprintf(stderr, fmt, ##args); \
+ } while (0);
+
#define R600_ERR(fmt, args...) \
fprintf(stderr, "EE %s:%d %s - "fmt, __FILE__, __LINE__, __func__, ##args)
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index c0637f6..3a9f00f 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -163,6 +163,11 @@ static void si_launch_grid(
memcpy(kernel_args + (num_work_size_bytes / 4), input, program->input_size);
+ for (i = 0; i < (kernel_args_size / 4); i++) {
+ COMPUTE_DBG(sctx->screen, "input %u : %u\n", i,
+ kernel_args[i]);
+ }
+
si_upload_const_buffer(sctx, &kernel_args_buffer, (uint8_t*)kernel_args,
kernel_args_size, &kernel_args_offset);
kernel_args_va = r600_resource_va(ctx->screen,
--
1.8.1.5
More information about the mesa-dev
mailing list