]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: parse umc_info or vram_info based on ASIC
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Fri, 18 Oct 2024 14:52:16 +0000 (10:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:53 +0000 (20:03 +0100)
[ Upstream commit 2551b4a321a68134360b860113dd460133e856e5 ]

An upstream bug report suggests that there are production dGPUs that are
older than DCN401 but still have a umc_info in VBIOS tables with the
same version as expected for a DCN401 product. Hence, reading this
tables should be guarded with a version check.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3678
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c

index c9a6de110b742f198811bc74ef9c584cb5fe1910..902491669cbc7dfce7c7d6714cb9310102952069 100644 (file)
@@ -3127,7 +3127,9 @@ static enum bp_result bios_parser_get_vram_info(
        struct atom_data_revision revision;
 
        // vram info moved to umc_info for DCN4x
-       if (info && DATA_TABLES(umc_info)) {
+       if (dcb->ctx->dce_version >= DCN_VERSION_4_01 &&
+               dcb->ctx->dce_version < DCN_VERSION_MAX &&
+               info && DATA_TABLES(umc_info)) {
                header = GET_IMAGE(struct atom_common_table_header,
                                        DATA_TABLES(umc_info));