Commit 7a47c882 authored by Jimmy Kizito's avatar Jimmy Kizito Committed by Alex Deucher

drm/amd/display: Initialise encoder assignment when initialising dc_state

[Why]
Link encoder assignment tracking variables need to be (re)initialised
whenever dc_state is (re)initialised. Otherwise variables used for
dynamic encoder assignment (especially the link encoder availability
pool) are out of sync with dc_state and future encoder assignments are
invalid.

[How]
Initialise encoder assignment variables when creating new dc_state
resource.
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarAnson Jacob <Anson.Jacob@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarJimmy Kizito <Jimmy.Kizito@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent aadb06f9
...@@ -1016,8 +1016,6 @@ static bool dc_construct(struct dc *dc, ...@@ -1016,8 +1016,6 @@ static bool dc_construct(struct dc *dc,
goto fail; goto fail;
} }
dc_resource_state_construct(dc, dc->current_state);
if (!create_links(dc, init_params->num_virtual_links)) if (!create_links(dc, init_params->num_virtual_links))
goto fail; goto fail;
...@@ -1027,8 +1025,7 @@ static bool dc_construct(struct dc *dc, ...@@ -1027,8 +1025,7 @@ static bool dc_construct(struct dc *dc,
if (!create_link_encoders(dc)) if (!create_link_encoders(dc))
goto fail; goto fail;
/* Initialise DIG link encoder resource tracking variables. */ dc_resource_state_construct(dc, dc->current_state);
link_enc_cfg_init(dc, dc->current_state);
return true; return true;
......
...@@ -242,7 +242,7 @@ static struct link_encoder *get_link_enc_used_by_link( ...@@ -242,7 +242,7 @@ static struct link_encoder *get_link_enc_used_by_link(
return link_enc; return link_enc;
} }
/* Clear all link encoder assignments. */ /* Clear all link encoder assignments. */
static void clear_enc_assignments(struct dc *dc, struct dc_state *state) static void clear_enc_assignments(const struct dc *dc, struct dc_state *state)
{ {
int i; int i;
...@@ -261,7 +261,7 @@ static void clear_enc_assignments(struct dc *dc, struct dc_state *state) ...@@ -261,7 +261,7 @@ static void clear_enc_assignments(struct dc *dc, struct dc_state *state)
} }
void link_enc_cfg_init( void link_enc_cfg_init(
struct dc *dc, const struct dc *dc,
struct dc_state *state) struct dc_state *state)
{ {
clear_enc_assignments(dc, state); clear_enc_assignments(dc, state);
......
...@@ -2224,6 +2224,9 @@ void dc_resource_state_construct( ...@@ -2224,6 +2224,9 @@ void dc_resource_state_construct(
struct dc_state *dst_ctx) struct dc_state *dst_ctx)
{ {
dst_ctx->clk_mgr = dc->clk_mgr; dst_ctx->clk_mgr = dc->clk_mgr;
/* Initialise DIG link encoder resource tracking variables. */
link_enc_cfg_init(dc, dst_ctx);
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* Initialise link encoder resource tracking. * Initialise link encoder resource tracking.
*/ */
void link_enc_cfg_init( void link_enc_cfg_init(
struct dc *dc, const struct dc *dc,
struct dc_state *state); struct dc_state *state);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment