From 9a244778f7304d47e40a10415e06607835f18a63 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 6 May 2020 18:09:52 +0200 Subject: [PATCH] r600: Annotate some case fallthroughs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also fix indentions where aproprate Signed-off-by: Gert Wollny Reviewed-by: Michel Dänzer Part-of: --- src/gallium/drivers/r600/eg_debug.c | 2 +- src/gallium/drivers/r600/r600_pipe.c | 2 ++ src/gallium/drivers/r600/r600_query.c | 1 + src/gallium/drivers/r600/r600_shader.c | 38 ++++++++++---------- src/gallium/drivers/r600/r600_state_common.c | 2 ++ 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/r600/eg_debug.c b/src/gallium/drivers/r600/eg_debug.c index 56195df2964..996e1ab8eaf 100644 --- a/src/gallium/drivers/r600/eg_debug.c +++ b/src/gallium/drivers/r600/eg_debug.c @@ -256,7 +256,7 @@ static uint32_t *ac_parse_packet3(FILE *f, uint32_t *ib, int *num_dw, COLOR_RESET "\n"); break; } - /* fall through, print all dwords */ + /* fallthrough *//* print all dwords */ default: for (i = 0; i < count+1; i++) { print_spaces(f, INDENT_PKT); diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 3ffead9eb29..94dc07d3059 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -561,9 +561,11 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, case PIPE_SHADER_TESS_EVAL: if (rscreen->b.family >= CHIP_CEDAR) break; + /* fallthrough */ case PIPE_SHADER_COMPUTE: if (!is_nir_enabled(&rscreen->b)) break; + /* fallthrough */ default: return 0; } diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c index 4ef7bc8ca1b..082052a4a7d 100644 --- a/src/gallium/drivers/r600/r600_query.c +++ b/src/gallium/drivers/r600/r600_query.c @@ -1125,6 +1125,7 @@ static void r600_get_hw_query_params(struct r600_common_context *rctx, case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE: params->pair_count = R600_MAX_STREAMS; params->pair_stride = 32; + /* fallthrough */ case PIPE_QUERY_SO_OVERFLOW_PREDICATE: params->start_offset = 0; params->end_offset = 16; diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index ed0db0e114a..f2eb7796810 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -500,24 +500,26 @@ static int tgsi_is_supported(struct r600_shader_ctx *ctx) #endif for (j = 0; j < i->Instruction.NumSrcRegs; j++) { if (i->Src[j].Register.Dimension) { - switch (i->Src[j].Register.File) { - case TGSI_FILE_CONSTANT: - case TGSI_FILE_HW_ATOMIC: - break; - case TGSI_FILE_INPUT: - if (ctx->type == PIPE_SHADER_GEOMETRY || - ctx->type == PIPE_SHADER_TESS_CTRL || - ctx->type == PIPE_SHADER_TESS_EVAL) - break; - case TGSI_FILE_OUTPUT: - if (ctx->type == PIPE_SHADER_TESS_CTRL) - break; - default: - R600_ERR("unsupported src %d (file %d, dimension %d)\n", j, - i->Src[j].Register.File, - i->Src[j].Register.Dimension); - return -EINVAL; - } + switch (i->Src[j].Register.File) { + case TGSI_FILE_CONSTANT: + case TGSI_FILE_HW_ATOMIC: + break; + case TGSI_FILE_INPUT: + if (ctx->type == PIPE_SHADER_GEOMETRY || + ctx->type == PIPE_SHADER_TESS_CTRL || + ctx->type == PIPE_SHADER_TESS_EVAL) + break; + /* fallthrough */ + case TGSI_FILE_OUTPUT: + if (ctx->type == PIPE_SHADER_TESS_CTRL) + break; + /* fallthrough */ + default: + R600_ERR("unsupported src %d (file %d, dimension %d)\n", j, + i->Src[j].Register.File, + i->Src[j].Register.Dimension); + return -EINVAL; + } } } for (j = 0; j < i->Instruction.NumDstRegs; j++) { diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 76dd9314132..5deb905c630 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -2782,6 +2782,7 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen, case PIPE_FORMAT_RGTC1_SNORM: case PIPE_FORMAT_LATC1_SNORM: word4 |= sign_bit[0]; + /* fallthrough */ case PIPE_FORMAT_RGTC1_UNORM: case PIPE_FORMAT_LATC1_UNORM: result = FMT_BC4; @@ -2789,6 +2790,7 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen, case PIPE_FORMAT_RGTC2_SNORM: case PIPE_FORMAT_LATC2_SNORM: word4 |= sign_bit[0] | sign_bit[1]; + /* fallthrough */ case PIPE_FORMAT_RGTC2_UNORM: case PIPE_FORMAT_LATC2_UNORM: result = FMT_BC5; -- 2.30.2