2 * Copyright 2012-15 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #include <linux/delay.h>
28 #include "reg_helper.h"
30 #include "core_types.h"
31 #include "link_encoder.h"
32 #include "dce_link_encoder.h"
33 #include "stream_encoder.h"
34 #include "i2caux_interface.h"
35 #include "dc_bios_types.h"
37 #include "gpio_service_interface.h"
39 #include "dce/dce_11_0_d.h"
40 #include "dce/dce_11_0_sh_mask.h"
41 #include "dce/dce_11_0_enum.h"
43 #ifndef DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE__SHIFT
44 #define DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE__SHIFT 0xa
47 #ifndef DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE_MASK
48 #define DMU_MEM_PWR_CNTL__DMCU_IRAM_MEM_PWR_STATE_MASK 0x00000400L
51 #ifndef HPD0_DC_HPD_CONTROL__DC_HPD_EN_MASK
52 #define HPD0_DC_HPD_CONTROL__DC_HPD_EN_MASK 0x10000000L
55 #ifndef HPD0_DC_HPD_CONTROL__DC_HPD_EN__SHIFT
56 #define HPD0_DC_HPD_CONTROL__DC_HPD_EN__SHIFT 0x1c
62 enc110->base.ctx->logger
65 (enc110->link_regs->reg)
68 (enc110->aux_regs->reg)
71 (enc110->hpd_regs->reg)
73 #define DEFAULT_AUX_MAX_DATA_SIZE 16
74 #define AUX_MAX_DEFER_WRITE_RETRY 20
77 * Trigger Source Select
78 * ASIC-dependent, actual values for register programming
80 #define DCE110_DIG_FE_SOURCE_SELECT_INVALID 0x0
81 #define DCE110_DIG_FE_SOURCE_SELECT_DIGA 0x1
82 #define DCE110_DIG_FE_SOURCE_SELECT_DIGB 0x2
83 #define DCE110_DIG_FE_SOURCE_SELECT_DIGC 0x4
84 #define DCE110_DIG_FE_SOURCE_SELECT_DIGD 0x08
85 #define DCE110_DIG_FE_SOURCE_SELECT_DIGE 0x10
86 #define DCE110_DIG_FE_SOURCE_SELECT_DIGF 0x20
87 #define DCE110_DIG_FE_SOURCE_SELECT_DIGG 0x40
90 DP_MST_UPDATE_MAX_RETRY = 50
94 (reg + enc110->offsets.dig)
97 (reg + enc110->offsets.dp)
99 static const struct link_encoder_funcs dce110_lnk_enc_funcs = {
100 .validate_output_with_stream =
101 dce110_link_encoder_validate_output_with_stream,
102 .hw_init = dce110_link_encoder_hw_init,
103 .setup = dce110_link_encoder_setup,
104 .enable_tmds_output = dce110_link_encoder_enable_tmds_output,
105 .enable_dp_output = dce110_link_encoder_enable_dp_output,
106 .enable_dp_mst_output = dce110_link_encoder_enable_dp_mst_output,
107 .enable_lvds_output = dce110_link_encoder_enable_lvds_output,
108 .disable_output = dce110_link_encoder_disable_output,
109 .dp_set_lane_settings = dce110_link_encoder_dp_set_lane_settings,
110 .dp_set_phy_pattern = dce110_link_encoder_dp_set_phy_pattern,
111 .update_mst_stream_allocation_table =
112 dce110_link_encoder_update_mst_stream_allocation_table,
113 .psr_program_dp_dphy_fast_training =
114 dce110_psr_program_dp_dphy_fast_training,
115 .psr_program_secondary_packet = dce110_psr_program_secondary_packet,
116 .connect_dig_be_to_fe = dce110_link_encoder_connect_dig_be_to_fe,
117 .enable_hpd = dce110_link_encoder_enable_hpd,
118 .disable_hpd = dce110_link_encoder_disable_hpd,
119 .is_dig_enabled = dce110_is_dig_enabled,
120 .destroy = dce110_link_encoder_destroy
123 static enum bp_result link_transmitter_control(
124 struct dce110_link_encoder *enc110,
125 struct bp_transmitter_control *cntl)
127 enum bp_result result;
128 struct dc_bios *bp = enc110->base.ctx->dc_bios;
130 result = bp->funcs->transmitter_control(bp, cntl);
135 static void enable_phy_bypass_mode(
136 struct dce110_link_encoder *enc110,
139 /* This register resides in DP back end block;
140 * transmitter is used for the offset */
142 REG_UPDATE(DP_DPHY_CNTL, DPHY_BYPASS, enable);
146 static void disable_prbs_symbols(
147 struct dce110_link_encoder *enc110,
150 /* This register resides in DP back end block;
151 * transmitter is used for the offset */
153 REG_UPDATE_4(DP_DPHY_CNTL,
154 DPHY_ATEST_SEL_LANE0, disable,
155 DPHY_ATEST_SEL_LANE1, disable,
156 DPHY_ATEST_SEL_LANE2, disable,
157 DPHY_ATEST_SEL_LANE3, disable);
160 static void disable_prbs_mode(
161 struct dce110_link_encoder *enc110)
163 REG_UPDATE(DP_DPHY_PRBS_CNTL, DPHY_PRBS_EN, 0);
166 static void program_pattern_symbols(
167 struct dce110_link_encoder *enc110,
168 uint16_t pattern_symbols[8])
170 /* This register resides in DP back end block;
171 * transmitter is used for the offset */
173 REG_SET_3(DP_DPHY_SYM0, 0,
174 DPHY_SYM1, pattern_symbols[0],
175 DPHY_SYM2, pattern_symbols[1],
176 DPHY_SYM3, pattern_symbols[2]);
178 /* This register resides in DP back end block;
179 * transmitter is used for the offset */
181 REG_SET_3(DP_DPHY_SYM1, 0,
182 DPHY_SYM4, pattern_symbols[3],
183 DPHY_SYM5, pattern_symbols[4],
184 DPHY_SYM6, pattern_symbols[5]);
186 /* This register resides in DP back end block;
187 * transmitter is used for the offset */
189 REG_SET_2(DP_DPHY_SYM2, 0,
190 DPHY_SYM7, pattern_symbols[6],
191 DPHY_SYM8, pattern_symbols[7]);
194 static void set_dp_phy_pattern_d102(
195 struct dce110_link_encoder *enc110)
197 /* Disable PHY Bypass mode to setup the test pattern */
198 enable_phy_bypass_mode(enc110, false);
200 /* For 10-bit PRBS or debug symbols
201 * please use the following sequence: */
203 /* Enable debug symbols on the lanes */
205 disable_prbs_symbols(enc110, true);
207 /* Disable PRBS mode */
208 disable_prbs_mode(enc110);
210 /* Program debug symbols to be output */
212 uint16_t pattern_symbols[8] = {
213 0x2AA, 0x2AA, 0x2AA, 0x2AA,
214 0x2AA, 0x2AA, 0x2AA, 0x2AA
217 program_pattern_symbols(enc110, pattern_symbols);
220 /* Enable phy bypass mode to enable the test pattern */
222 enable_phy_bypass_mode(enc110, true);
225 static void set_link_training_complete(
226 struct dce110_link_encoder *enc110,
229 /* This register resides in DP back end block;
230 * transmitter is used for the offset */
232 REG_UPDATE(DP_LINK_CNTL, DP_LINK_TRAINING_COMPLETE, complete);
236 void dce110_link_encoder_set_dp_phy_pattern_training_pattern(
237 struct link_encoder *enc,
240 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
241 /* Write Training Pattern */
243 REG_WRITE(DP_DPHY_TRAINING_PATTERN_SEL, index);
245 /* Set HW Register Training Complete to false */
247 set_link_training_complete(enc110, false);
249 /* Disable PHY Bypass mode to output Training Pattern */
251 enable_phy_bypass_mode(enc110, false);
253 /* Disable PRBS mode */
254 disable_prbs_mode(enc110);
257 static void setup_panel_mode(
258 struct dce110_link_encoder *enc110,
259 enum dp_panel_mode panel_mode)
262 struct dc_context *ctx = enc110->base.ctx;
264 /* if psp set panel mode, dal should be program it */
265 if (ctx->dc->caps.psp_setup_panel_mode)
268 ASSERT(REG(DP_DPHY_INTERNAL_CTRL));
269 value = REG_READ(DP_DPHY_INTERNAL_CTRL);
271 switch (panel_mode) {
272 case DP_PANEL_MODE_EDP:
275 case DP_PANEL_MODE_SPECIAL:
283 REG_WRITE(DP_DPHY_INTERNAL_CTRL, value);
286 static void set_dp_phy_pattern_symbol_error(
287 struct dce110_link_encoder *enc110)
289 /* Disable PHY Bypass mode to setup the test pattern */
290 enable_phy_bypass_mode(enc110, false);
292 /* program correct panel mode*/
293 setup_panel_mode(enc110, DP_PANEL_MODE_DEFAULT);
295 /* A PRBS23 pattern is used for most DP electrical measurements. */
297 /* Enable PRBS symbols on the lanes */
298 disable_prbs_symbols(enc110, false);
300 /* For PRBS23 Set bit DPHY_PRBS_SEL=1 and Set bit DPHY_PRBS_EN=1 */
301 REG_UPDATE_2(DP_DPHY_PRBS_CNTL,
305 /* Enable phy bypass mode to enable the test pattern */
306 enable_phy_bypass_mode(enc110, true);
309 static void set_dp_phy_pattern_prbs7(
310 struct dce110_link_encoder *enc110)
312 /* Disable PHY Bypass mode to setup the test pattern */
313 enable_phy_bypass_mode(enc110, false);
315 /* A PRBS7 pattern is used for most DP electrical measurements. */
317 /* Enable PRBS symbols on the lanes */
318 disable_prbs_symbols(enc110, false);
320 /* For PRBS7 Set bit DPHY_PRBS_SEL=0 and Set bit DPHY_PRBS_EN=1 */
321 REG_UPDATE_2(DP_DPHY_PRBS_CNTL,
325 /* Enable phy bypass mode to enable the test pattern */
326 enable_phy_bypass_mode(enc110, true);
329 static void set_dp_phy_pattern_80bit_custom(
330 struct dce110_link_encoder *enc110,
331 const uint8_t *pattern)
333 /* Disable PHY Bypass mode to setup the test pattern */
334 enable_phy_bypass_mode(enc110, false);
336 /* Enable debug symbols on the lanes */
338 disable_prbs_symbols(enc110, true);
340 /* Enable PHY bypass mode to enable the test pattern */
341 /* TODO is it really needed ? */
343 enable_phy_bypass_mode(enc110, true);
345 /* Program 80 bit custom pattern */
347 uint16_t pattern_symbols[8];
350 ((pattern[1] & 0x03) << 8) | pattern[0];
352 ((pattern[2] & 0x0f) << 6) | ((pattern[1] >> 2) & 0x3f);
354 ((pattern[3] & 0x3f) << 4) | ((pattern[2] >> 4) & 0x0f);
356 (pattern[4] << 2) | ((pattern[3] >> 6) & 0x03);
358 ((pattern[6] & 0x03) << 8) | pattern[5];
360 ((pattern[7] & 0x0f) << 6) | ((pattern[6] >> 2) & 0x3f);
362 ((pattern[8] & 0x3f) << 4) | ((pattern[7] >> 4) & 0x0f);
364 (pattern[9] << 2) | ((pattern[8] >> 6) & 0x03);
366 program_pattern_symbols(enc110, pattern_symbols);
369 /* Enable phy bypass mode to enable the test pattern */
371 enable_phy_bypass_mode(enc110, true);
374 static void set_dp_phy_pattern_hbr2_compliance_cp2520_2(
375 struct dce110_link_encoder *enc110,
376 unsigned int cp2520_pattern)
379 /* previously there is a register DP_HBR2_EYE_PATTERN
380 * that is enabled to get the pattern.
381 * But it does not work with the latest spec change,
382 * so we are programming the following registers manually.
384 * The following settings have been confirmed
385 * by Nick Chorney and Sandra Liu */
387 /* Disable PHY Bypass mode to setup the test pattern */
389 enable_phy_bypass_mode(enc110, false);
391 /* Setup DIG encoder in DP SST mode */
392 enc110->base.funcs->setup(&enc110->base, SIGNAL_TYPE_DISPLAY_PORT);
394 /* ensure normal panel mode. */
395 setup_panel_mode(enc110, DP_PANEL_MODE_DEFAULT);
397 /* no vbid after BS (SR)
398 * DP_LINK_FRAMING_CNTL changed history Sandra Liu
399 * 11000260 / 11000104 / 110000FC */
400 REG_UPDATE_3(DP_LINK_FRAMING_CNTL,
401 DP_IDLE_BS_INTERVAL, 0xFC,
403 DP_VID_ENHANCED_FRAME_MODE, 1);
405 /* swap every BS with SR */
406 REG_UPDATE(DP_DPHY_SCRAM_CNTL, DPHY_SCRAMBLER_BS_COUNT, 0);
408 /* select cp2520 patterns */
409 if (REG(DP_DPHY_HBR2_PATTERN_CONTROL))
410 REG_UPDATE(DP_DPHY_HBR2_PATTERN_CONTROL,
411 DP_DPHY_HBR2_PATTERN_CONTROL, cp2520_pattern);
413 /* pre-DCE11 can only generate CP2520 pattern 2 */
414 ASSERT(cp2520_pattern == 2);
416 /* set link training complete */
417 set_link_training_complete(enc110, true);
419 /* disable video stream */
420 REG_UPDATE(DP_VID_STREAM_CNTL, DP_VID_STREAM_ENABLE, 0);
422 /* Disable PHY Bypass mode to setup the test pattern */
423 enable_phy_bypass_mode(enc110, false);
426 static void set_dp_phy_pattern_passthrough_mode(
427 struct dce110_link_encoder *enc110,
428 enum dp_panel_mode panel_mode)
430 /* program correct panel mode */
431 setup_panel_mode(enc110, panel_mode);
433 /* restore LINK_FRAMING_CNTL and DPHY_SCRAMBLER_BS_COUNT
434 * in case we were doing HBR2 compliance pattern before
436 REG_UPDATE_3(DP_LINK_FRAMING_CNTL,
437 DP_IDLE_BS_INTERVAL, 0x2000,
439 DP_VID_ENHANCED_FRAME_MODE, 1);
441 REG_UPDATE(DP_DPHY_SCRAM_CNTL, DPHY_SCRAMBLER_BS_COUNT, 0x1FF);
443 /* set link training complete */
444 set_link_training_complete(enc110, true);
446 /* Disable PHY Bypass mode to setup the test pattern */
447 enable_phy_bypass_mode(enc110, false);
449 /* Disable PRBS mode */
450 disable_prbs_mode(enc110);
453 /* return value is bit-vector */
454 static uint8_t get_frontend_source(
455 enum engine_id engine)
459 return DCE110_DIG_FE_SOURCE_SELECT_DIGA;
461 return DCE110_DIG_FE_SOURCE_SELECT_DIGB;
463 return DCE110_DIG_FE_SOURCE_SELECT_DIGC;
465 return DCE110_DIG_FE_SOURCE_SELECT_DIGD;
467 return DCE110_DIG_FE_SOURCE_SELECT_DIGE;
469 return DCE110_DIG_FE_SOURCE_SELECT_DIGF;
471 return DCE110_DIG_FE_SOURCE_SELECT_DIGG;
473 ASSERT_CRITICAL(false);
474 return DCE110_DIG_FE_SOURCE_SELECT_INVALID;
478 static void configure_encoder(
479 struct dce110_link_encoder *enc110,
480 const struct dc_link_settings *link_settings)
482 /* set number of lanes */
484 REG_SET(DP_CONFIG, 0,
485 DP_UDI_LANES, link_settings->lane_count - LANE_COUNT_ONE);
487 /* setup scrambler */
488 REG_UPDATE(DP_DPHY_SCRAM_CNTL, DPHY_SCRAMBLER_ADVANCE, 1);
491 static void aux_initialize(
492 struct dce110_link_encoder *enc110)
494 struct dc_context *ctx = enc110->base.ctx;
495 enum hpd_source_id hpd_source = enc110->base.hpd_source;
496 uint32_t addr = AUX_REG(AUX_CONTROL);
497 uint32_t value = dm_read_reg(ctx, addr);
499 set_reg_field_value(value, hpd_source, AUX_CONTROL, AUX_HPD_SEL);
500 set_reg_field_value(value, 0, AUX_CONTROL, AUX_LS_READ_EN);
501 dm_write_reg(ctx, addr, value);
503 addr = AUX_REG(AUX_DPHY_RX_CONTROL0);
504 value = dm_read_reg(ctx, addr);
506 /* 1/4 window (the maximum allowed) */
507 set_reg_field_value(value, 1,
508 AUX_DPHY_RX_CONTROL0, AUX_RX_RECEIVE_WINDOW);
509 dm_write_reg(ctx, addr, value);
513 void dce110_psr_program_dp_dphy_fast_training(struct link_encoder *enc,
514 bool exit_link_training_required)
516 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
518 if (exit_link_training_required)
519 REG_UPDATE(DP_DPHY_FAST_TRAINING,
520 DPHY_RX_FAST_TRAINING_CAPABLE, 1);
522 REG_UPDATE(DP_DPHY_FAST_TRAINING,
523 DPHY_RX_FAST_TRAINING_CAPABLE, 0);
524 /*In DCE 11, we are able to pre-program a Force SR register
525 * to be able to trigger SR symbol after 5 idle patterns
526 * transmitted. Upon PSR Exit, DMCU can trigger
527 * DPHY_LOAD_BS_COUNT_START = 1. Upon writing 1 to
528 * DPHY_LOAD_BS_COUNT_START and the internal counter
529 * reaches DPHY_LOAD_BS_COUNT, the next BS symbol will be
530 * replaced by SR symbol once.
533 REG_UPDATE(DP_DPHY_BS_SR_SWAP_CNTL, DPHY_LOAD_BS_COUNT, 0x5);
537 void dce110_psr_program_secondary_packet(struct link_encoder *enc,
538 unsigned int sdp_transmit_line_num_deadline)
540 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
542 REG_UPDATE_2(DP_SEC_CNTL1,
543 DP_SEC_GSP0_LINE_NUM, sdp_transmit_line_num_deadline,
544 DP_SEC_GSP0_PRIORITY, 1);
547 bool dce110_is_dig_enabled(struct link_encoder *enc)
549 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
552 REG_GET(DIG_BE_EN_CNTL, DIG_ENABLE, &value);
556 static void link_encoder_disable(struct dce110_link_encoder *enc110)
558 /* reset training pattern */
559 REG_SET(DP_DPHY_TRAINING_PATTERN_SEL, 0,
560 DPHY_TRAINING_PATTERN_SEL, 0);
562 /* reset training complete */
563 REG_UPDATE(DP_LINK_CNTL, DP_LINK_TRAINING_COMPLETE, 0);
565 /* reset panel mode */
566 setup_panel_mode(enc110, DP_PANEL_MODE_DEFAULT);
569 static void hpd_initialize(
570 struct dce110_link_encoder *enc110)
572 /* Associate HPD with DIG_BE */
573 enum hpd_source_id hpd_source = enc110->base.hpd_source;
575 REG_UPDATE(DIG_BE_CNTL, DIG_HPD_SELECT, hpd_source);
578 bool dce110_link_encoder_validate_dvi_output(
579 const struct dce110_link_encoder *enc110,
580 enum signal_type connector_signal,
581 enum signal_type signal,
582 const struct dc_crtc_timing *crtc_timing)
584 uint32_t max_pixel_clock = TMDS_MAX_PIXEL_CLOCK;
586 if (signal == SIGNAL_TYPE_DVI_DUAL_LINK)
587 max_pixel_clock *= 2;
589 /* This handles the case of HDMI downgrade to DVI we don't want to
590 * we don't want to cap the pixel clock if the DDI is not DVI.
592 if (connector_signal != SIGNAL_TYPE_DVI_DUAL_LINK &&
593 connector_signal != SIGNAL_TYPE_DVI_SINGLE_LINK)
594 max_pixel_clock = enc110->base.features.max_hdmi_pixel_clock;
596 /* DVI only support RGB pixel encoding */
597 if (crtc_timing->pixel_encoding != PIXEL_ENCODING_RGB)
600 /*connect DVI via adpater's HDMI connector*/
601 if ((connector_signal == SIGNAL_TYPE_DVI_SINGLE_LINK ||
602 connector_signal == SIGNAL_TYPE_HDMI_TYPE_A) &&
603 signal != SIGNAL_TYPE_HDMI_TYPE_A &&
604 crtc_timing->pix_clk_100hz > (TMDS_MAX_PIXEL_CLOCK * 10))
606 if (crtc_timing->pix_clk_100hz < (TMDS_MIN_PIXEL_CLOCK * 10))
609 if (crtc_timing->pix_clk_100hz > (max_pixel_clock * 10))
612 /* DVI supports 6/8bpp single-link and 10/16bpp dual-link */
613 switch (crtc_timing->display_color_depth) {
614 case COLOR_DEPTH_666:
615 case COLOR_DEPTH_888:
617 case COLOR_DEPTH_101010:
618 case COLOR_DEPTH_161616:
619 if (signal != SIGNAL_TYPE_DVI_DUAL_LINK)
629 static bool dce110_link_encoder_validate_hdmi_output(
630 const struct dce110_link_encoder *enc110,
631 const struct dc_crtc_timing *crtc_timing,
632 int adjusted_pix_clk_khz)
634 enum dc_color_depth max_deep_color =
635 enc110->base.features.max_hdmi_deep_color;
637 if (max_deep_color < crtc_timing->display_color_depth)
640 if (crtc_timing->display_color_depth < COLOR_DEPTH_888)
642 if (adjusted_pix_clk_khz < TMDS_MIN_PIXEL_CLOCK)
645 if ((adjusted_pix_clk_khz == 0) ||
646 (adjusted_pix_clk_khz > enc110->base.features.max_hdmi_pixel_clock))
649 /* DCE11 HW does not support 420 */
650 if (!enc110->base.features.hdmi_ycbcr420_supported &&
651 crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
654 if (!enc110->base.features.flags.bits.HDMI_6GB_EN &&
655 adjusted_pix_clk_khz >= 300000)
657 if (enc110->base.ctx->dc->debug.hdmi20_disable &&
658 crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
663 bool dce110_link_encoder_validate_dp_output(
664 const struct dce110_link_encoder *enc110,
665 const struct dc_crtc_timing *crtc_timing)
667 if (crtc_timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
673 void dce110_link_encoder_construct(
674 struct dce110_link_encoder *enc110,
675 const struct encoder_init_data *init_data,
676 const struct encoder_feature_support *enc_features,
677 const struct dce110_link_enc_registers *link_regs,
678 const struct dce110_link_enc_aux_registers *aux_regs,
679 const struct dce110_link_enc_hpd_registers *hpd_regs)
681 struct bp_encoder_cap_info bp_cap_info = {0};
682 const struct dc_vbios_funcs *bp_funcs = init_data->ctx->dc_bios->funcs;
683 enum bp_result result = BP_RESULT_OK;
685 enc110->base.funcs = &dce110_lnk_enc_funcs;
686 enc110->base.ctx = init_data->ctx;
687 enc110->base.id = init_data->encoder;
689 enc110->base.hpd_source = init_data->hpd_source;
690 enc110->base.connector = init_data->connector;
692 enc110->base.preferred_engine = ENGINE_ID_UNKNOWN;
694 enc110->base.features = *enc_features;
696 enc110->base.transmitter = init_data->transmitter;
698 /* set the flag to indicate whether driver poll the I2C data pin
699 * while doing the DP sink detect
702 /* if (dal_adapter_service_is_feature_supported(as,
703 FEATURE_DP_SINK_DETECT_POLL_DATA_PIN))
704 enc110->base.features.flags.bits.
705 DP_SINK_DETECT_POLL_DATA_PIN = true;*/
707 enc110->base.output_signals =
708 SIGNAL_TYPE_DVI_SINGLE_LINK |
709 SIGNAL_TYPE_DVI_DUAL_LINK |
711 SIGNAL_TYPE_DISPLAY_PORT |
712 SIGNAL_TYPE_DISPLAY_PORT_MST |
714 SIGNAL_TYPE_HDMI_TYPE_A;
716 /* For DCE 8.0 and 8.1, by design, UNIPHY is hardwired to DIG_BE.
717 * SW always assign DIG_FE 1:1 mapped to DIG_FE for non-MST UNIPHY.
718 * SW assign DIG_FE to non-MST UNIPHY first and MST last. So prefer
719 * DIG is per UNIPHY and used by SST DP, eDP, HDMI, DVI and LVDS.
720 * Prefer DIG assignment is decided by board design.
721 * For DCE 8.0, there are only max 6 UNIPHYs, we assume board design
722 * and VBIOS will filter out 7 UNIPHY for DCE 8.0.
723 * By this, adding DIGG should not hurt DCE 8.0.
724 * This will let DCE 8.1 share DCE 8.0 as much as possible
727 enc110->link_regs = link_regs;
728 enc110->aux_regs = aux_regs;
729 enc110->hpd_regs = hpd_regs;
731 switch (enc110->base.transmitter) {
732 case TRANSMITTER_UNIPHY_A:
733 enc110->base.preferred_engine = ENGINE_ID_DIGA;
735 case TRANSMITTER_UNIPHY_B:
736 enc110->base.preferred_engine = ENGINE_ID_DIGB;
738 case TRANSMITTER_UNIPHY_C:
739 enc110->base.preferred_engine = ENGINE_ID_DIGC;
741 case TRANSMITTER_UNIPHY_D:
742 enc110->base.preferred_engine = ENGINE_ID_DIGD;
744 case TRANSMITTER_UNIPHY_E:
745 enc110->base.preferred_engine = ENGINE_ID_DIGE;
747 case TRANSMITTER_UNIPHY_F:
748 enc110->base.preferred_engine = ENGINE_ID_DIGF;
750 case TRANSMITTER_UNIPHY_G:
751 enc110->base.preferred_engine = ENGINE_ID_DIGG;
754 ASSERT_CRITICAL(false);
755 enc110->base.preferred_engine = ENGINE_ID_UNKNOWN;
758 /* default to one to mirror Windows behavior */
759 enc110->base.features.flags.bits.HDMI_6GB_EN = 1;
761 result = bp_funcs->get_encoder_cap_info(enc110->base.ctx->dc_bios,
762 enc110->base.id, &bp_cap_info);
764 /* Override features with DCE-specific values */
765 if (BP_RESULT_OK == result) {
766 enc110->base.features.flags.bits.IS_HBR2_CAPABLE =
767 bp_cap_info.DP_HBR2_EN;
768 enc110->base.features.flags.bits.IS_HBR3_CAPABLE =
769 bp_cap_info.DP_HBR3_EN;
770 enc110->base.features.flags.bits.HDMI_6GB_EN = bp_cap_info.HDMI_6GB_EN;
772 DC_LOG_WARNING("%s: Failed to get encoder_cap_info from VBIOS with error code %d!\n",
776 if (enc110->base.ctx->dc->debug.hdmi20_disable) {
777 enc110->base.features.flags.bits.HDMI_6GB_EN = 0;
781 bool dce110_link_encoder_validate_output_with_stream(
782 struct link_encoder *enc,
783 const struct dc_stream_state *stream)
785 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
788 switch (stream->signal) {
789 case SIGNAL_TYPE_DVI_SINGLE_LINK:
790 case SIGNAL_TYPE_DVI_DUAL_LINK:
791 is_valid = dce110_link_encoder_validate_dvi_output(
793 stream->link->connector_signal,
797 case SIGNAL_TYPE_HDMI_TYPE_A:
798 is_valid = dce110_link_encoder_validate_hdmi_output(
801 stream->phy_pix_clk);
803 case SIGNAL_TYPE_DISPLAY_PORT:
804 case SIGNAL_TYPE_DISPLAY_PORT_MST:
805 is_valid = dce110_link_encoder_validate_dp_output(
806 enc110, &stream->timing);
808 case SIGNAL_TYPE_EDP:
809 case SIGNAL_TYPE_LVDS:
812 pixel_encoding == PIXEL_ENCODING_RGB) ? true : false;
814 case SIGNAL_TYPE_VIRTUAL:
825 void dce110_link_encoder_hw_init(
826 struct link_encoder *enc)
828 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
829 struct bp_transmitter_control cntl = { 0 };
830 enum bp_result result;
832 cntl.action = TRANSMITTER_CONTROL_INIT;
833 cntl.engine_id = ENGINE_ID_UNKNOWN;
834 cntl.transmitter = enc110->base.transmitter;
835 cntl.connector_obj_id = enc110->base.connector;
836 cntl.lanes_number = LANE_COUNT_FOUR;
837 cntl.coherent = false;
838 cntl.hpd_sel = enc110->base.hpd_source;
840 if (enc110->base.connector.id == CONNECTOR_ID_EDP)
841 cntl.signal = SIGNAL_TYPE_EDP;
843 result = link_transmitter_control(enc110, &cntl);
845 if (result != BP_RESULT_OK) {
846 DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
852 if (enc110->base.connector.id == CONNECTOR_ID_LVDS) {
853 cntl.action = TRANSMITTER_CONTROL_BACKLIGHT_BRIGHTNESS;
855 result = link_transmitter_control(enc110, &cntl);
857 ASSERT(result == BP_RESULT_OK);
860 aux_initialize(enc110);
863 * hpd_initialize() will pass DIG_FE id to HW context.
864 * All other routine within HW context will use fe_engine_offset
865 * as DIG_FE id even caller pass DIG_FE id.
866 * So this routine must be called first. */
867 hpd_initialize(enc110);
870 void dce110_link_encoder_destroy(struct link_encoder **enc)
872 kfree(TO_DCE110_LINK_ENC(*enc));
876 void dce110_link_encoder_setup(
877 struct link_encoder *enc,
878 enum signal_type signal)
880 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
883 case SIGNAL_TYPE_EDP:
884 case SIGNAL_TYPE_DISPLAY_PORT:
886 REG_UPDATE(DIG_BE_CNTL, DIG_MODE, 0);
888 case SIGNAL_TYPE_LVDS:
890 REG_UPDATE(DIG_BE_CNTL, DIG_MODE, 1);
892 case SIGNAL_TYPE_DVI_SINGLE_LINK:
893 case SIGNAL_TYPE_DVI_DUAL_LINK:
895 REG_UPDATE(DIG_BE_CNTL, DIG_MODE, 2);
897 case SIGNAL_TYPE_HDMI_TYPE_A:
899 REG_UPDATE(DIG_BE_CNTL, DIG_MODE, 3);
901 case SIGNAL_TYPE_DISPLAY_PORT_MST:
903 REG_UPDATE(DIG_BE_CNTL, DIG_MODE, 5);
906 ASSERT_CRITICAL(false);
913 /* TODO: still need depth or just pass in adjusted pixel clock? */
914 void dce110_link_encoder_enable_tmds_output(
915 struct link_encoder *enc,
916 enum clock_source_id clock_source,
917 enum dc_color_depth color_depth,
918 enum signal_type signal,
919 uint32_t pixel_clock)
921 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
922 struct bp_transmitter_control cntl = { 0 };
923 enum bp_result result;
926 cntl.connector_obj_id = enc110->base.connector;
927 cntl.action = TRANSMITTER_CONTROL_ENABLE;
928 cntl.engine_id = enc->preferred_engine;
929 cntl.transmitter = enc110->base.transmitter;
930 cntl.pll_id = clock_source;
931 cntl.signal = signal;
932 if (cntl.signal == SIGNAL_TYPE_DVI_DUAL_LINK)
933 cntl.lanes_number = 8;
935 cntl.lanes_number = 4;
937 cntl.hpd_sel = enc110->base.hpd_source;
939 cntl.pixel_clock = pixel_clock;
940 cntl.color_depth = color_depth;
942 result = link_transmitter_control(enc110, &cntl);
944 if (result != BP_RESULT_OK) {
945 DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
951 /* TODO: still need depth or just pass in adjusted pixel clock? */
952 void dce110_link_encoder_enable_lvds_output(
953 struct link_encoder *enc,
954 enum clock_source_id clock_source,
955 uint32_t pixel_clock)
957 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
958 struct bp_transmitter_control cntl = { 0 };
959 enum bp_result result;
962 cntl.connector_obj_id = enc110->base.connector;
963 cntl.action = TRANSMITTER_CONTROL_ENABLE;
964 cntl.engine_id = enc->preferred_engine;
965 cntl.transmitter = enc110->base.transmitter;
966 cntl.pll_id = clock_source;
967 cntl.signal = SIGNAL_TYPE_LVDS;
968 cntl.lanes_number = 4;
970 cntl.hpd_sel = enc110->base.hpd_source;
972 cntl.pixel_clock = pixel_clock;
974 result = link_transmitter_control(enc110, &cntl);
976 if (result != BP_RESULT_OK) {
977 DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
983 /* enables DP PHY output */
984 void dce110_link_encoder_enable_dp_output(
985 struct link_encoder *enc,
986 const struct dc_link_settings *link_settings,
987 enum clock_source_id clock_source)
989 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
990 struct bp_transmitter_control cntl = { 0 };
991 enum bp_result result;
995 /* number_of_lanes is used for pixel clock adjust,
996 * but it's not passed to asic_control.
997 * We need to set number of lanes manually.
999 configure_encoder(enc110, link_settings);
1000 cntl.connector_obj_id = enc110->base.connector;
1001 cntl.action = TRANSMITTER_CONTROL_ENABLE;
1002 cntl.engine_id = enc->preferred_engine;
1003 cntl.transmitter = enc110->base.transmitter;
1004 cntl.pll_id = clock_source;
1005 cntl.signal = SIGNAL_TYPE_DISPLAY_PORT;
1006 cntl.lanes_number = link_settings->lane_count;
1007 cntl.hpd_sel = enc110->base.hpd_source;
1008 cntl.pixel_clock = link_settings->link_rate
1009 * LINK_RATE_REF_FREQ_IN_KHZ;
1010 /* TODO: check if undefined works */
1011 cntl.color_depth = COLOR_DEPTH_UNDEFINED;
1013 result = link_transmitter_control(enc110, &cntl);
1015 if (result != BP_RESULT_OK) {
1016 DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
1018 BREAK_TO_DEBUGGER();
1022 /* enables DP PHY output in MST mode */
1023 void dce110_link_encoder_enable_dp_mst_output(
1024 struct link_encoder *enc,
1025 const struct dc_link_settings *link_settings,
1026 enum clock_source_id clock_source)
1028 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1029 struct bp_transmitter_control cntl = { 0 };
1030 enum bp_result result;
1032 /* Enable the PHY */
1034 /* number_of_lanes is used for pixel clock adjust,
1035 * but it's not passed to asic_control.
1036 * We need to set number of lanes manually.
1038 configure_encoder(enc110, link_settings);
1040 cntl.action = TRANSMITTER_CONTROL_ENABLE;
1041 cntl.engine_id = ENGINE_ID_UNKNOWN;
1042 cntl.transmitter = enc110->base.transmitter;
1043 cntl.pll_id = clock_source;
1044 cntl.signal = SIGNAL_TYPE_DISPLAY_PORT_MST;
1045 cntl.lanes_number = link_settings->lane_count;
1046 cntl.hpd_sel = enc110->base.hpd_source;
1047 cntl.pixel_clock = link_settings->link_rate
1048 * LINK_RATE_REF_FREQ_IN_KHZ;
1049 /* TODO: check if undefined works */
1050 cntl.color_depth = COLOR_DEPTH_UNDEFINED;
1052 result = link_transmitter_control(enc110, &cntl);
1054 if (result != BP_RESULT_OK) {
1055 DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
1057 BREAK_TO_DEBUGGER();
1062 * Disable transmitter and its encoder
1064 void dce110_link_encoder_disable_output(
1065 struct link_encoder *enc,
1066 enum signal_type signal)
1068 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1069 struct bp_transmitter_control cntl = { 0 };
1070 enum bp_result result;
1072 if (!dce110_is_dig_enabled(enc)) {
1073 /* OF_SKIP_POWER_DOWN_INACTIVE_ENCODER */
1076 /* Power-down RX and disable GPU PHY should be paired.
1077 * Disabling PHY without powering down RX may cause
1078 * symbol lock loss, on which we will get DP Sink interrupt. */
1080 /* There is a case for the DP active dongles
1081 * where we want to disable the PHY but keep RX powered,
1082 * for those we need to ignore DP Sink interrupt
1083 * by checking lane count that has been set
1084 * on the last do_enable_output(). */
1086 /* disable transmitter */
1087 cntl.action = TRANSMITTER_CONTROL_DISABLE;
1088 cntl.transmitter = enc110->base.transmitter;
1089 cntl.hpd_sel = enc110->base.hpd_source;
1090 cntl.signal = signal;
1091 cntl.connector_obj_id = enc110->base.connector;
1093 result = link_transmitter_control(enc110, &cntl);
1095 if (result != BP_RESULT_OK) {
1096 DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n",
1098 BREAK_TO_DEBUGGER();
1102 /* disable encoder */
1103 if (dc_is_dp_signal(signal))
1104 link_encoder_disable(enc110);
1107 void dce110_link_encoder_dp_set_lane_settings(
1108 struct link_encoder *enc,
1109 const struct link_training_settings *link_settings)
1111 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1112 union dpcd_training_lane_set training_lane_set = { { 0 } };
1114 struct bp_transmitter_control cntl = { 0 };
1116 if (!link_settings) {
1117 BREAK_TO_DEBUGGER();
1121 cntl.action = TRANSMITTER_CONTROL_SET_VOLTAGE_AND_PREEMPASIS;
1122 cntl.transmitter = enc110->base.transmitter;
1123 cntl.connector_obj_id = enc110->base.connector;
1124 cntl.lanes_number = link_settings->link_settings.lane_count;
1125 cntl.hpd_sel = enc110->base.hpd_source;
1126 cntl.pixel_clock = link_settings->link_settings.link_rate *
1127 LINK_RATE_REF_FREQ_IN_KHZ;
1129 for (lane = 0; lane < link_settings->link_settings.lane_count; lane++) {
1130 /* translate lane settings */
1132 training_lane_set.bits.VOLTAGE_SWING_SET =
1133 link_settings->lane_settings[lane].VOLTAGE_SWING;
1134 training_lane_set.bits.PRE_EMPHASIS_SET =
1135 link_settings->lane_settings[lane].PRE_EMPHASIS;
1137 /* post cursor 2 setting only applies to HBR2 link rate */
1138 if (link_settings->link_settings.link_rate == LINK_RATE_HIGH2) {
1139 /* this is passed to VBIOS
1140 * to program post cursor 2 level */
1142 training_lane_set.bits.POST_CURSOR2_SET =
1143 link_settings->lane_settings[lane].POST_CURSOR2;
1146 cntl.lane_select = lane;
1147 cntl.lane_settings = training_lane_set.raw;
1149 /* call VBIOS table to set voltage swing and pre-emphasis */
1150 link_transmitter_control(enc110, &cntl);
1154 /* set DP PHY test and training patterns */
1155 void dce110_link_encoder_dp_set_phy_pattern(
1156 struct link_encoder *enc,
1157 const struct encoder_set_dp_phy_pattern_param *param)
1159 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1161 switch (param->dp_phy_pattern) {
1162 case DP_TEST_PATTERN_TRAINING_PATTERN1:
1163 dce110_link_encoder_set_dp_phy_pattern_training_pattern(enc, 0);
1165 case DP_TEST_PATTERN_TRAINING_PATTERN2:
1166 dce110_link_encoder_set_dp_phy_pattern_training_pattern(enc, 1);
1168 case DP_TEST_PATTERN_TRAINING_PATTERN3:
1169 dce110_link_encoder_set_dp_phy_pattern_training_pattern(enc, 2);
1171 case DP_TEST_PATTERN_TRAINING_PATTERN4:
1172 dce110_link_encoder_set_dp_phy_pattern_training_pattern(enc, 3);
1174 case DP_TEST_PATTERN_D102:
1175 set_dp_phy_pattern_d102(enc110);
1177 case DP_TEST_PATTERN_SYMBOL_ERROR:
1178 set_dp_phy_pattern_symbol_error(enc110);
1180 case DP_TEST_PATTERN_PRBS7:
1181 set_dp_phy_pattern_prbs7(enc110);
1183 case DP_TEST_PATTERN_80BIT_CUSTOM:
1184 set_dp_phy_pattern_80bit_custom(
1185 enc110, param->custom_pattern);
1187 case DP_TEST_PATTERN_CP2520_1:
1188 set_dp_phy_pattern_hbr2_compliance_cp2520_2(enc110, 1);
1190 case DP_TEST_PATTERN_CP2520_2:
1191 set_dp_phy_pattern_hbr2_compliance_cp2520_2(enc110, 2);
1193 case DP_TEST_PATTERN_CP2520_3:
1194 set_dp_phy_pattern_hbr2_compliance_cp2520_2(enc110, 3);
1196 case DP_TEST_PATTERN_VIDEO_MODE: {
1197 set_dp_phy_pattern_passthrough_mode(
1198 enc110, param->dp_panel_mode);
1203 /* invalid phy pattern */
1204 ASSERT_CRITICAL(false);
1209 static void fill_stream_allocation_row_info(
1210 const struct link_mst_stream_allocation *stream_allocation,
1214 const struct stream_encoder *stream_enc = stream_allocation->stream_enc;
1217 *src = stream_enc->id;
1218 *slots = stream_allocation->slot_count;
1225 /* programs DP MST VC payload allocation */
1226 void dce110_link_encoder_update_mst_stream_allocation_table(
1227 struct link_encoder *enc,
1228 const struct link_mst_stream_allocation_table *table)
1230 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1231 uint32_t value0 = 0;
1232 uint32_t value1 = 0;
1233 uint32_t value2 = 0;
1236 uint32_t retries = 0;
1238 /* For CZ, there are only 3 pipes. So Virtual channel is up 3.*/
1240 /* --- Set MSE Stream Attribute -
1241 * Setup VC Payload Table on Tx Side,
1242 * Issue allocation change trigger
1243 * to commit payload on both tx and rx side */
1245 /* we should clean-up table each time */
1247 if (table->stream_count >= 1) {
1248 fill_stream_allocation_row_info(
1249 &table->stream_allocations[0],
1257 REG_UPDATE_2(DP_MSE_SAT0,
1258 DP_MSE_SAT_SRC0, src,
1259 DP_MSE_SAT_SLOT_COUNT0, slots);
1261 if (table->stream_count >= 2) {
1262 fill_stream_allocation_row_info(
1263 &table->stream_allocations[1],
1271 REG_UPDATE_2(DP_MSE_SAT0,
1272 DP_MSE_SAT_SRC1, src,
1273 DP_MSE_SAT_SLOT_COUNT1, slots);
1275 if (table->stream_count >= 3) {
1276 fill_stream_allocation_row_info(
1277 &table->stream_allocations[2],
1285 REG_UPDATE_2(DP_MSE_SAT1,
1286 DP_MSE_SAT_SRC2, src,
1287 DP_MSE_SAT_SLOT_COUNT2, slots);
1289 if (table->stream_count >= 4) {
1290 fill_stream_allocation_row_info(
1291 &table->stream_allocations[3],
1299 REG_UPDATE_2(DP_MSE_SAT1,
1300 DP_MSE_SAT_SRC3, src,
1301 DP_MSE_SAT_SLOT_COUNT3, slots);
1303 /* --- wait for transaction finish */
1305 /* send allocation change trigger (ACT) ?
1306 * this step first sends the ACT,
1307 * then double buffers the SAT into the hardware
1308 * making the new allocation active on the DP MST mode link */
1311 /* DP_MSE_SAT_UPDATE:
1313 * 1 - Update SAT with trigger
1314 * 2 - Update SAT without trigger */
1316 REG_UPDATE(DP_MSE_SAT_UPDATE,
1317 DP_MSE_SAT_UPDATE, 1);
1319 /* wait for update to complete
1320 * (i.e. DP_MSE_SAT_UPDATE field is reset to 0)
1321 * then wait for the transmission
1322 * of at least 16 MTP headers on immediate local link.
1323 * i.e. DP_MSE_16_MTP_KEEPOUT field (read only) is reset to 0
1324 * a value of 1 indicates that DP MST mode
1325 * is in the 16 MTP keepout region after a VC has been added.
1326 * MST stream bandwidth (VC rate) can be configured
1327 * after this bit is cleared */
1332 value0 = REG_READ(DP_MSE_SAT_UPDATE);
1334 REG_GET(DP_MSE_SAT_UPDATE,
1335 DP_MSE_SAT_UPDATE, &value1);
1337 REG_GET(DP_MSE_SAT_UPDATE,
1338 DP_MSE_16_MTP_KEEPOUT, &value2);
1340 /* bit field DP_MSE_SAT_UPDATE is set to 1 already */
1341 if (!value1 && !value2)
1344 } while (retries < DP_MST_UPDATE_MAX_RETRY);
1347 void dce110_link_encoder_connect_dig_be_to_fe(
1348 struct link_encoder *enc,
1349 enum engine_id engine,
1352 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1355 if (engine != ENGINE_ID_UNKNOWN) {
1357 REG_GET(DIG_BE_CNTL, DIG_FE_SOURCE_SELECT, &field);
1360 field |= get_frontend_source(engine);
1362 field &= ~get_frontend_source(engine);
1364 REG_UPDATE(DIG_BE_CNTL, DIG_FE_SOURCE_SELECT, field);
1368 void dce110_link_encoder_enable_hpd(struct link_encoder *enc)
1370 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1371 struct dc_context *ctx = enc110->base.ctx;
1372 uint32_t addr = HPD_REG(DC_HPD_CONTROL);
1373 uint32_t hpd_enable = 0;
1374 uint32_t value = dm_read_reg(ctx, addr);
1376 get_reg_field_value(hpd_enable, DC_HPD_CONTROL, DC_HPD_EN);
1378 if (hpd_enable == 0)
1379 set_reg_field_value(value, 1, DC_HPD_CONTROL, DC_HPD_EN);
1382 void dce110_link_encoder_disable_hpd(struct link_encoder *enc)
1384 struct dce110_link_encoder *enc110 = TO_DCE110_LINK_ENC(enc);
1385 struct dc_context *ctx = enc110->base.ctx;
1386 uint32_t addr = HPD_REG(DC_HPD_CONTROL);
1387 uint32_t value = dm_read_reg(ctx, addr);
1389 set_reg_field_value(value, 0, DC_HPD_CONTROL, DC_HPD_EN);