Skip to content

Commit 5dea214

Browse files
Chris Parkalexdeucher
authored andcommitted
drm/amd/display: Call DMUB for eDP power control
[Why] If DMUB is used, LVTMA VBIOS call can be used to control eDP instead of tranditional transmitter control. Interface is agreed with VBIOS for eDP to use this new path to program LVTMA registers. [How] Create DAL interface to send DMUB command for LVTMA as currently implemented in VBIOS. Signed-off-by: Chris Park <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 34174b8 commit 5dea214

File tree

6 files changed

+80
-2
lines changed

6 files changed

+80
-2
lines changed

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,18 @@ static enum bp_result bios_parser_enable_disp_power_gating(
11081108
action);
11091109
}
11101110

1111+
static enum bp_result bios_parser_enable_lvtma_control(
1112+
struct dc_bios *dcb,
1113+
uint8_t uc_pwr_on)
1114+
{
1115+
struct bios_parser *bp = BP_FROM_DCB(dcb);
1116+
1117+
if (!bp->cmd_tbl.enable_lvtma_control)
1118+
return BP_RESULT_FAILURE;
1119+
1120+
return bp->cmd_tbl.enable_lvtma_control(bp, uc_pwr_on);
1121+
}
1122+
11111123
static bool bios_parser_is_accelerated_mode(
11121124
struct dc_bios *dcb)
11131125
{
@@ -2208,7 +2220,9 @@ static const struct dc_vbios_funcs vbios_funcs = {
22082220
.get_board_layout_info = bios_get_board_layout_info,
22092221
.pack_data_tables = bios_parser_pack_data_tables,
22102222

2211-
.get_atom_dc_golden_table = bios_get_atom_dc_golden_table
2223+
.get_atom_dc_golden_table = bios_get_atom_dc_golden_table,
2224+
2225+
.enable_lvtma_control = bios_parser_enable_lvtma_control
22122226
};
22132227

22142228
static bool bios_parser2_construct(

drivers/gpu/drm/amd/display/dc/bios/command_table2.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,33 @@ static unsigned int get_smu_clock_info_v3_1(struct bios_parser *bp, uint8_t id)
904904
return 0;
905905
}
906906

907+
/******************************************************************************
908+
******************************************************************************
909+
**
910+
** LVTMA CONTROL
911+
**
912+
******************************************************************************
913+
*****************************************************************************/
914+
915+
static enum bp_result enable_lvtma_control(
916+
struct bios_parser *bp,
917+
uint8_t uc_pwr_on);
918+
919+
static void init_enable_lvtma_control(struct bios_parser *bp)
920+
{
921+
/* TODO add switch for table vrsion */
922+
bp->cmd_tbl.enable_lvtma_control = enable_lvtma_control;
923+
924+
}
925+
926+
static enum bp_result enable_lvtma_control(
927+
struct bios_parser *bp,
928+
uint8_t uc_pwr_on)
929+
{
930+
enum bp_result result = BP_RESULT_FAILURE;
931+
return result;
932+
}
933+
907934
void dal_firmware_parser_init_cmd_tbl(struct bios_parser *bp)
908935
{
909936
init_dig_encoder_control(bp);
@@ -919,4 +946,5 @@ void dal_firmware_parser_init_cmd_tbl(struct bios_parser *bp)
919946
init_set_dce_clock(bp);
920947
init_get_smu_clock_info(bp);
921948

949+
init_enable_lvtma_control(bp);
922950
}

drivers/gpu/drm/amd/display/dc/bios/command_table2.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ struct cmd_tbl {
9494
struct bp_set_dce_clock_parameters *bp_params);
9595
unsigned int (*get_smu_clock_info)(
9696
struct bios_parser *bp, uint8_t id);
97-
97+
enum bp_result (*enable_lvtma_control)(struct bios_parser *bp,
98+
uint8_t uc_pwr_on);
9899
};
99100

100101
void dal_firmware_parser_init_cmd_tbl(struct bios_parser *bp);

drivers/gpu/drm/amd/display/dc/dc_bios_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ struct dc_vbios_funcs {
136136

137137
enum bp_result (*get_atom_dc_golden_table)(
138138
struct dc_bios *dcb);
139+
140+
enum bp_result (*enable_lvtma_control)(
141+
struct dc_bios *bios,
142+
uint8_t uc_pwr_on);
139143
};
140144

141145
struct bios_registers {

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,17 @@ void dce110_edp_power_control(
842842
cntl.coherent = false;
843843
cntl.lanes_number = LANE_COUNT_FOUR;
844844
cntl.hpd_sel = link->link_enc->hpd_source;
845+
846+
if (ctx->dc->ctx->dmub_srv &&
847+
ctx->dc->debug.dmub_command_table) {
848+
if (cntl.action == TRANSMITTER_CONTROL_POWER_ON)
849+
bp_result = ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
850+
LVTMA_CONTROL_POWER_ON);
851+
else
852+
bp_result = ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
853+
LVTMA_CONTROL_POWER_OFF);
854+
}
855+
845856
bp_result = link_transmitter_control(ctx->dc_bios, &cntl);
846857

847858
if (!power_up)
@@ -919,8 +930,21 @@ void dce110_edp_backlight_control(
919930
/*edp 1.2*/
920931
if (cntl.action == TRANSMITTER_CONTROL_BACKLIGHT_ON)
921932
edp_receiver_ready_T7(link);
933+
934+
if (ctx->dc->ctx->dmub_srv &&
935+
ctx->dc->debug.dmub_command_table) {
936+
if (cntl.action == TRANSMITTER_CONTROL_BACKLIGHT_ON)
937+
ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
938+
LVTMA_CONTROL_LCD_BLON);
939+
else
940+
ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
941+
LVTMA_CONTROL_LCD_BLOFF);
942+
}
943+
922944
link_transmitter_control(ctx->dc_bios, &cntl);
923945

946+
947+
924948
if (enable && link->dpcd_sink_ext_caps.bits.oled)
925949
msleep(OLED_POST_T7_DELAY);
926950

drivers/gpu/drm/amd/display/include/bios_parser_types.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ enum bp_pipe_control_action {
101101
ASIC_PIPE_INIT
102102
};
103103

104+
enum bp_lvtma_control_action {
105+
LVTMA_CONTROL_LCD_BLOFF = 2,
106+
LVTMA_CONTROL_LCD_BLON = 3,
107+
LVTMA_CONTROL_POWER_ON = 12,
108+
LVTMA_CONTROL_POWER_OFF = 13
109+
};
110+
104111
struct bp_encoder_control {
105112
enum bp_encoder_control_action action;
106113
enum engine_id engine_id;

0 commit comments

Comments
 (0)