Skip to content

Commit 6ff387e

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: camel case cleanup in color_gamma file
Rename mapUserRamp to map_user_ramp and doClamping to do_clamping Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 18c4e31 commit 6ff387e

1 file changed

Lines changed: 26 additions & 24 deletions

File tree

drivers/gpu/drm/amd/display/modules/color/color_gamma.c

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,16 +1715,16 @@ static bool map_regamma_hw_to_x_user(
17151715
const struct pwl_float_data_ex *rgb_regamma,
17161716
uint32_t hw_points_num,
17171717
struct dc_transfer_func_distributed_points *tf_pts,
1718-
bool mapUserRamp,
1719-
bool doClamping)
1718+
bool map_user_ramp,
1719+
bool do_clamping)
17201720
{
17211721
/* setup to spare calculated ideal regamma values */
17221722

17231723
int i = 0;
17241724
struct hw_x_point *coords = coords_x;
17251725
const struct pwl_float_data_ex *regamma = rgb_regamma;
17261726

1727-
if (ramp && mapUserRamp) {
1727+
if (ramp && map_user_ramp) {
17281728
copy_rgb_regamma_to_coordinates_x(coords,
17291729
hw_points_num,
17301730
rgb_regamma);
@@ -1744,7 +1744,7 @@ static bool map_regamma_hw_to_x_user(
17441744
}
17451745
}
17461746

1747-
if (doClamping) {
1747+
if (do_clamping) {
17481748
/* this should be named differently, all it does is clamp to 0-1 */
17491749
build_new_custom_resulted_curve(hw_points_num, tf_pts);
17501750
}
@@ -1875,7 +1875,7 @@ bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf,
18751875

18761876
bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
18771877
struct dc_transfer_func *input_tf,
1878-
const struct dc_gamma *ramp, bool mapUserRamp)
1878+
const struct dc_gamma *ramp, bool map_user_ramp)
18791879
{
18801880
struct dc_transfer_func_distributed_points *tf_pts = &input_tf->tf_pts;
18811881
struct dividers dividers;
@@ -1891,12 +1891,12 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
18911891
return false;
18921892

18931893
/* we can use hardcoded curve for plain SRGB TF
1894-
* If linear, it's bypass if on user ramp
1894+
* If linear, it's bypass if no user ramp
18951895
*/
18961896
if (input_tf->type == TF_TYPE_PREDEFINED) {
18971897
if ((input_tf->tf == TRANSFER_FUNCTION_SRGB ||
18981898
input_tf->tf == TRANSFER_FUNCTION_LINEAR) &&
1899-
!mapUserRamp)
1899+
!map_user_ramp)
19001900
return true;
19011901

19021902
if (dc_caps != NULL &&
@@ -1919,7 +1919,7 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
19191919

19201920
input_tf->type = TF_TYPE_DISTRIBUTED_POINTS;
19211921

1922-
if (mapUserRamp && ramp && ramp->type == GAMMA_RGB_256) {
1922+
if (map_user_ramp && ramp && ramp->type == GAMMA_RGB_256) {
19231923
rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS,
19241924
sizeof(*rgb_user),
19251925
GFP_KERNEL);
@@ -2007,7 +2007,7 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
20072007
map_regamma_hw_to_x_user(ramp, coeff, rgb_user,
20082008
coordinates_x, axis_x, curve,
20092009
MAX_HW_POINTS, tf_pts,
2010-
mapUserRamp && ramp && ramp->type == GAMMA_RGB_256,
2010+
map_user_ramp && ramp && ramp->type == GAMMA_RGB_256,
20112011
true);
20122012
}
20132013

@@ -2112,9 +2112,11 @@ static bool calculate_curve(enum dc_transfer_func_predefined trans,
21122112
}
21132113

21142114
bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
2115-
const struct dc_gamma *ramp, bool mapUserRamp, bool canRomBeUsed,
2116-
const struct hdr_tm_params *fs_params,
2117-
struct calculate_buffer *cal_buffer)
2115+
const struct dc_gamma *ramp,
2116+
bool map_user_ramp,
2117+
bool can_rom_be_used,
2118+
const struct hdr_tm_params *fs_params,
2119+
struct calculate_buffer *cal_buffer)
21182120
{
21192121
struct dc_transfer_func_distributed_points *tf_pts = &output_tf->tf_pts;
21202122
struct dividers dividers;
@@ -2124,26 +2126,26 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
21242126
struct gamma_pixel *axis_x = NULL;
21252127
struct pixel_gamma_point *coeff = NULL;
21262128
enum dc_transfer_func_predefined tf = TRANSFER_FUNCTION_SRGB;
2127-
bool doClamping = true;
2129+
bool do_clamping = true;
21282130
bool ret = false;
21292131

21302132
if (output_tf->type == TF_TYPE_BYPASS)
21312133
return false;
21322134

21332135
/* we can use hardcoded curve for plain SRGB TF */
2134-
if (output_tf->type == TF_TYPE_PREDEFINED && canRomBeUsed == true &&
2136+
if (output_tf->type == TF_TYPE_PREDEFINED && can_rom_be_used == true &&
21352137
output_tf->tf == TRANSFER_FUNCTION_SRGB) {
21362138
if (ramp == NULL)
21372139
return true;
21382140
if ((ramp->is_identity && ramp->type != GAMMA_CS_TFM_1D) ||
2139-
(!mapUserRamp && ramp->type == GAMMA_RGB_256))
2141+
(!map_user_ramp && ramp->type == GAMMA_RGB_256))
21402142
return true;
21412143
}
21422144

21432145
output_tf->type = TF_TYPE_DISTRIBUTED_POINTS;
21442146

21452147
if (ramp && ramp->type != GAMMA_CS_TFM_1D &&
2146-
(mapUserRamp || ramp->type != GAMMA_RGB_256)) {
2148+
(map_user_ramp || ramp->type != GAMMA_RGB_256)) {
21472149
rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS,
21482150
sizeof(*rgb_user),
21492151
GFP_KERNEL);
@@ -2164,7 +2166,7 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
21642166
ramp->num_entries,
21652167
dividers);
21662168

2167-
if (ramp->type == GAMMA_RGB_256 && mapUserRamp)
2169+
if (ramp->type == GAMMA_RGB_256 && map_user_ramp)
21682170
scale_gamma(rgb_user, ramp, dividers);
21692171
else if (ramp->type == GAMMA_RGB_FLOAT_1024)
21702172
scale_gamma_dx(rgb_user, ramp, dividers);
@@ -2191,15 +2193,15 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
21912193
cal_buffer);
21922194

