From 69c331e2c0b72e5a61e472571601f2d0c657a97b Mon Sep 17 00:00:00 2001 From: "Leder, Brendan Steve" Date: Fri, 13 Dec 2024 14:58:07 -0500 Subject: [PATCH] amd/vpelib: Reformat index variables and update enum Reformat index variables to indicate loop specifics and update enum to match formatting guide. Signed-off-by: Brendan Steve Leder Reviewed-by: Roy Chan Reviewed-by: Evan Damphousse Acked-by: Alan Liu Part-of: --- src/amd/vpelib/src/core/inc/color.h | 6 +++--- src/amd/vpelib/src/core/inc/color_table.h | 2 +- src/amd/vpelib/src/core/inc/color_test_values.h | 2 +- src/amd/vpelib/src/core/inc/hw_shared.h | 4 ++-- src/amd/vpelib/src/core/inc/mpc.h | 4 ++-- src/amd/vpelib/src/core/inc/opp.h | 2 +- src/amd/vpelib/src/core/inc/transform.h | 4 ++-- src/amd/vpelib/src/core/inc/vpe_command.h | 2 +- src/amd/vpelib/src/core/resource.c | 13 +++++++------ 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/amd/vpelib/src/core/inc/color.h b/src/amd/vpelib/src/core/inc/color.h index 35aca32daf0..61e5f24b1ee 100644 --- a/src/amd/vpelib/src/core/inc/color.h +++ b/src/amd/vpelib/src/core/inc/color.h @@ -62,7 +62,7 @@ enum color_range_type { COLOR_RANGE_FULL, COLOR_RANGE_LIMITED_8BPC, COLOR_RANGE_LIMITED_10BPC, - COLOR_RANGE_LIMITED_16BPC + COLOR_RANGE_LIMITED_16BPC, }; enum color_transfer_func { @@ -73,7 +73,7 @@ enum color_transfer_func { TRANSFER_FUNC_PQ2084, TRANSFER_FUNC_LINEAR, TRANSFER_FUNC_NORMALIZED_PQ, - TRANSFER_FUNC_HLG + TRANSFER_FUNC_HLG, }; enum dither_option { @@ -129,7 +129,7 @@ enum transfer_func_type { TF_TYPE_PREDEFINED, TF_TYPE_DISTRIBUTED_POINTS, TF_TYPE_BYPASS, - TF_TYPE_HWPWL + TF_TYPE_HWPWL, }; enum cm_type { diff --git a/src/amd/vpelib/src/core/inc/color_table.h b/src/amd/vpelib/src/core/inc/color_table.h index c4212b4f03e..3a536b58945 100644 --- a/src/amd/vpelib/src/core/inc/color_table.h +++ b/src/amd/vpelib/src/core/inc/color_table.h @@ -38,7 +38,7 @@ extern "C" { enum table_type { type_pq_table, - type_de_pq_table + type_de_pq_table, }; bool vpe_color_is_table_init(enum table_type type); diff --git a/src/amd/vpelib/src/core/inc/color_test_values.h b/src/amd/vpelib/src/core/inc/color_test_values.h index 629a889ce83..538b16f255d 100644 --- a/src/amd/vpelib/src/core/inc/color_test_values.h +++ b/src/amd/vpelib/src/core/inc/color_test_values.h @@ -34,7 +34,7 @@ extern "C" { enum test3d_type { lut3d_identity = 0, - lut3d_sce + lut3d_sce, }; bool build_test_shaper_sdr(struct transfer_func *shaper); diff --git a/src/amd/vpelib/src/core/inc/hw_shared.h b/src/amd/vpelib/src/core/inc/hw_shared.h index 1bd371202e5..fafcc41bdbe 100644 --- a/src/amd/vpelib/src/core/inc/hw_shared.h +++ b/src/amd/vpelib/src/core/inc/hw_shared.h @@ -133,7 +133,7 @@ enum hw_point_position { /* hw point lays left from left (smaller) sw point */ HW_POINT_POSITION_LEFT, /* hw point lays stays from right (bigger) sw point */ - HW_POINT_POSITION_RIGHT + HW_POINT_POSITION_RIGHT, }; struct gamma_point { @@ -191,7 +191,7 @@ struct tetrahedral_params { enum vpe_lut_mode { LUT_BYPASS, LUT_RAM_A, - LUT_RAM_B + LUT_RAM_B, }; #ifdef __cplusplus diff --git a/src/amd/vpelib/src/core/inc/mpc.h b/src/amd/vpelib/src/core/inc/mpc.h index 79d2a86e30c..8d78af6b874 100644 --- a/src/amd/vpelib/src/core/inc/mpc.h +++ b/src/amd/vpelib/src/core/inc/mpc.h @@ -64,13 +64,13 @@ enum mpcc_blend_mode { MPCC_BLEND_MODE_BYPASS, // Direct digital bypass MPCC_BLEND_MODE_TOP_LAYER_PASSTHROUGH, // Top layer pass-through MPCC_BLEND_MODE_TOP_LAYER_ONLY, // Top layer bleneded with background color - MPCC_BLEND_MODE_TOP_BOT_BLENDING // Top and bottom blending + MPCC_BLEND_MODE_TOP_BOT_BLENDING, // Top and bottom blending }; enum mpcc_alpha_blend_mode { MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA, MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA_COMBINED_GLOBAL_GAIN, - MPCC_ALPHA_BLEND_MODE_GLOBAL_ALPHA + MPCC_ALPHA_BLEND_MODE_GLOBAL_ALPHA, }; /* diff --git a/src/amd/vpelib/src/core/inc/opp.h b/src/amd/vpelib/src/core/inc/opp.h index 0180fa53d68..2cc0bf862aa 100644 --- a/src/amd/vpelib/src/core/inc/opp.h +++ b/src/amd/vpelib/src/core/inc/opp.h @@ -38,7 +38,7 @@ enum clamping_range { CLAMPING_LIMITED_RANGE_10BPC, /* 10 bpc: Clamping 4 to 3FB */ CLAMPING_LIMITED_RANGE_12BPC, /* 12 bpc: Clamping 10 to FEF */ /* Use programmable clampping value on FMT_CLAMP_COMPONENT_R/G/B. */ - CLAMPING_LIMITED_RANGE_PROGRAMMABLE + CLAMPING_LIMITED_RANGE_PROGRAMMABLE, }; struct clamping_and_pixel_encoding_params { diff --git a/src/amd/vpelib/src/core/inc/transform.h b/src/amd/vpelib/src/core/inc/transform.h index cb468aa7c9c..a4d7d77bbe4 100644 --- a/src/amd/vpelib/src/core/inc/transform.h +++ b/src/amd/vpelib/src/core/inc/transform.h @@ -38,7 +38,7 @@ extern "C" { enum gamut_adjust_type { GAMUT_ADJUST_TYPE_BYPASS = 0, - GAMUT_ADJUST_TYPE_SW /* use adjustments */ + GAMUT_ADJUST_TYPE_SW, /* use adjustments */ }; struct gamut_remap_matrix { @@ -59,7 +59,7 @@ enum lb_memory_config { /* Only applicable in 4:2:0 mode, enable all 3 pieces of memory and the * last piece of chroma memory used for the luma storage */ - LB_MEMORY_CONFIG_3 = 3 + LB_MEMORY_CONFIG_3 = 3, }; struct scaling_ratios { diff --git a/src/amd/vpelib/src/core/inc/vpe_command.h b/src/amd/vpelib/src/core/inc/vpe_command.h index aa37224a922..07294cc1d58 100644 --- a/src/amd/vpelib/src/core/inc/vpe_command.h +++ b/src/amd/vpelib/src/core/inc/vpe_command.h @@ -103,6 +103,6 @@ enum VPE_VPEP_CFG_SUBOP { **************************/ enum VPE_POLL_REGMEM_SUBOP { VPE_POLL_REGMEM_SUBOP_REGMEM = 0x0, - VPE_POLL_REGMEM_SUBOP_REGMEM_WRITE = 0x1 + VPE_POLL_REGMEM_SUBOP_REGMEM_WRITE = 0x1, }; diff --git a/src/amd/vpelib/src/core/resource.c b/src/amd/vpelib/src/core/resource.c index e9bb10a454a..f4a29fc6bbb 100644 --- a/src/amd/vpelib/src/core/resource.c +++ b/src/amd/vpelib/src/core/resource.c @@ -327,17 +327,18 @@ void vpe_pipe_reset(struct vpe_priv *vpe_priv) void vpe_pipe_reclaim(struct vpe_priv *vpe_priv, struct vpe_cmd_info *cmd_info) { - int i, j; + int pipe_idx, input_idx; struct pipe_ctx *pipe_ctx; - for (i = 0; i < vpe_priv->num_pipe; i++) { - pipe_ctx = &vpe_priv->pipe_ctx[i]; + for (pipe_idx = 0; pipe_idx < vpe_priv->num_pipe; pipe_idx++) { + pipe_ctx = &vpe_priv->pipe_ctx[pipe_idx]; if (pipe_ctx->owner != PIPE_CTX_NO_OWNER) { - for (j = 0; j < cmd_info->num_inputs; j++) - if (pipe_ctx->owner == cmd_info->inputs[j].stream_idx) + for (input_idx = 0; input_idx < cmd_info->num_inputs; input_idx++) + if ((pipe_ctx->owner == cmd_info->inputs[input_idx].stream_idx) && + (pipe_idx == input_idx)) // Check if stream is being used again in same pipe break; - if (j == cmd_info->num_inputs) { + if (input_idx == cmd_info->num_inputs) { // that stream no longer exists pipe_ctx->is_top_pipe = true; pipe_ctx->owner = PIPE_CTX_NO_OWNER;