OSDN Git Service

drm/amd/display: fix bw calc internal initialization error
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Tue, 14 Mar 2017 15:16:11 +0000 (11:16 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:19:57 +0000 (17:19 -0400)
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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 e477943..4820660 100644 (file)
@@ -1341,12 +1341,12 @@ static void calculate_bandwidth(
        /*initialize variables*/
        number_of_displays_enabled = 0;
        number_of_displays_enabled_with_margin = 0;
-       for (k = 0; k < maximum_number_of_surfaces; k++) {
+       for (k = 0; k <= maximum_number_of_surfaces - 1; k++) {
                if (data->enable[k]) {
                        number_of_displays_enabled = number_of_displays_enabled + 1;
                }
+               data->display_pstate_change_enable[k] = 0;
        }
-       data->display_pstate_change_enable[maximum_number_of_surfaces - 1] = 0;
        for (i = 0; i <= 2; i++) {
                for (j = 0; j <= 7; j++) {
                        data->min_dram_speed_change_margin[i][j] = bw_int_to_fixed(9999);