Commit 6ff387e8 authored by Melissa Wen's avatar Melissa Wen Committed by Alex Deucher
Browse files

drm/amd/display: camel case cleanup in color_gamma file



Rename mapUserRamp to map_user_ramp and doClamping to do_clamping

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 18c4e319
Loading
Loading
Loading
Loading
+26 −24
Original line number Diff line number Diff line
@@ -1715,8 +1715,8 @@ static bool map_regamma_hw_to_x_user(
	const struct pwl_float_data_ex *rgb_regamma,
	uint32_t hw_points_num,
	struct dc_transfer_func_distributed_points *tf_pts,
	bool mapUserRamp,
	bool doClamping)
	bool map_user_ramp,
	bool do_clamping)
{
	/* setup to spare calculated ideal regamma values */

@@ -1724,7 +1724,7 @@ static bool map_regamma_hw_to_x_user(
	struct hw_x_point *coords = coords_x;
	const struct pwl_float_data_ex *regamma = rgb_regamma;

	if (ramp && mapUserRamp) {
	if (ramp && map_user_ramp) {
		copy_rgb_regamma_to_coordinates_x(coords,
				hw_points_num,
				rgb_regamma);
@@ -1744,7 +1744,7 @@ static bool map_regamma_hw_to_x_user(
		}
	}

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

bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
		struct dc_transfer_func *input_tf,
		const struct dc_gamma *ramp, bool mapUserRamp)
		const struct dc_gamma *ramp, bool map_user_ramp)
{
	struct dc_transfer_func_distributed_points *tf_pts = &input_tf->tf_pts;
	struct dividers dividers;
@@ -1891,12 +1891,12 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
		return false;

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

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

	input_tf->type = TF_TYPE_DISTRIBUTED_POINTS;

	if (mapUserRamp && ramp && ramp->type == GAMMA_RGB_256) {
	if (map_user_ramp && ramp && ramp->type == GAMMA_RGB_256) {
		rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS,
				sizeof(*rgb_user),
				GFP_KERNEL);
@@ -2007,7 +2007,7 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
		map_regamma_hw_to_x_user(ramp, coeff, rgb_user,
				coordinates_x, axis_x, curve,
				MAX_HW_POINTS, tf_pts,
				mapUserRamp && ramp && ramp->type == GAMMA_RGB_256,
				map_user_ramp && ramp && ramp->type == GAMMA_RGB_256,
				true);
	}

@@ -2112,7 +2112,9 @@ static bool calculate_curve(enum dc_transfer_func_predefined trans,
}

bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
		const struct dc_gamma *ramp, bool mapUserRamp, bool canRomBeUsed,
					const struct dc_gamma *ramp,
					bool map_user_ramp,
					bool can_rom_be_used,
					const struct hdr_tm_params *fs_params,
					struct calculate_buffer *cal_buffer)
{
@@ -2124,26 +2126,26 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
	struct gamma_pixel *axis_x = NULL;
	struct pixel_gamma_point *coeff = NULL;
	enum dc_transfer_func_predefined tf = TRANSFER_FUNCTION_SRGB;
	bool doClamping = true;
	bool do_clamping = true;
	bool ret = false;

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

	/* we can use hardcoded curve for plain SRGB TF */
	if (output_tf->type == TF_TYPE_PREDEFINED && canRomBeUsed == true &&
	if (output_tf->type == TF_TYPE_PREDEFINED && can_rom_be_used == true &&
			output_tf->tf == TRANSFER_FUNCTION_SRGB) {
		if (ramp == NULL)
			return true;
		if ((ramp->is_identity && ramp->type != GAMMA_CS_TFM_1D) ||
				(!mapUserRamp && ramp->type == GAMMA_RGB_256))
		    (!map_user_ramp && ramp->type == GAMMA_RGB_256))
			return true;
	}

	output_tf->type = TF_TYPE_DISTRIBUTED_POINTS;

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

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

	if (ret) {
		doClamping = !(output_tf->tf == TRANSFER_FUNCTION_GAMMA22 &&
		do_clamping = !(output_tf->tf == TRANSFER_FUNCTION_GAMMA22 &&
				fs_params != NULL && fs_params->skip_tm == 0);

		map_regamma_hw_to_x_user(ramp, coeff, rgb_user,
					 coordinates_x, axis_x, rgb_regamma,
					 MAX_HW_POINTS, tf_pts,
				(mapUserRamp || (ramp && ramp->type != GAMMA_RGB_256)) &&
					 (map_user_ramp || (ramp && ramp->type != GAMMA_RGB_256)) &&
					 (ramp && ramp->type != GAMMA_CS_TFM_1D),
				doClamping);
					 do_clamping);

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