drm/amd/display: set dram speed for all states
authorDillon Varone <dillon.varone@amd.com>
Mon, 18 Apr 2022 18:39:20 +0000 (14:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 3 Jun 2022 20:45:00 +0000 (16:45 -0400)
[WHY?]
If higher states have memory speed set to 0 MT/s currently they do not get set
to the highest value which can cause validation failures.

[HOW?]
Set unpopulated higher states to max value.

Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c

index 7772bea..3f93b1f 100644 (file)
@@ -3549,7 +3549,6 @@ static void dcn32_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw
                        dcn3_2_soc.clock_limits[i].state = i;
                        dcn3_2_soc.clock_limits[i].dcfclk_mhz = dcfclk_mhz[i];
                        dcn3_2_soc.clock_limits[i].fabricclk_mhz = dcfclk_mhz[i];
-                       dcn3_2_soc.clock_limits[i].dram_speed_mts = dram_speed_mts[i];
 
                        /* Fill all states with max values of all these clocks */
                        dcn3_2_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz;
@@ -3568,6 +3567,11 @@ static void dcn32_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw
                        else
                                dcn3_2_soc.clock_limits[i].socclk_mhz = bw_params->clk_table.entries[i].socclk_mhz;
 
+                       if (!dram_speed_mts[i] && i > 0)
+                               dcn3_2_soc.clock_limits[i].dram_speed_mts = dcn3_2_soc.clock_limits[i-1].dram_speed_mts;
+                       else
+                               dcn3_2_soc.clock_limits[i].dram_speed_mts = dram_speed_mts[i];
+
                        /* These clocks cannot come from bw_params, always fill from dcn3_2_soc[0] */
                        /* PHYCLK_D18, PHYCLK_D32 */
                        dcn3_2_soc.clock_limits[i].phyclk_d18_mhz = dcn3_2_soc.clock_limits[0].phyclk_d18_mhz;
index 0b42046..27d3aa7 100644 (file)
@@ -1899,7 +1899,6 @@ static void dcn321_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *b
                        dcn3_21_soc.clock_limits[i].state = i;
                        dcn3_21_soc.clock_limits[i].dcfclk_mhz = dcfclk_mhz[i];
                        dcn3_21_soc.clock_limits[i].fabricclk_mhz = dcfclk_mhz[i];
-                       dcn3_21_soc.clock_limits[i].dram_speed_mts = dram_speed_mts[i];
 
                        /* Fill all states with max values of all these clocks */
                        dcn3_21_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz;
@@ -1918,6 +1917,11 @@ static void dcn321_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *b
                        else
                                dcn3_21_soc.clock_limits[i].socclk_mhz = bw_params->clk_table.entries[i].socclk_mhz;
 
+                       if (!dram_speed_mts[i] && i > 0)
+                               dcn3_21_soc.clock_limits[i].dram_speed_mts = dcn3_21_soc.clock_limits[i-1].dram_speed_mts;
+                       else
+                               dcn3_21_soc.clock_limits[i].dram_speed_mts = dram_speed_mts[i];
+
                        /* These clocks cannot come from bw_params, always fill from dcn3_21_soc[0] */
                        /* PHYCLK_D18, PHYCLK_D32 */
                        dcn3_21_soc.clock_limits[i].phyclk_d18_mhz = dcn3_21_soc.clock_limits[0].phyclk_d18_mhz;