Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Populate socclk entries for dcn3.02/3.03

[Why]
Initialize socclk entries in bandwidth params for dcn302, dcn303.

[How]
Fetch the sockclk values from smu for the DPM levels and for the DPM
levels where smu returns 0, previous level values are reported.

Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Bindu Ramamurthy and committed by
Alex Deucher
f30f5515 d7940911

+14 -4
+4
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c
··· 190 190 &clk_mgr_base->bw_params->clk_table.entries[0].dtbclk_mhz, 191 191 &num_levels); 192 192 193 + /* SOCCLK */ 194 + dcn3_init_single_clock(clk_mgr, PPCLK_SOCCLK, 195 + &clk_mgr_base->bw_params->clk_table.entries[0].socclk_mhz, 196 + &num_levels); 193 197 // DPREFCLK ??? 194 198 195 199 /* DISPCLK */
+5 -2
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
··· 1399 1399 dcn3_02_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz; 1400 1400 dcn3_02_soc.clock_limits[i].phyclk_mhz = max_phyclk_mhz; 1401 1401 dcn3_02_soc.clock_limits[i].dtbclk_mhz = dcn3_02_soc.clock_limits[0].dtbclk_mhz; 1402 + if (!bw_params->clk_table.entries[i].socclk_mhz && i > 0) 1403 + dcn3_02_soc.clock_limits[i].socclk_mhz = dcn3_02_soc.clock_limits[i-1].socclk_mhz; 1404 + else 1405 + dcn3_02_soc.clock_limits[i].socclk_mhz = bw_params->clk_table.entries[i].socclk_mhz; 1402 1406 /* These clocks cannot come from bw_params, always fill from dcn3_02_soc[1] */ 1403 - /* FCLK, PHYCLK_D18, SOCCLK, DSCCLK */ 1407 + /* FCLK, PHYCLK_D18, DSCCLK */ 1404 1408 dcn3_02_soc.clock_limits[i].phyclk_d18_mhz = dcn3_02_soc.clock_limits[0].phyclk_d18_mhz; 1405 - dcn3_02_soc.clock_limits[i].socclk_mhz = dcn3_02_soc.clock_limits[0].socclk_mhz; 1406 1409 dcn3_02_soc.clock_limits[i].dscclk_mhz = dcn3_02_soc.clock_limits[0].dscclk_mhz; 1407 1410 } 1408 1411 /* re-init DML with updated bb */
+5 -2
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
··· 1327 1327 dcn3_03_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz; 1328 1328 dcn3_03_soc.clock_limits[i].phyclk_mhz = max_phyclk_mhz; 1329 1329 dcn3_03_soc.clock_limits[i].dtbclk_mhz = dcn3_03_soc.clock_limits[0].dtbclk_mhz; 1330 + if (!bw_params->clk_table.entries[i].socclk_mhz && i > 0) 1331 + dcn3_03_soc.clock_limits[i].socclk_mhz = dcn3_03_soc.clock_limits[i-1].socclk_mhz; 1332 + else 1333 + dcn3_03_soc.clock_limits[i].socclk_mhz = bw_params->clk_table.entries[i].socclk_mhz; 1330 1334 /* These clocks cannot come from bw_params, always fill from dcn3_03_soc[1] */ 1331 - /* FCLK, PHYCLK_D18, SOCCLK, DSCCLK */ 1335 + /* FCLK, PHYCLK_D18, DSCCLK */ 1332 1336 dcn3_03_soc.clock_limits[i].phyclk_d18_mhz = dcn3_03_soc.clock_limits[0].phyclk_d18_mhz; 1333 - dcn3_03_soc.clock_limits[i].socclk_mhz = dcn3_03_soc.clock_limits[0].socclk_mhz; 1334 1337 dcn3_03_soc.clock_limits[i].dscclk_mhz = dcn3_03_soc.clock_limits[0].dscclk_mhz; 1335 1338 } 1336 1339 /* re-init DML with updated bb */