summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/modules
diff options
context:
space:
mode:
authorGaghik Khachatrian <gaghik.khachatrian@amd.com>2026-04-26 13:35:52 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-05-11 16:10:30 -0400
commitda11ed03e1c9f11e700cd59f18754715f27ae14d (patch)
tree3631b23f6d3ca50f9afb599ac6b62c35a88c1dcc /drivers/gpu/drm/amd/display/modules
parent12b3bda41a9aa240b164e6cc882df49dce187ec9 (diff)
downloadlinux-next-da11ed03e1c9f11e700cd59f18754715f27ae14d.tar.gz
linux-next-da11ed03e1c9f11e700cd59f18754715f27ae14d.zip
drm/amd/display: Fix multiple compiler warnings
[Why] Unreachable Code; Copy Constructor Deleted; Local Declaration Hides Parameter; Local Declaration Hides Outer Scope; Uninitialized or Suspicious Memory Use. [How] - Removed or refactored unreachable code paths - Ensured proper copy constructors in C++ classes - Renamed local variables that shadowed function parameters - Renamed inner loop/block variables to avoid shadowing outer scope Fixed in 8 files across several FPU layers Also fixed in color_gamma and cs_funcs modules - Reordered guard conditions to validate pipe type before accessing stream - Ensures safe memory access patterns in DC DMUB service layer All changes maintain backward compatibility and preserve functional behavior. Reviewed-by: Dillon Varone <dillon.varone@amd.com> Signed-off-by: Gaghik Khachatrian <gaghik.khachatrian@amd.com> Signed-off-by: James Lin <pinglei.lin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules')
-rw-r--r--drivers/gpu/drm/amd/display/modules/color/color_gamma.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
index beb97cbdad6e..03d88e78165d 100644
--- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
+++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
@@ -690,7 +690,7 @@ static bool find_software_points(
static bool build_custom_gamma_mapping_coefficients_worker(
const struct dc_gamma *ramp,
struct pixel_gamma_point *coeff,
- const struct hw_x_point *coordinates_x,
+ const struct hw_x_point *hw_coordinates_x,
const struct gamma_pixel *axis_x,
enum channel_name channel,
uint32_t number_of_points)
@@ -712,11 +712,11 @@ static bool build_custom_gamma_mapping_coefficients_worker(
struct fixed31_32 right_pos;
if (channel == CHANNEL_NAME_RED)
- coord_x = coordinates_x[i].regamma_y_red;
+ coord_x = hw_coordinates_x[i].regamma_y_red;
else if (channel == CHANNEL_NAME_GREEN)
- coord_x = coordinates_x[i].regamma_y_green;
+ coord_x = hw_coordinates_x[i].regamma_y_green;
else
- coord_x = coordinates_x[i].regamma_y_blue;
+ coord_x = hw_coordinates_x[i].regamma_y_blue;
if (!find_software_points(
ramp, axis_x, coord_x, channel,
@@ -1539,11 +1539,11 @@ static void build_evenly_distributed_points(
}
static inline void copy_rgb_regamma_to_coordinates_x(
- struct hw_x_point *coordinates_x,
+ struct hw_x_point *hw_coordinates_x,
uint32_t hw_points_num,
const struct pwl_float_data_ex *rgb_ex)
{
- struct hw_x_point *coords = coordinates_x;
+ struct hw_x_point *coords = hw_coordinates_x;
uint32_t i = 0;
const struct pwl_float_data_ex *rgb_regamma = rgb_ex;
@@ -1562,7 +1562,7 @@ static bool calculate_interpolated_hardware_curve(
const struct dc_gamma *ramp,
struct pixel_gamma_point *coeff128,
struct pwl_float_data *rgb_user,
- const struct hw_x_point *coordinates_x,
+ const struct hw_x_point *hw_coordinates_x,
const struct gamma_pixel *axis_x,
uint32_t number_of_points,
struct dc_transfer_func_distributed_points *tf_pts)
@@ -1575,7 +1575,7 @@ static bool calculate_interpolated_hardware_curve(
for (i = 0; i < 3; i++) {
if (!build_custom_gamma_mapping_coefficients_worker(
- ramp, coeff128, coordinates_x, axis_x, i,
+ ramp, coeff128, hw_coordinates_x, axis_x, i,
number_of_points))
return false;
}
@@ -1786,14 +1786,14 @@ bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
if (input_tf->tf == TRANSFER_FUNCTION_PQ) {
/* just copy current rgb_regamma into tf_pts */
struct pwl_float_data_ex *curvePt = curve;
- int i = 0;
+ int j = 0;
- while (i <= MAX_HW_POINTS) {
- tf_pts->red[i] = curvePt->r;
- tf_pts->green[i] = curvePt->g;
- tf_pts->blue[i] = curvePt->b;
+ while (j <= MAX_HW_POINTS) {
+ tf_pts->red[j] = curvePt->r;
+ tf_pts->green[j] = curvePt->g;
+ tf_pts->blue[j] = curvePt->b;
++curvePt;
- ++i;
+ ++j;
}
} else {
// clamps to 0-1