drm/amd/display: Fix handling of linear transfer function
authorVitaly Prosyak <vitaly.prosyak@amd.com>
Wed, 28 Feb 2018 16:44:54 +0000 (10:44 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Mar 2018 20:08:48 +0000 (15:08 -0500)
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/color/color_gamma.c

index 57d5c2575de193160ba53b61ef57335fcd121168..e7e374f5686449d5ef6f596c8a4aa92a9e40ec2a 100644 (file)
@@ -1267,7 +1267,8 @@ bool  mod_color_calculate_curve(enum dc_transfer_func_predefined trans,
        bool ret = false;
        struct pwl_float_data_ex *rgb_regamma = NULL;
 
-       if (trans == TRANSFER_FUNCTION_UNITY) {
+       if (trans == TRANSFER_FUNCTION_UNITY ||
+               trans == TRANSFER_FUNCTION_LINEAR) {
                points->end_exponent = 0;
                points->x_point_at_y1_red = 1;
                points->x_point_at_y1_green = 1;
@@ -1337,7 +1338,8 @@ bool  mod_color_calculate_degamma_curve(enum dc_transfer_func_predefined trans,
        bool ret = false;
        struct pwl_float_data_ex *rgb_degamma = NULL;
 
-       if (trans == TRANSFER_FUNCTION_UNITY) {
+       if (trans == TRANSFER_FUNCTION_UNITY ||
+               trans == TRANSFER_FUNCTION_LINEAR) {
 
                for (i = 0; i <= MAX_HW_POINTS ; i++) {
                        points->red[i]    = coordinates_x[i].x;