radeonsi/compute: Share COMPUTE_DBG macro with r600g
authorTom Stellard <thomas.stellard@amd.com>
Fri, 18 Jul 2014 16:25:29 +0000 (12:25 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 21 Jul 2014 14:00:09 +0000 (10:00 -0400)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r600/evergreen_compute.h
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeonsi/si_compute.c

index e760790e63234720d11c1a2f0d04b4a00734fab4..4fb53a1cb907ac8cf5e4c63ea2da6f71f17c8148 100644 (file)
@@ -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
index 8f1a0a5944c53ae72bc77de0b0954db06db9a954..cee96222557c92665c3521ec5ea57292328588b1 100644 (file)
@@ -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)
 
index c0637f6f7ece7a950556cb03004812f8bc669ad1..3a9f00fd41d59caeb2af55eb4794d2ed0b83bfe5 100644 (file)
@@ -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,