21932195
if (ret) {
2194-
doClamping = !(output_tf->tf == TRANSFER_FUNCTION_GAMMA22 &&
2195-
fs_params != NULL && fs_params->skip_tm == 0);
2196+
do_clamping = !(output_tf->tf == TRANSFER_FUNCTION_GAMMA22 &&
2197+
fs_params != NULL && fs_params->skip_tm == 0);
21962198

21972199
map_regamma_hw_to_x_user(ramp, coeff, rgb_user,
2198-
coordinates_x, axis_x, rgb_regamma,
2199-
MAX_HW_POINTS, tf_pts,
2200-
(mapUserRamp || (ramp && ramp->type != GAMMA_RGB_256)) &&
2201-
(ramp && ramp->type != GAMMA_CS_TFM_1D),
2202-
doClamping);
2200+
coordinates_x, axis_x, rgb_regamma,
2201+
MAX_HW_POINTS, tf_pts,
2202+
(map_user_ramp || (ramp && ramp->type != GAMMA_RGB_256)) &&
2203+
(ramp && ramp->type != GAMMA_CS_TFM_1D),
2204+
do_clamping);
22032205

22042206
if (ramp && ramp->type == GAMMA_CS_TFM_1D)
22052207
apply_lut_1d(ramp, MAX_HW_POINTS, tf_pts);

0 commit comments

Comments
 (0)