Lines Matching +full:input +full:- +full:depth

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
6 #define pr_fmt(fmt) "[drm-dp] %s: " fmt, __func__
54 if (link->revision < 0x11) in dp_aux_link_power_up()
79 if (link->revision < 0x11) in dp_aux_link_power_down()
103 if (drm_dp_dpcd_readb(link->aux, addr, &data) < 0) { in dp_link_get_period()
105 ret = -EINVAL; in dp_link_get_period()
109 /* Period - Bits 3:0 */ in dp_link_get_period()
113 ret = -EINVAL; in dp_link_get_period()
125 struct dp_link_test_audio *req = &link->dp_link.test_audio; in dp_link_parse_audio_channel_period()
128 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
131 req->test_audio_period_ch_1 = ret; in dp_link_parse_audio_channel_period()
132 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_1 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
135 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
138 req->test_audio_period_ch_2 = ret; in dp_link_parse_audio_channel_period()
139 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_2 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
143 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
146 req->test_audio_period_ch_3 = ret; in dp_link_parse_audio_channel_period()
147 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_3 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
150 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
153 req->test_audio_period_ch_4 = ret; in dp_link_parse_audio_channel_period()
154 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_4 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
157 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
160 req->test_audio_period_ch_5 = ret; in dp_link_parse_audio_channel_period()
161 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_5 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
164 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
167 req->test_audio_period_ch_6 = ret; in dp_link_parse_audio_channel_period()
168 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_6 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
171 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
174 req->test_audio_period_ch_7 = ret; in dp_link_parse_audio_channel_period()
175 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_7 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
178 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
181 req->test_audio_period_ch_8 = ret; in dp_link_parse_audio_channel_period()
182 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_8 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
194 rlen = drm_dp_dpcd_readb(link->aux, in dp_link_parse_audio_pattern_type()
201 /* Audio Pattern Type - Bits 7:0 */ in dp_link_parse_audio_pattern_type()
204 ret = -EINVAL; in dp_link_parse_audio_pattern_type()
208 link->dp_link.test_audio.test_audio_pattern_type = data; in dp_link_parse_audio_pattern_type()
209 drm_dbg_dp(link->drm_dev, "audio pattern type = 0x%x\n", data); in dp_link_parse_audio_pattern_type()
224 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_AUDIO_MODE, &data); in dp_link_parse_audio_mode()
230 /* Sampling Rate - Bits 3:0 */ in dp_link_parse_audio_mode()
235 ret = -EINVAL; in dp_link_parse_audio_mode()
239 /* Channel Count - Bits 7:4 */ in dp_link_parse_audio_mode()
244 ret = -EINVAL; in dp_link_parse_audio_mode()
248 link->dp_link.test_audio.test_audio_sampling_rate = sampling_rate; in dp_link_parse_audio_mode()
249 link->dp_link.test_audio.test_audio_channel_count = channel_count; in dp_link_parse_audio_mode()
250 drm_dbg_dp(link->drm_dev, in dp_link_parse_audio_mode()
289 * dp_link_is_bit_depth_valid() - validates the bit depth requested
290 * @tbd: bit depth requested by the sink
292 * Returns true if the requested bit depth is supported.
314 return -EINVAL; in dp_link_parse_timing_params1()
317 rlen = drm_dp_dpcd_read(link->aux, addr, bp, len); in dp_link_parse_timing_params1()
320 return -EINVAL; in dp_link_parse_timing_params1()
336 return -EINVAL; in dp_link_parse_timing_params2()
339 rlen = drm_dp_dpcd_read(link->aux, addr, bp, len); in dp_link_parse_timing_params2()
342 return -EINVAL; in dp_link_parse_timing_params2()
358 rlen = drm_dp_dpcd_read(link->aux, addr, &bp, len); in dp_link_parse_timing_params3()
361 return -EINVAL; in dp_link_parse_timing_params3()
369 * dp_link_parse_video_pattern_params() - parses video pattern parameters from DPCD
373 * bit depth requested by the sink and, and if the values parsed are valid.
381 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_PATTERN, &bp); in dp_link_parse_video_pattern_params()
390 ret = -EINVAL; in dp_link_parse_video_pattern_params()
394 link->dp_link.test_video.test_video_pattern = bp; in dp_link_parse_video_pattern_params()
396 /* Read the requested color bit depth and dynamic range (Byte 0x232) */ in dp_link_parse_video_pattern_params()
397 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_MISC0, &bp); in dp_link_parse_video_pattern_params()
399 DRM_ERROR("failed to read link bit depth. rlen=%zd\n", rlen); in dp_link_parse_video_pattern_params()
404 link->dp_link.test_video.test_dyn_range = in dp_link_parse_video_pattern_params()
407 /* Color bit depth */ in dp_link_parse_video_pattern_params()
410 DRM_ERROR("invalid link bit depth = 0x%x\n", bp); in dp_link_parse_video_pattern_params()
411 ret = -EINVAL; in dp_link_parse_video_pattern_params()
415 link->dp_link.test_video.test_bit_depth = bp; in dp_link_parse_video_pattern_params()
419 &link->dp_link.test_video.test_h_total); in dp_link_parse_video_pattern_params()
426 &link->dp_link.test_video.test_v_total); in dp_link_parse_video_pattern_params()
433 &link->dp_link.test_video.test_h_start); in dp_link_parse_video_pattern_params()
440 &link->dp_link.test_video.test_v_start); in dp_link_parse_video_pattern_params()
447 &link->dp_link.test_video.test_hsync_pol, in dp_link_parse_video_pattern_params()
448 &link->dp_link.test_video.test_hsync_width); in dp_link_parse_video_pattern_params()
455 &link->dp_link.test_video.test_vsync_pol, in dp_link_parse_video_pattern_params()
456 &link->dp_link.test_video.test_vsync_width); in dp_link_parse_video_pattern_params()
463 &link->dp_link.test_video.test_h_width); in dp_link_parse_video_pattern_params()
470 &link->dp_link.test_video.test_v_height); in dp_link_parse_video_pattern_params()
477 &link->dp_link.test_video.test_rr_d); in dp_link_parse_video_pattern_params()
478 link->dp_link.test_video.test_rr_d &= DP_TEST_REFRESH_DENOMINATOR; in dp_link_parse_video_pattern_params()
485 &link->dp_link.test_video.test_rr_n); in dp_link_parse_video_pattern_params()
491 drm_dbg_dp(link->drm_dev, in dp_link_parse_video_pattern_params()
494 "link bit depth = 0x%x\n" in dp_link_parse_video_pattern_params()
505 link->dp_link.test_video.test_video_pattern, in dp_link_parse_video_pattern_params()
506 link->dp_link.test_video.test_dyn_range, in dp_link_parse_video_pattern_params()
507 link->dp_link.test_video.test_bit_depth, in dp_link_parse_video_pattern_params()
508 link->dp_link.test_video.test_h_total, in dp_link_parse_video_pattern_params()
509 link->dp_link.test_video.test_v_total, in dp_link_parse_video_pattern_params()
510 link->dp_link.test_video.test_h_start, in dp_link_parse_video_pattern_params()
511 link->dp_link.test_video.test_v_start, in dp_link_parse_video_pattern_params()
512 link->dp_link.test_video.test_hsync_pol, in dp_link_parse_video_pattern_params()
513 link->dp_link.test_video.test_hsync_width, in dp_link_parse_video_pattern_params()
514 link->dp_link.test_video.test_vsync_pol, in dp_link_parse_video_pattern_params()
515 link->dp_link.test_video.test_vsync_width, in dp_link_parse_video_pattern_params()
516 link->dp_link.test_video.test_h_width, in dp_link_parse_video_pattern_params()
517 link->dp_link.test_video.test_v_height, in dp_link_parse_video_pattern_params()
518 link->dp_link.test_video.test_rr_d, in dp_link_parse_video_pattern_params()
519 link->dp_link.test_video.test_rr_n); in dp_link_parse_video_pattern_params()
525 * dp_link_parse_link_training_params() - parses link training parameters from
537 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_LINK_RATE, &bp); in dp_link_parse_link_training_params()
545 return -EINVAL; in dp_link_parse_link_training_params()
548 link->request.test_link_rate = bp; in dp_link_parse_link_training_params()
549 drm_dbg_dp(link->drm_dev, "link rate = 0x%x\n", in dp_link_parse_link_training_params()
550 link->request.test_link_rate); in dp_link_parse_link_training_params()
552 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_LANE_COUNT, &bp); in dp_link_parse_link_training_params()
561 return -EINVAL; in dp_link_parse_link_training_params()
564 link->request.test_lane_count = bp; in dp_link_parse_link_training_params()
565 drm_dbg_dp(link->drm_dev, "lane count = 0x%x\n", in dp_link_parse_link_training_params()
566 link->request.test_lane_count); in dp_link_parse_link_training_params()
571 * dp_link_parse_phy_test_params() - parses the phy link parameters
582 rlen = drm_dp_dpcd_readb(link->aux, DP_PHY_TEST_PATTERN, in dp_link_parse_phy_test_params()
589 link->dp_link.phy_params.phy_test_pattern_sel = data & 0x07; in dp_link_parse_phy_test_params()
591 drm_dbg_dp(link->drm_dev, "phy_test_pattern_sel = 0x%x\n", data); in dp_link_parse_phy_test_params()
603 return -EINVAL; in dp_link_parse_phy_test_params()
608 * dp_link_is_video_audio_test_requested() - checks for audio/video link request
624 * dp_link_parse_request() - parses link request parameters from sink
640 rlen = drm_dp_dpcd_readb(link->aux, in dp_link_parse_request()
647 drm_dbg_dp(link->drm_dev, "device service irq vector = 0x%x\n", data); in dp_link_parse_request()
650 drm_dbg_dp(link->drm_dev, "no test requested\n"); in dp_link_parse_request()
658 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_REQUEST, &data); in dp_link_parse_request()
665 drm_dbg_dp(link->drm_dev, "link 0x%x not supported\n", data); in dp_link_parse_request()
669 drm_dbg_dp(link->drm_dev, "Test:(0x%x) requested\n", data); in dp_link_parse_request()
670 link->request.test_requested = data; in dp_link_parse_request()
671 if (link->request.test_requested == DP_TEST_LINK_PHY_TEST_PATTERN) { in dp_link_parse_request()
680 if (link->request.test_requested == DP_TEST_LINK_TRAINING) { in dp_link_parse_request()
687 link->request.test_requested)) { in dp_link_parse_request()
700 link->dp_link.test_response = DP_TEST_NAK; in dp_link_parse_request()
702 if (link->request.test_requested != DP_TEST_LINK_EDID_READ) in dp_link_parse_request()
703 link->dp_link.test_response = DP_TEST_ACK; in dp_link_parse_request()
705 link->dp_link.test_response = in dp_link_parse_request()
713 * dp_link_parse_sink_count() - parses the sink count
728 rlen = drm_dp_dpcd_readb(link->aux, DP_SINK_COUNT, in dp_link_parse_sink_count()
729 &link->dp_link.sink_count); in dp_link_parse_sink_count()
735 cp_ready = link->dp_link.sink_count & DP_SINK_CP_READY; in dp_link_parse_sink_count()
737 link->dp_link.sink_count = in dp_link_parse_sink_count()
738 DP_GET_SINK_COUNT(link->dp_link.sink_count); in dp_link_parse_sink_count()
740 drm_dbg_dp(link->drm_dev, "sink_count = 0x%x, cp_ready = 0x%x\n", in dp_link_parse_sink_count()
741 link->dp_link.sink_count, cp_ready); in dp_link_parse_sink_count()
749 link->prev_sink_count = link->dp_link.sink_count; in dp_link_parse_sink_status_field()
750 len = dp_link_parse_sink_count(&link->dp_link); in dp_link_parse_sink_status_field()
756 len = drm_dp_dpcd_read_link_status(link->aux, in dp_link_parse_sink_status_field()
757 link->link_status); in dp_link_parse_sink_status_field()
767 * dp_link_process_link_training_request() - processes new training requests
775 * otherwise it will return -EINVAL.
779 if (link->request.test_requested != DP_TEST_LINK_TRAINING) in dp_link_process_link_training_request()
780 return -EINVAL; in dp_link_process_link_training_request()
782 drm_dbg_dp(link->drm_dev, in dp_link_process_link_training_request()
785 link->request.test_link_rate, in dp_link_process_link_training_request()
786 link->request.test_lane_count); in dp_link_process_link_training_request()
788 link->dp_link.link_params.num_lanes = link->request.test_lane_count; in dp_link_process_link_training_request()
789 link->dp_link.link_params.rate = in dp_link_process_link_training_request()
790 drm_dp_bw_code_to_link_rate(link->request.test_link_rate); in dp_link_process_link_training_request()
801 DRM_ERROR("invalid input\n"); in dp_link_send_test_response()
807 ret = drm_dp_dpcd_writeb(link->aux, DP_TEST_RESPONSE, in dp_link_send_test_response()
808 dp_link->test_response); in dp_link_send_test_response()
821 return -EINVAL; in dp_link_psm_config()
826 mutex_lock(&link->psm_mutex); in dp_link_psm_config()
828 ret = dp_aux_link_power_down(link->aux, link_info); in dp_link_psm_config()
830 ret = dp_aux_link_power_up(link->aux, link_info); in dp_link_psm_config()
836 dp_link->psm_enabled = enable; in dp_link_psm_config()
838 mutex_unlock(&link->psm_mutex); in dp_link_psm_config()
848 DRM_ERROR("invalid input\n"); in dp_link_send_edid_checksum()
854 ret = drm_dp_dpcd_writeb(link->aux, DP_TEST_EDID_CHECKSUM, in dp_link_send_edid_checksum()
861 drm_dbg_dp(link->drm_dev, "vx: 0=%d, 1=%d, 2=%d, 3=%d\n", in dp_link_parse_vx_px()
862 drm_dp_get_adjust_request_voltage(link->link_status, 0), in dp_link_parse_vx_px()
863 drm_dp_get_adjust_request_voltage(link->link_status, 1), in dp_link_parse_vx_px()
864 drm_dp_get_adjust_request_voltage(link->link_status, 2), in dp_link_parse_vx_px()
865 drm_dp_get_adjust_request_voltage(link->link_status, 3)); in dp_link_parse_vx_px()
867 drm_dbg_dp(link->drm_dev, "px: 0=%d, 1=%d, 2=%d, 3=%d\n", in dp_link_parse_vx_px()
868 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 0), in dp_link_parse_vx_px()
869 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 1), in dp_link_parse_vx_px()
870 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 2), in dp_link_parse_vx_px()
871 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 3)); in dp_link_parse_vx_px()
874 * Update the voltage and pre-emphasis levels as per DPCD request in dp_link_parse_vx_px()
877 drm_dbg_dp(link->drm_dev, in dp_link_parse_vx_px()
879 link->dp_link.phy_params.v_level, in dp_link_parse_vx_px()
880 link->dp_link.phy_params.p_level); in dp_link_parse_vx_px()
881 link->dp_link.phy_params.v_level = in dp_link_parse_vx_px()
882 drm_dp_get_adjust_request_voltage(link->link_status, 0); in dp_link_parse_vx_px()
883 link->dp_link.phy_params.p_level = in dp_link_parse_vx_px()
884 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 0); in dp_link_parse_vx_px()
886 link->dp_link.phy_params.p_level >>= DP_TRAIN_PRE_EMPHASIS_SHIFT; in dp_link_parse_vx_px()
888 drm_dbg_dp(link->drm_dev, in dp_link_parse_vx_px()
890 link->dp_link.phy_params.v_level, in dp_link_parse_vx_px()
891 link->dp_link.phy_params.p_level); in dp_link_parse_vx_px()
895 * dp_link_process_phy_test_pattern_request() - process new phy link requests
900 * processed, otherwise it will return -EINVAL.
905 if (!(link->request.test_requested & DP_TEST_LINK_PHY_TEST_PATTERN)) { in dp_link_process_phy_test_pattern_request()
906 drm_dbg_dp(link->drm_dev, "no phy test\n"); in dp_link_process_phy_test_pattern_request()
907 return -EINVAL; in dp_link_process_phy_test_pattern_request()
910 if (!is_link_rate_valid(link->request.test_link_rate) || in dp_link_process_phy_test_pattern_request()
911 !is_lane_count_valid(link->request.test_lane_count)) { in dp_link_process_phy_test_pattern_request()
913 link->request.test_link_rate, in dp_link_process_phy_test_pattern_request()
914 link->request.test_lane_count); in dp_link_process_phy_test_pattern_request()
915 return -EINVAL; in dp_link_process_phy_test_pattern_request()
918 drm_dbg_dp(link->drm_dev, in dp_link_process_phy_test_pattern_request()
920 link->dp_link.link_params.rate, in dp_link_process_phy_test_pattern_request()
921 link->dp_link.link_params.num_lanes); in dp_link_process_phy_test_pattern_request()
923 drm_dbg_dp(link->drm_dev, in dp_link_process_phy_test_pattern_request()
925 link->request.test_link_rate, in dp_link_process_phy_test_pattern_request()
926 link->request.test_lane_count); in dp_link_process_phy_test_pattern_request()
928 link->dp_link.link_params.num_lanes = link->request.test_lane_count; in dp_link_process_phy_test_pattern_request()
929 link->dp_link.link_params.rate = in dp_link_process_phy_test_pattern_request()
930 drm_dp_bw_code_to_link_rate(link->request.test_link_rate); in dp_link_process_phy_test_pattern_request()
939 return link_status[r - DP_LANE0_1_STATUS]; in get_link_status()
943 * dp_link_process_link_status_update() - processes link status updates
951 * otherwise it will return -EINVAL.
955 bool channel_eq_done = drm_dp_channel_eq_ok(link->link_status, in dp_link_process_link_status_update()
956 link->dp_link.link_params.num_lanes); in dp_link_process_link_status_update()
958 bool clock_recovery_done = drm_dp_clock_recovery_ok(link->link_status, in dp_link_process_link_status_update()
959 link->dp_link.link_params.num_lanes); in dp_link_process_link_status_update()
961 drm_dbg_dp(link->drm_dev, in dp_link_process_link_status_update()
966 return -EINVAL; in dp_link_process_link_status_update()
972 * dp_link_process_ds_port_status_change() - process port status changes
980 * processed, otherwise it will return -EINVAL.
984 if (get_link_status(link->link_status, DP_LANE_ALIGN_STATUS_UPDATED) & in dp_link_process_ds_port_status_change()
988 if (link->prev_sink_count == link->dp_link.sink_count) in dp_link_process_ds_port_status_change()
989 return -EINVAL; in dp_link_process_ds_port_status_change()
993 link->prev_sink_count = link->dp_link.sink_count; in dp_link_process_ds_port_status_change()
1000 return (link->request.test_requested & DP_TEST_LINK_VIDEO_PATTERN) in dp_link_is_video_pattern_requested()
1001 && !(link->request.test_requested & in dp_link_is_video_pattern_requested()
1007 return (link->request.test_requested & DP_TEST_LINK_AUDIO_PATTERN); in dp_link_is_audio_pattern_requested()
1012 link->request = (const struct dp_link_request){ 0 }; in dp_link_reset_data()
1013 link->dp_link.test_video = (const struct dp_link_test_video){ 0 }; in dp_link_reset_data()
1014 link->dp_link.test_video.test_bit_depth = DP_TEST_BIT_DEPTH_UNKNOWN; in dp_link_reset_data()
1015 link->dp_link.test_audio = (const struct dp_link_test_audio){ 0 }; in dp_link_reset_data()
1016 link->dp_link.phy_params.phy_test_pattern_sel = 0; in dp_link_reset_data()
1017 link->dp_link.sink_request = 0; in dp_link_reset_data()
1018 link->dp_link.test_response = 0; in dp_link_reset_data()
1022 * dp_link_process_request() - handle HPD IRQ transition to HIGH
1035 DRM_ERROR("invalid input\n"); in dp_link_process_request()
1036 return -EINVAL; in dp_link_process_request()
1047 if (link->request.test_requested == DP_TEST_LINK_EDID_READ) { in dp_link_process_request()
1048 dp_link->sink_request |= DP_TEST_LINK_EDID_READ; in dp_link_process_request()
1050 dp_link->sink_request |= DS_PORT_STATUS_CHANGED; in dp_link_process_request()
1052 dp_link->sink_request |= DP_TEST_LINK_TRAINING; in dp_link_process_request()
1054 dp_link->sink_request |= DP_TEST_LINK_PHY_TEST_PATTERN; in dp_link_process_request()
1058 dp_link->sink_request |= DP_LINK_STATUS_UPDATED; in dp_link_process_request()
1062 dp_link->sink_request |= DP_TEST_LINK_VIDEO_PATTERN; in dp_link_process_request()
1065 dp_link->sink_request |= DP_TEST_LINK_AUDIO_PATTERN; in dp_link_process_request()
1066 ret = -EINVAL; in dp_link_process_request()
1071 drm_dbg_dp(link->drm_dev, "sink request=%#x", in dp_link_process_request()
1072 dp_link->sink_request); in dp_link_process_request()
1082 DRM_ERROR("invalid input\n"); in dp_link_get_colorimetry_config()
1083 return -EINVAL; in dp_link_get_colorimetry_config()
1093 cc = link->dp_link.test_video.test_dyn_range; in dp_link_get_colorimetry_config()
1107 DRM_ERROR("invalid input\n"); in dp_link_adjust_levels()
1108 return -EINVAL; in dp_link_adjust_levels()
1114 for (i = 0; i < dp_link->link_params.num_lanes; i++) { in dp_link_adjust_levels()
1118 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1127 dp_link->phy_params.v_level = v_max >> DP_TRAIN_VOLTAGE_SWING_SHIFT; in dp_link_adjust_levels()
1128 dp_link->phy_params.p_level = p_max >> DP_TRAIN_PRE_EMPHASIS_SHIFT; in dp_link_adjust_levels()
1131 * Adjust the voltage swing and pre-emphasis level combination to within in dp_link_adjust_levels()
1134 if (dp_link->phy_params.v_level > DP_TRAIN_VOLTAGE_SWING_MAX) { in dp_link_adjust_levels()
1135 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1137 dp_link->phy_params.v_level, in dp_link_adjust_levels()
1139 dp_link->phy_params.v_level = DP_TRAIN_VOLTAGE_SWING_MAX; in dp_link_adjust_levels()
1142 if (dp_link->phy_params.p_level > DP_TRAIN_PRE_EMPHASIS_MAX) { in dp_link_adjust_levels()
1143 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1145 dp_link->phy_params.p_level, in dp_link_adjust_levels()
1147 dp_link->phy_params.p_level = DP_TRAIN_PRE_EMPHASIS_MAX; in dp_link_adjust_levels()
1150 if ((dp_link->phy_params.p_level > DP_TRAIN_PRE_EMPHASIS_LVL_1) in dp_link_adjust_levels()
1151 && (dp_link->phy_params.v_level == in dp_link_adjust_levels()
1153 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1155 dp_link->phy_params.p_level, in dp_link_adjust_levels()
1157 dp_link->phy_params.p_level = DP_TRAIN_PRE_EMPHASIS_LVL_1; in dp_link_adjust_levels()
1160 drm_dbg_dp(link->drm_dev, "adjusted: v_level=%d, p_level=%d\n", in dp_link_adjust_levels()
1161 dp_link->phy_params.v_level, dp_link->phy_params.p_level); in dp_link_adjust_levels()
1168 dp_link->phy_params.v_level = 0; in dp_link_reset_phy_params_vx_px()
1169 dp_link->phy_params.p_level = 0; in dp_link_reset_phy_params_vx_px()
1178 * 1. Test bit depth is bit depth per color component in dp_link_get_test_bits_depth()
1208 DRM_ERROR("invalid input\n"); in dp_link_get()
1209 return ERR_PTR(-EINVAL); in dp_link_get()
1214 return ERR_PTR(-ENOMEM); in dp_link_get()
1216 link->dev = dev; in dp_link_get()
1217 link->aux = aux; in dp_link_get()
1219 mutex_init(&link->psm_mutex); in dp_link_get()
1220 dp_link = &link->dp_link; in dp_link_get()