From: Tom Stellard Date: Fri, 18 Jul 2014 16:25:29 +0000 (-0400) Subject: radeonsi/compute: Share COMPUTE_DBG macro with r600g X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=245e86168a758e35a78077f90cbb4a8cfca0909f;p=mesa.git radeonsi/compute: Share COMPUTE_DBG macro with r600g Reviewed-by: Marek Olšák --- diff --git a/src/gallium/drivers/r600/evergreen_compute.h b/src/gallium/drivers/r600/evergreen_compute.h index e760790e632..4fb53a1cb90 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 8f1a0a5944c..cee96222557 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 c0637f6f7ec..3a9f00fd41d 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,