Skip to content

Commit 4e73826

Browse files
Lewis Huangalexdeucher
authored andcommitted
drm/amd/display: Only allow dig mapping to pwrseq in new asic
[Why] The old asic only have 1 pwrseq hw. We don't need to map the diginst to pwrseq inst in old asic. [How] 1. Only mapping dig to pwrseq for new asic. 2. Move mapping function into dcn specific panel control component Cc: Stable <[email protected]> # v6.6+ Cc: Mario Limonciello <[email protected]> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3122 Reviewed-by: Anthony Koo <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Lewis Huang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 22e1dc4 commit 4e73826

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,5 @@ void dce_panel_cntl_construct(
290290
dce_panel_cntl->base.funcs = &dce_link_panel_cntl_funcs;
291291
dce_panel_cntl->base.ctx = init_data->ctx;
292292
dce_panel_cntl->base.inst = init_data->inst;
293+
dce_panel_cntl->base.pwrseq_inst = 0;
293294
}

drivers/gpu/drm/amd/display/dc/dcn301/dcn301_panel_cntl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,5 @@ void dcn301_panel_cntl_construct(
215215
dcn301_panel_cntl->base.funcs = &dcn301_link_panel_cntl_funcs;
216216
dcn301_panel_cntl->base.ctx = init_data->ctx;
217217
dcn301_panel_cntl->base.inst = init_data->inst;
218+
dcn301_panel_cntl->base.pwrseq_inst = 0;
218219
}

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,24 @@ void dcn31_panel_cntl_construct(
154154
struct dcn31_panel_cntl *dcn31_panel_cntl,
155155
const struct panel_cntl_init_data *init_data)
156156
{
157+
uint8_t pwrseq_inst = 0xF;
158+
157159
dcn31_panel_cntl->base.funcs = &dcn31_link_panel_cntl_funcs;
158160
dcn31_panel_cntl->base.ctx = init_data->ctx;
159161
dcn31_panel_cntl->base.inst = init_data->inst;
160-
dcn31_panel_cntl->base.pwrseq_inst = init_data->pwrseq_inst;
162+
163+
switch (init_data->eng_id) {
164+
case ENGINE_ID_DIGA:
165+
pwrseq_inst = 0;
166+
break;
167+
case ENGINE_ID_DIGB:
168+
pwrseq_inst = 1;
169+
break;
170+
default:
171+
DC_LOG_WARNING("Unsupported pwrseq engine id: %d!\n", init_data->eng_id);
172+
ASSERT(false);
173+
break;
174+
}
175+
176+
dcn31_panel_cntl->base.pwrseq_inst = pwrseq_inst;
161177
}

drivers/gpu/drm/amd/display/dc/inc/hw/panel_cntl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct panel_cntl_funcs {
5757
struct panel_cntl_init_data {
5858
struct dc_context *ctx;
5959
uint32_t inst;
60-
uint32_t pwrseq_inst;
60+
uint32_t eng_id;
6161
};
6262

6363
struct panel_cntl {

drivers/gpu/drm/amd/display/dc/link/link_factory.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -370,30 +370,6 @@ static enum transmitter translate_encoder_to_transmitter(
370370
}
371371
}
372372

373-
static uint8_t translate_dig_inst_to_pwrseq_inst(struct dc_link *link)
374-
{
375-
uint8_t pwrseq_inst = 0xF;
376-
struct dc_context *dc_ctx = link->dc->ctx;
377-
378-
DC_LOGGER_INIT(dc_ctx->logger);
379-
380-
switch (link->eng_id) {
381-
case ENGINE_ID_DIGA:
382-
pwrseq_inst = 0;
383-
break;
384-
case ENGINE_ID_DIGB:
385-
pwrseq_inst = 1;
386-
break;
387-
default:
388-
DC_LOG_WARNING("Unsupported pwrseq engine id: %d!\n", link->eng_id);
389-
ASSERT(false);
390-
break;
391-
}
392-
393-
return pwrseq_inst;
394-
}
395-
396-
397373
static void link_destruct(struct dc_link *link)
398374
{
399375
int i;
@@ -657,7 +633,7 @@ static bool construct_phy(struct dc_link *link,
657633
link->link_id.id == CONNECTOR_ID_LVDS)) {
658634
panel_cntl_init_data.ctx = dc_ctx;
659635
panel_cntl_init_data.inst = panel_cntl_init_data.ctx->dc_edp_id_count;
660-
panel_cntl_init_data.pwrseq_inst = translate_dig_inst_to_pwrseq_inst(link);
636+
panel_cntl_init_data.eng_id = link->eng_id;
661637
link->panel_cntl =
662638
link->dc->res_pool->funcs->panel_cntl_create(
663639
&panel_cntl_init_data);

0 commit comments

Comments
 (0)