]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/display: Fixed bandwidth calculation error when converting fractions
authorLogatharshan Thothiralingam <logatharshan.thothiralingam@amd.com>
Thu, 9 Mar 2017 16:37:26 +0000 (11:37 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:19:49 +0000 (17:19 -0400)
[Problem]
VSR greyed out

[Root cause]
When converting fractions, we were using the integer function, which let to
a large display clock and the view was not supported

[Solution]
Change the integer to fraction functions

Signed-off-by: Logatharshan Thothiralingam <logatharshan.thothiralingam@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

index c855e49eb1162f6719e36df433dd8e7a853e80ac..e477943989426d4cdc7722556d56fcb594a82855 100644 (file)
@@ -796,11 +796,11 @@ static void calculate_bandwidth(
                        }
                        else if (bw_leq(data->vsr[i], bw_int_to_fixed(1))) {
                                data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_int_to_fixed(1);
-                       }
-                       else if (bw_leq(data->vsr[i], bw_int_to_fixed(4 / 3))) {
+                       } else if (bw_leq(data->vsr[i],
+                                       bw_frc_to_fixed(4, 3))) {
                                data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_div(bw_int_to_fixed(4), bw_int_to_fixed(3));
-                       }
-                       else if (bw_leq(data->vsr[i], bw_int_to_fixed(6 / 4))) {
+                       } else if (bw_leq(data->vsr[i],
+                                       bw_frc_to_fixed(6, 4))) {
                                data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_div(bw_int_to_fixed(6), bw_int_to_fixed(4));
                        }
                        else if (bw_leq(data->vsr[i], bw_int_to_fixed(2))) {