]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: fix dcn315 memory channel count and width read
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Tue, 30 Aug 2022 19:16:40 +0000 (15:16 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Sep 2022 21:18:39 +0000 (17:18 -0400)
[Why & How]
Correctly set ddr5 channel width to 8 bytes

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c

index cc076621f5e66a3931a1f11d17c863354c7f10f1..8c7daffdeae4115766906f7f35986e583abf99e8 100644 (file)
@@ -556,8 +556,7 @@ static void dcn315_clk_mgr_helper_populate_bw_params(
        ASSERT(bw_params->clk_table.entries[i-1].dcfclk_mhz);
        bw_params->vram_type = bios_info->memory_type;
        bw_params->num_channels = bios_info->ma_channel_number;
-       if (!bw_params->num_channels)
-               bw_params->num_channels = 2;
+       bw_params->dram_channel_width_bytes = bios_info->memory_type == 0x22 ? 8 : 4;
 
        for (i = 0; i < WM_SET_COUNT; i++) {
                bw_params->wm_table.entries[i].wm_inst = i;
index 149a1b17cdf3f34fa26c13fd78ab253da3630dd3..fa7b0291ce4d6e7e1ede80a06e504a137c94f6b0 100644 (file)
@@ -291,6 +291,7 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_15_soc = {
        .do_urgent_latency_adjustment = false,
        .urgent_latency_adjustment_fabric_clock_component_us = 0,
        .urgent_latency_adjustment_fabric_clock_reference_mhz = 0,
+       .num_chans = 4,
 };
 
 struct _vcs_dpi_ip_params_st dcn3_16_ip = {
@@ -680,7 +681,11 @@ void dcn315_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
 
        dcn3_15_ip.max_num_otg = dc->res_pool->res_cap->num_timing_generator;
        dcn3_15_ip.max_num_dpp = dc->res_pool->pipe_count;
-       dcn3_15_soc.num_chans = bw_params->num_channels;
+
+       if (bw_params->num_channels > 0)
+               dcn3_15_soc.num_chans = bw_params->num_channels;
+       if (bw_params->dram_channel_width_bytes > 0)
+               dcn3_15_soc.dram_channel_width_bytes = bw_params->dram_channel_width_bytes;
 
        ASSERT(clk_table->num_entries);