The BIOS parser already supports calling the DAC1EncoderControl
function from the VBIOS, but it was not exposed anywhere.
This commit enables the codebase to use encoder_control()
when the encoder engine is one of the DACs.

Signed-off-by: Timur Kristóf <timur.kris...@gmail.com>
---
 .../gpu/drm/amd/display/dc/bios/bios_parser.c    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c 
b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
index 67f08495b7e6..6914dd6944b7 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
@@ -745,6 +745,22 @@ static enum bp_result bios_parser_encoder_control(
 {
        struct bios_parser *bp = BP_FROM_DCB(dcb);
 
+       if (cntl->engine_id == ENGINE_ID_DACA) {
+               if (!bp->cmd_tbl.dac1_encoder_control)
+                       return BP_RESULT_FAILURE;
+
+               return bp->cmd_tbl.dac1_encoder_control(
+                       bp, cntl->action == ENCODER_CONTROL_ENABLE,
+                       cntl->pixel_clock, ATOM_DAC1_PS2);
+       } else if (cntl->engine_id == ENGINE_ID_DACB) {
+               if (!bp->cmd_tbl.dac2_encoder_control)
+                       return BP_RESULT_FAILURE;
+
+               return bp->cmd_tbl.dac2_encoder_control(
+                       bp, cntl->action == ENCODER_CONTROL_ENABLE,
+                       cntl->pixel_clock, ATOM_DAC1_PS2);
+       }
+
        if (!bp->cmd_tbl.dig_encoder_control)
                return BP_RESULT_FAILURE;
 
-- 
2.50.1

Reply via email to