diff options
author | Marek Olšák <[email protected]> | 2017-10-07 18:10:26 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-10-09 16:20:16 +0200 |
commit | 3784ce9782b47772c950b841f8934d51a18c4b7d (patch) | |
tree | a63307d806662cd0fc9917dc3b5fd27b9aa0f1cb /src/gallium/drivers/radeonsi | |
parent | 99fa9ccf969c47e9ddf4ac844b557935759fcea6 (diff) |
radeonsi: enumerize DBG flags
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_blit.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_debug.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 38 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_draw.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 4 |
8 files changed, 33 insertions, 33 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 40f85505929..4806e7c9415 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -1399,7 +1399,7 @@ static void si_blit(struct pipe_context *ctx, info->src.box.z, info->src.box.z + info->src.box.depth - 1); - if (sctx->screen->b.debug_flags & DBG_FORCE_DMA && + if (sctx->screen->b.debug_flags & DBG(FORCE_DMA) && util_try_blit_via_copy_region(ctx, info)) return; diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index ddf65d6d7e2..1aca98bcde7 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -1103,7 +1103,7 @@ void si_init_debug_functions(struct si_context *sctx) /* Set the initial dmesg timestamp for this context, so that * only new messages will be checked for VM faults. */ - if (sctx->screen->b.debug_flags & DBG_CHECK_VM) + if (sctx->screen->b.debug_flags & DBG(CHECK_VM)) ac_vm_fault_occured(sctx->b.chip_class, &sctx->dmesg_timestamp, NULL); } diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index ef03a6d2c68..72da54e5b4e 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -83,7 +83,7 @@ void si_context_gfx_flush(void *context, unsigned flags, if (si_check_device_reset(&ctx->b)) return; - if (ctx->screen->b.debug_flags & DBG_CHECK_VM) + if (ctx->screen->b.debug_flags & DBG(CHECK_VM)) flags &= ~RADEON_FLUSH_ASYNC; /* If the state tracker is flushing the GFX IB, r600_flush_from_st is @@ -126,7 +126,7 @@ void si_context_gfx_flush(void *context, unsigned flags, ctx->b.num_gfx_cs_flushes++; /* Check VM faults if needed. */ - if (ctx->screen->b.debug_flags & DBG_CHECK_VM) { + if (ctx->screen->b.debug_flags & DBG(CHECK_VM)) { /* Use conservative timeout 800ms, after which we won't wait any * longer and assume the GPU is hung. */ diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 5cf71bec6a5..e98e4fef926 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -152,7 +152,7 @@ si_create_llvm_target_machine(struct si_screen *sscreen) "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s", sscreen->b.chip_class >= GFX9 ? ",+xnack" : ",-xnack", sscreen->llvm_has_working_vgpr_indexing ? "" : ",-promote-alloca", - sscreen->b.debug_flags & DBG_SI_SCHED ? ",+si-scheduler" : ""); + sscreen->b.debug_flags & DBG(SI_SCHED) ? ",+si-scheduler" : ""); return LLVMCreateTargetMachine(ac_get_llvm_target(triple), triple, si_get_llvm_processor_name(sscreen->b.family), @@ -248,7 +248,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, else si_init_dma_functions(sctx); - if (sscreen->b.debug_flags & DBG_FORCE_DMA) + if (sscreen->b.debug_flags & DBG(FORCE_DMA)) sctx->b.b.resource_copy_region = sctx->b.dma_copy; sctx->blitter = util_blitter_create(&sctx->b.b); @@ -362,7 +362,7 @@ static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen, struct si_screen *sscreen = (struct si_screen *)screen; struct pipe_context *ctx; - if (sscreen->b.debug_flags & DBG_CHECK_VM) + if (sscreen->b.debug_flags & DBG(CHECK_VM)) flags |= PIPE_CONTEXT_DEBUG; ctx = si_create_context(screen, flags); @@ -540,7 +540,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param) return 4; case PIPE_CAP_GLSL_FEATURE_LEVEL: - if (sscreen->b.debug_flags & DBG_NIR) + if (sscreen->b.debug_flags & DBG(NIR)) return 140; /* no geometry and tessellation shaders yet */ if (si_have_tgsi_compute(sscreen)) return 450; @@ -739,7 +739,7 @@ static int si_get_shader_param(struct pipe_screen* pscreen, case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: return 32; case PIPE_SHADER_CAP_PREFERRED_IR: - if (sscreen->b.debug_flags & DBG_NIR && + if (sscreen->b.debug_flags & DBG(NIR) && (shader == PIPE_SHADER_VERTEX || shader == PIPE_SHADER_FRAGMENT)) return PIPE_SHADER_IR_NIR; @@ -934,17 +934,17 @@ static void si_test_vmfault(struct si_screen *sscreen) r600_resource(buf)->gpu_address = 0; /* cause a VM fault */ - if (sscreen->b.debug_flags & DBG_TEST_VMFAULT_CP) { + if (sscreen->b.debug_flags & DBG(TEST_VMFAULT_CP)) { si_copy_buffer(sctx, buf, buf, 0, 4, 4, 0); ctx->flush(ctx, NULL, 0); puts("VM fault test: CP - done."); } - if (sscreen->b.debug_flags & DBG_TEST_VMFAULT_SDMA) { + if (sscreen->b.debug_flags & DBG(TEST_VMFAULT_SDMA)) { sctx->b.dma_clear_buffer(ctx, buf, 0, 4, 0); ctx->flush(ctx, NULL, 0); puts("VM fault test: SDMA - done."); } - if (sscreen->b.debug_flags & DBG_TEST_VMFAULT_SHADER) { + if (sscreen->b.debug_flags & DBG(TEST_VMFAULT_SHADER)) { util_test_constant_buffer(ctx, buf); puts("VM fault test: Shader - done."); } @@ -990,9 +990,9 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, */ if (driQueryOptionb(config->options, "glsl_correct_derivatives_after_discard")) - sscreen->b.debug_flags |= DBG_FS_CORRECT_DERIVS_AFTER_KILL; + sscreen->b.debug_flags |= DBG(FS_CORRECT_DERIVS_AFTER_KILL); if (driQueryOptionb(config->options, "radeonsi_enable_sisched")) - sscreen->b.debug_flags |= DBG_SI_SCHED; + sscreen->b.debug_flags |= DBG(SI_SCHED); if (!si_common_screen_init(&sscreen->b, ws) || !si_init_gs_info(sscreen) || @@ -1061,7 +1061,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, sscreen->has_out_of_order_rast = sscreen->b.chip_class >= VI && sscreen->b.info.max_se >= 2 && - !(sscreen->b.debug_flags & DBG_NO_OUT_OF_ORDER); + !(sscreen->b.debug_flags & DBG(NO_OUT_OF_ORDER)); sscreen->assume_no_z_fights = driQueryOptionb(config->options, "radeonsi_assume_no_z_fights"); sscreen->commutative_blend_add = @@ -1073,9 +1073,9 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, sscreen->b.family == CHIP_VEGA10 || sscreen->b.family == CHIP_RAVEN; sscreen->dpbb_allowed = sscreen->b.chip_class >= GFX9 && - !(sscreen->b.debug_flags & DBG_NO_DPBB); + !(sscreen->b.debug_flags & DBG(NO_DPBB)); sscreen->dfsm_allowed = sscreen->dpbb_allowed && - !(sscreen->b.debug_flags & DBG_NO_DFSM); + !(sscreen->b.debug_flags & DBG(NO_DFSM)); /* While it would be nice not to have this flag, we are constrained * by the reality that LLVM 5.0 doesn't have working VGPR indexing @@ -1094,14 +1094,14 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, sscreen->b.has_rbplus = true; sscreen->b.rbplus_allowed = - !(sscreen->b.debug_flags & DBG_NO_RB_PLUS) && + !(sscreen->b.debug_flags & DBG(NO_RB_PLUS)) && (sscreen->b.family == CHIP_STONEY || sscreen->b.family == CHIP_RAVEN); } (void) mtx_init(&sscreen->shader_parts_mutex, mtx_plain); sscreen->use_monolithic_shaders = - (sscreen->b.debug_flags & DBG_MONOLITHIC_SHADERS) != 0; + (sscreen->b.debug_flags & DBG(MONOLITHIC_SHADERS)) != 0; sscreen->b.barrier_flags.cp_to_L2 = SI_CONTEXT_INV_SMEM_L1 | SI_CONTEXT_INV_VMEM_L1; @@ -1123,12 +1123,12 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, /* Create the auxiliary context. This must be done last. */ sscreen->b.aux_context = si_create_context(&sscreen->b.b, 0); - if (sscreen->b.debug_flags & DBG_TEST_DMA) + if (sscreen->b.debug_flags & DBG(TEST_DMA)) si_test_dma(&sscreen->b); - if (sscreen->b.debug_flags & (DBG_TEST_VMFAULT_CP | - DBG_TEST_VMFAULT_SDMA | - DBG_TEST_VMFAULT_SHADER)) + if (sscreen->b.debug_flags & (DBG(TEST_VMFAULT_CP) | + DBG(TEST_VMFAULT_SDMA) | + DBG(TEST_VMFAULT_SHADER))) si_test_vmfault(sscreen); return &sscreen->b.b; diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index da53ac3bd26..4456c3dab3f 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -4172,7 +4172,7 @@ static void si_create_function(struct si_shader_context *ctx, "no-signed-zeros-fp-math", "true"); - if (ctx->screen->b.debug_flags & DBG_UNSAFE_MATH) { + if (ctx->screen->b.debug_flags & DBG(UNSAFE_MATH)) { /* These were copied from some LLVM test. */ LLVMAddTargetDependentFunctionAttr(ctx->main_fn, "less-precise-fpmad", @@ -5238,7 +5238,7 @@ void si_shader_dump(struct si_screen *sscreen, const struct si_shader *shader, if (!check_debug_option || (si_can_dump_shader(&sscreen->b, processor) && - !(sscreen->b.debug_flags & DBG_NO_ASM))) { + !(sscreen->b.debug_flags & DBG(NO_ASM)))) { fprintf(file, "\n%s:\n", si_get_shader_name(shader, processor)); if (shader->prolog) @@ -5278,7 +5278,7 @@ static int si_compile_llvm(struct si_screen *sscreen, if (si_can_dump_shader(&sscreen->b, processor)) { fprintf(stderr, "radeonsi: Compiling shader %d\n", count); - if (!(sscreen->b.debug_flags & (DBG_NO_IR | DBG_PREOPT_IR))) { + if (!(sscreen->b.debug_flags & (DBG(NO_IR) | DBG(PREOPT_IR)))) { fprintf(stderr, "%s LLVM IR:\n\n", name); ac_dump_module(mod); fprintf(stderr, "\n"); @@ -5812,7 +5812,7 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx, } if (ctx->type == PIPE_SHADER_FRAGMENT && sel->info.uses_kill && - ctx->screen->b.debug_flags & DBG_FS_CORRECT_DERIVS_AFTER_KILL) { + ctx->screen->b.debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL)) { /* This is initialized to 0.0 = not kill. */ ctx->postponed_kill = lp_build_alloca(&ctx->gallivm, ctx->f32, ""); } @@ -6387,7 +6387,7 @@ int si_compile_tgsi_shader(struct si_screen *sscreen, /* Dump TGSI code before doing TGSI->LLVM conversion in case the * conversion fails. */ if (si_can_dump_shader(&sscreen->b, sel->info.processor) && - !(sscreen->b.debug_flags & DBG_NO_TGSI)) { + !(sscreen->b.debug_flags & DBG(NO_TGSI))) { if (sel->tokens) tgsi_dump(sel->tokens, 0); else diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index 2aedf85b417..9ec5a876f31 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -1156,7 +1156,7 @@ void si_llvm_context_init(struct si_shader_context *ctx, LLVMDisposeTargetData(data_layout); LLVMDisposeMessage(data_layout_str); - bool unsafe_fpmath = (sscreen->b.debug_flags & DBG_UNSAFE_MATH) != 0; + bool unsafe_fpmath = (sscreen->b.debug_flags & DBG(UNSAFE_MATH)) != 0; enum lp_float_mode float_mode = unsafe_fpmath ? LP_FLOAT_MODE_UNSAFE_FP_MATH : LP_FLOAT_MODE_NO_SIGNED_ZEROS_FP_MATH; @@ -1358,7 +1358,7 @@ void si_llvm_optimize_module(struct si_shader_context *ctx) LLVMTargetLibraryInfoRef target_library_info; /* Dump LLVM IR before any optimization passes */ - if (ctx->screen->b.debug_flags & DBG_PREOPT_IR && + if (ctx->screen->b.debug_flags & DBG(PREOPT_IR) && si_can_dump_shader(&ctx->screen->b, ctx->type)) LLVMDumpModule(ctx->gallivm.module); diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index c6c15c1acf7..6eab4cb47d9 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -368,7 +368,7 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen, /* This is a hardware requirement. */ if (key->u.line_stipple_enabled || - (sscreen->b.debug_flags & DBG_SWITCH_ON_EOP)) { + (sscreen->b.debug_flags & DBG(SWITCH_ON_EOP))) { ia_switch_on_eop = true; wd_switch_on_eop = true; } diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 40a76c85f3f..dbaa2dcd5cb 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1483,7 +1483,7 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, assert(0); } - if (unlikely(sctx->screen->b.debug_flags & DBG_NO_OPT_VARIANT)) + if (unlikely(sctx->screen->b.debug_flags & DBG(NO_OPT_VARIANT))) memset(&key->opt, 0, sizeof(key->opt)); } @@ -1913,7 +1913,7 @@ static void si_init_shader_selector_async(void *job, int thread_index) } /* Pre-compilation. */ - if (sscreen->b.debug_flags & DBG_PRECOMPILE && + if (sscreen->b.debug_flags & DBG(PRECOMPILE) && /* GFX9 needs LS or ES for compilation, which we don't have here. */ (sscreen->b.chip_class <= VI || (sel->type != PIPE_SHADER_TESS_CTRL && |