From 9252638afa675b8fabfe2b8d3f4d48506cf955dd Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Mon, 15 May 2017 23:06:08 +0200 Subject: radeonsi: make emit_waitcnt externally accessible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_shader.c | 15 +++++---------- src/gallium/drivers/radeonsi/si_shader_internal.h | 7 +++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 837cc1cfb7..39ce0804e4 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -3407,12 +3407,7 @@ static void emit_optimization_barrier(struct si_shader_context *ctx, } } -/* Combine these with & instead of |. */ -#define NOOP_WAITCNT 0xf7f -#define LGKM_CNT 0x07f -#define VM_CNT 0xf70 - -static void emit_waitcnt(struct si_shader_context *ctx, unsigned simm16) +void si_emit_waitcnt(struct si_shader_context *ctx, unsigned simm16) { struct gallivm_state *gallivm = &ctx->gallivm; LLVMBuilderRef builder = gallivm->builder; @@ -3445,7 +3440,7 @@ static void membar_emit( waitcnt &= LGKM_CNT; if (waitcnt != NOOP_WAITCNT) - emit_waitcnt(ctx, waitcnt); + si_emit_waitcnt(ctx, waitcnt); } static void clock_emit( @@ -3955,7 +3950,7 @@ static void load_emit( } if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE) - emit_waitcnt(ctx, VM_CNT); + si_emit_waitcnt(ctx, VM_CNT); readonly_memory = !(inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE) && is_oneway_access_only(inst, info, @@ -4172,7 +4167,7 @@ static void store_emit( } if (inst->Memory.Qualifier & TGSI_MEMORY_VOLATILE) - emit_waitcnt(ctx, VM_CNT); + si_emit_waitcnt(ctx, VM_CNT); writeonly_memory = is_oneway_access_only(inst, info, info->shader_buffers_load | @@ -5689,7 +5684,7 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action, */ if (ctx->screen->b.chip_class == SI && ctx->type == PIPE_SHADER_TESS_CTRL) { - emit_waitcnt(ctx, LGKM_CNT & VM_CNT); + si_emit_waitcnt(ctx, LGKM_CNT & VM_CNT); return; } diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index 35315caac6..c3913dead3 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -287,6 +287,13 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base, const struct tgsi_opcode_info *info, LLVMValueRef dst[4]); +/* Combine these with & instead of |. */ +#define NOOP_WAITCNT 0xf7f +#define LGKM_CNT 0x07f +#define VM_CNT 0xf70 + +void si_emit_waitcnt(struct si_shader_context *ctx, unsigned simm16); + void si_shader_context_init_alu(struct lp_build_tgsi_context *bld_base); #endif -- cgit v1.2.3