]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Init link enc resources in dc_state only if res_pool presents
authorDillon Varone <dillon.varone@amd.com>
Fri, 29 Dec 2023 02:36:39 +0000 (21:36 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:21:17 +0000 (16:21 -0800)
[ Upstream commit aa36d8971fccb55ef3241cbfff9d1799e31d8628 ]

[Why & How]
res_pool is not initialized in all situations such as virtual
environments, and therefore link encoder resources should not be
initialized if res_pool is NULL.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Martin Leung <martin.leung@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@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/core/dc_resource.c

index c16190a10883822c19d670111ad50b14cb2551e7..990d775e4cea23db3d67c3d3eb12c26605569f35 100644 (file)
@@ -3774,7 +3774,8 @@ void dc_resource_state_construct(
        dst_ctx->clk_mgr = dc->clk_mgr;
 
        /* Initialise DIG link encoder resource tracking variables. */
-       link_enc_cfg_init(dc, dst_ctx);
+       if (dc->res_pool)
+               link_enc_cfg_init(dc, dst_ctx);
 }