Skip to content

Commit 9253e11

Browse files
Aurabindo Pillaialexdeucher
authored andcommitted
drm/amd/display: get socBB from VBIOS for dcn302 and dcn303
[why] Some SOC BB paramters may vary per SKU, and it does not make sense for driver to hardcode these values. This change was added for dcn30 and dcn301, but not for dcn302 and dcn303 [how] Parse the values from VBIOS if available, and use them if valid Fixes: 93669c8 ("drm/amd/display: get socBB from VBIOS") Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Bindu Ramamurthy <bindu.r@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent d8ddeb1 commit 9253e11

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,26 @@ static bool init_soc_bounding_box(struct dc *dc, struct resource_pool *pool)
11021102
loaded_ip->max_num_dpp = pool->pipe_count;
11031103
loaded_ip->clamp_min_dcfclk = dc->config.clamp_min_dcfclk;
11041104
dcn20_patch_bounding_box(dc, loaded_bb);
1105+
1106+
if (dc->ctx->dc_bios->funcs->get_soc_bb_info) {
1107+
struct bp_soc_bb_info bb_info = { 0 };
1108+
1109+
if (dc->ctx->dc_bios->funcs->get_soc_bb_info(
1110+
dc->ctx->dc_bios, &bb_info) == BP_RESULT_OK) {
1111+
if (bb_info.dram_clock_change_latency_100ns > 0)
1112+
dcn3_02_soc.dram_clock_change_latency_us =
1113+
bb_info.dram_clock_change_latency_100ns * 10;
1114+
1115+
if (bb_info.dram_sr_enter_exit_latency_100ns > 0)
1116+
dcn3_02_soc.sr_enter_plus_exit_time_us =
1117+
bb_info.dram_sr_enter_exit_latency_100ns * 10;
1118+
1119+
if (bb_info.dram_sr_exit_latency_100ns > 0)
1120+
dcn3_02_soc.sr_exit_time_us =
1121+
bb_info.dram_sr_exit_latency_100ns * 10;
1122+
}
1123+
}
1124+
11051125
return true;
11061126
}
11071127

drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,26 @@ static bool init_soc_bounding_box(struct dc *dc, struct resource_pool *pool)
10281028
loaded_ip->max_num_dpp = pool->pipe_count;
10291029
loaded_ip->clamp_min_dcfclk = dc->config.clamp_min_dcfclk;
10301030
dcn20_patch_bounding_box(dc, loaded_bb);
1031+
1032+
if (dc->ctx->dc_bios->funcs->get_soc_bb_info) {
1033+
struct bp_soc_bb_info bb_info = { 0 };
1034+
1035+
if (dc->ctx->dc_bios->funcs->get_soc_bb_info(
1036+
dc->ctx->dc_bios, &bb_info) == BP_RESULT_OK) {
1037+
if (bb_info.dram_clock_change_latency_100ns > 0)
1038+
dcn3_03_soc.dram_clock_change_latency_us =
1039+
bb_info.dram_clock_change_latency_100ns * 10;
1040+
1041+
if (bb_info.dram_sr_enter_exit_latency_100ns > 0)
1042+
dcn3_03_soc.sr_enter_plus_exit_time_us =
1043+
bb_info.dram_sr_enter_exit_latency_100ns * 10;
1044+
1045+
if (bb_info.dram_sr_exit_latency_100ns > 0)
1046+
dcn3_03_soc.sr_exit_time_us =
1047+
bb_info.dram_sr_exit_latency_100ns * 10;
1048+
}
1049+
}
1050+
10311051
return true;
10321052
}
10331053

0 commit comments

Comments
 (0)