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)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Jan 2024 23:35:37 +0000 (18:35 -0500)
[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>
drivers/gpu/drm/amd/display/dc/core/dc_state.c

index 460a8010c79fef0496755ce435f4691e20c3a08e..56feee0ff01b1ef168c64d183454964e06de0e35 100644 (file)
@@ -267,7 +267,8 @@ void dc_state_construct(struct dc *dc, struct dc_state *state)
        state->clk_mgr = dc->clk_mgr;
 
        /* Initialise DIG link encoder resource tracking variables. */
-       link_enc_cfg_init(dc, state);
+       if (dc->res_pool)
+               link_enc_cfg_init(dc, state);
 }
 
 void dc_state_destruct(struct dc_state *state)