diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-10-22 17:38:39 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-11-03 19:39:12 +0100 |
commit | 87abb9d8d87c8aff4ffff36cd93d2f213ae7d2d8 (patch) | |
tree | 80b50854456941d3d9f1b27199e0f6bf89c0eb4c | |
parent | cf817d3ac9c9a83551add568e7e0b33744942a18 (diff) |
radeonsi: move pipe debug callback to si_context
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_compute.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 6 |
6 files changed, 19 insertions, 19 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 856e8abc2d..2c7fce8bf2 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -588,17 +588,6 @@ static enum pipe_reset_status r600_get_reset_status(struct pipe_context *ctx) return PIPE_UNKNOWN_CONTEXT_RESET; } -static void r600_set_debug_callback(struct pipe_context *ctx, - const struct pipe_debug_callback *cb) -{ - struct r600_common_context *rctx = (struct r600_common_context *)ctx; - - if (cb) - rctx->debug = *cb; - else - memset(&rctx->debug, 0, sizeof(rctx->debug)); -} - static void r600_set_device_reset_callback(struct pipe_context *ctx, const struct pipe_device_reset_callback *cb) { @@ -693,7 +682,6 @@ bool si_common_context_init(struct r600_common_context *rctx, rctx->b.texture_subdata = u_default_texture_subdata; rctx->b.memory_barrier = r600_memory_barrier; rctx->b.flush = r600_flush_from_st; - rctx->b.set_debug_callback = r600_set_debug_callback; rctx->b.create_fence_fd = r600_create_fence_fd; rctx->b.fence_server_sync = r600_fence_server_sync; rctx->dma_clear_buffer = r600_dma_clear_buffer_fallback; diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 711594164c..9cf2ec1363 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -594,7 +594,6 @@ struct r600_common_context { bool query_active; } dcc_stats[5]; - struct pipe_debug_callback debug; struct pipe_device_reset_callback device_reset_callback; struct u_log_context *log; diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 942750b225..e55988af4c 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -168,12 +168,12 @@ static void *si_create_compute_state( } program->compiler_ctx_state.tm = sctx->tm; - program->compiler_ctx_state.debug = sctx->b.debug; + program->compiler_ctx_state.debug = sctx->debug; program->compiler_ctx_state.is_debug_context = sctx->is_debug; p_atomic_inc(&sscreen->b.num_shaders_created); util_queue_fence_init(&program->ready); - if ((sctx->b.debug.debug_message && !sctx->b.debug.async) || + if ((sctx->debug.debug_message && !sctx->debug.async) || sctx->is_debug || si_can_dump_shader(&sscreen->b, PIPE_SHADER_COMPUTE)) si_create_compute_state_async(program, -1); @@ -196,7 +196,7 @@ static void *si_create_compute_state( si_shader_binary_read_config(&program->shader.binary, &program->shader.config, 0); } - si_shader_dump(sctx->screen, &program->shader, &sctx->b.debug, + si_shader_dump(sctx->screen, &program->shader, &sctx->debug, PIPE_SHADER_COMPUTE, stderr, true); if (si_shader_binary_upload(sctx->screen, &program->shader) < 0) { fprintf(stderr, "LLVM failed to upload shader\n"); diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 875aff655d..df4c92a79f 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -162,6 +162,17 @@ si_create_llvm_target_machine(struct si_screen *sscreen) LLVMCodeModelDefault); } +static void si_set_debug_callback(struct pipe_context *ctx, + const struct pipe_debug_callback *cb) +{ + struct si_context *sctx = (struct si_context *)ctx; + + if (cb) + sctx->debug = *cb; + else + memset(&sctx->debug, 0, sizeof(sctx->debug)); +} + static void si_set_log_context(struct pipe_context *ctx, struct u_log_context *log) { @@ -190,6 +201,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, sctx->b.b.priv = NULL; sctx->b.b.destroy = si_destroy_context; sctx->b.b.emit_string_marker = si_emit_string_marker; + sctx->b.b.set_debug_callback = si_set_debug_callback; sctx->b.b.set_log_context = si_set_log_context; sctx->b.set_atom_dirty = (void *)si_set_atom_dirty; sctx->screen = sscreen; /* Easy accessing of screen/winsys. */ diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index ab82064571..8e10e89a5c 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -360,6 +360,7 @@ struct si_context { void *vs_blit_color_layered; void *vs_blit_texcoord; struct si_screen *screen; + struct pipe_debug_callback debug; LLVMTargetMachineRef tm; /* only non-threaded compilation */ struct si_shader_ctx_state fixed_func_tcs_shader; struct r600_resource *wait_mem_scratch; diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 75b1648748..757e889c3b 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -2043,7 +2043,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx, pipe_reference_init(&sel->reference, 1); sel->screen = sscreen; sel->compiler_ctx_state.tm = sctx->tm; - sel->compiler_ctx_state.debug = sctx->b.debug; + sel->compiler_ctx_state.debug = sctx->debug; sel->compiler_ctx_state.is_debug_context = sctx->is_debug; sel->so = state->stream_output; @@ -2272,7 +2272,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx, (void) mtx_init(&sel->mutex, mtx_plain); util_queue_fence_init(&sel->ready); - if ((sctx->b.debug.debug_message && !sctx->b.debug.async) || + if ((sctx->debug.debug_message && !sctx->debug.async) || sctx->is_debug || si_can_dump_shader(&sscreen->b, sel->info.processor)) si_init_shader_selector_async(sel, -1); @@ -3237,7 +3237,7 @@ bool si_update_shaders(struct si_context *sctx) int r; compiler_state.tm = sctx->tm; - compiler_state.debug = sctx->b.debug; + compiler_state.debug = sctx->debug; compiler_state.is_debug_context = sctx->is_debug; /* Update stages before GS. */ |