Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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]
Expose DAL interface to send DMUB command for LVTMA control that VBIOS
currently uses.

Signed-off-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Eryk Brol <eryk.brol@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Chris Park and committed by
Alex Deucher
8e1f47e6 f8c000a5

+28
+28
drivers/gpu/drm/amd/display/dc/bios/command_table2.c
··· 920 920 921 921 } 922 922 923 + static void enable_lvtma_control_dmcub( 924 + struct dc_dmub_srv *dmcub, 925 + uint8_t uc_pwr_on) 926 + { 927 + 928 + union dmub_rb_cmd cmd; 929 + 930 + memset(&cmd, 0, sizeof(cmd)); 931 + 932 + cmd.cmd_common.header.type = DMUB_CMD__VBIOS; 933 + cmd.cmd_common.header.sub_type = 934 + DMUB_CMD__VBIOS_LVTMA_CONTROL; 935 + cmd.cmd_common.cmd_buffer[0] = 936 + uc_pwr_on; 937 + 938 + dc_dmub_srv_cmd_queue(dmcub, &cmd); 939 + dc_dmub_srv_cmd_execute(dmcub); 940 + dc_dmub_srv_wait_idle(dmcub); 941 + 942 + } 943 + 923 944 static enum bp_result enable_lvtma_control( 924 945 struct bios_parser *bp, 925 946 uint8_t uc_pwr_on) 926 947 { 927 948 enum bp_result result = BP_RESULT_FAILURE; 949 + 950 + if (bp->base.ctx->dc->ctx->dmub_srv && 951 + bp->base.ctx->dc->debug.dmub_command_table) { 952 + enable_lvtma_control_dmcub(bp->base.ctx->dmub_srv, 953 + uc_pwr_on); 954 + return BP_RESULT_OK; 955 + } 928 956 return result; 929 957 } 930 958