drm/amd/display: Add the MALL size in the fallback function
authorRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Mon, 4 Mar 2024 20:52:58 +0000 (13:52 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Mar 2024 17:38:12 +0000 (13:38 -0400)
[Why & How]
If the driver has issues retrieving the MALL size for the specific
hardware, it might fail since the current value is set to zero. This
commit addresses this issue by adding a simple constant value to give
the drive a chance to start.

Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@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/resource/dcn32/dcn32_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c

index ce1754cc1f4631bcb800891ab7bd74ad52a36a69..1c657fe4a9bb34481b4f5138ad260f3612189d51 100644 (file)
@@ -2048,7 +2048,8 @@ static bool dcn32_resource_construct(
        dc->caps.min_horizontal_blanking_period = 80;
        dc->caps.dmdata_alloc_size = 2048;
        dc->caps.mall_size_per_mem_channel = 4;
-       dc->caps.mall_size_total = 0;
+       /* total size = mall per channel * num channels * 1024 * 1024 */
+       dc->caps.mall_size_total = dc->caps.mall_size_per_mem_channel * dc->ctx->dc_bios->vram_info.num_chans * 1048576;
        dc->caps.cursor_cache_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size * 8;
 
        dc->caps.cache_line_size = 64;
index 296a0a8e71459f79f8478569287bd11dcae50cad..6c8129734163755678596a3651a047c697610473 100644 (file)
@@ -1697,7 +1697,9 @@ static bool dcn321_resource_construct(
        dc->caps.min_horizontal_blanking_period = 80;
        dc->caps.dmdata_alloc_size = 2048;
        dc->caps.mall_size_per_mem_channel = 4;
-       dc->caps.mall_size_total = 0;
+       /* total size = mall per channel * num channels * 1024 * 1024 */
+       dc->caps.mall_size_total = dc->caps.mall_size_per_mem_channel * dc->ctx->dc_bios->vram_info.num_chans * 1048576;
+
        dc->caps.cursor_cache_size = dc->caps.max_cursor_size * dc->caps.max_cursor_size * 8;
        dc->caps.cache_line_size = 64;
        dc->caps.cache_num_ways = 16;