Loading...
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2019 Intel Corporation
4 */
5
6#ifndef __INTEL_DP_LINK_TRAINING_H__
7#define __INTEL_DP_LINK_TRAINING_H__
8
9#include <drm/drm_dp_helper.h>
10
11struct intel_crtc_state;
12struct intel_dp;
13
14int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp);
15
16void intel_dp_get_adjust_train(struct intel_dp *intel_dp,
17 const struct intel_crtc_state *crtc_state,
18 enum drm_dp_phy dp_phy,
19 const u8 link_status[DP_LINK_STATUS_SIZE]);
20void intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
21 const struct intel_crtc_state *crtc_state,
22 u8 dp_train_pat);
23void intel_dp_set_signal_levels(struct intel_dp *intel_dp,
24 const struct intel_crtc_state *crtc_state,
25 enum drm_dp_phy dp_phy);
26void intel_dp_start_link_train(struct intel_dp *intel_dp,
27 const struct intel_crtc_state *crtc_state);
28void intel_dp_stop_link_train(struct intel_dp *intel_dp,
29 const struct intel_crtc_state *crtc_state);
30
31/* Get the TPSx symbol type of the value programmed to DP_TRAINING_PATTERN_SET */
32static inline u8 intel_dp_training_pattern_symbol(u8 pattern)
33{
34 return pattern & ~DP_LINK_SCRAMBLING_DISABLE;
35}
36
37#endif /* __INTEL_DP_LINK_TRAINING_H__ */
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2019 Intel Corporation
4 */
5
6#ifndef __INTEL_DP_LINK_TRAINING_H__
7#define __INTEL_DP_LINK_TRAINING_H__
8
9#include <drm/display/drm_dp_helper.h>
10
11struct intel_atomic_state;
12struct intel_connector;
13struct intel_crtc_state;
14struct intel_dp;
15
16int intel_dp_read_dprx_caps(struct intel_dp *intel_dp, u8 dpcd[DP_RECEIVER_CAP_SIZE]);
17int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp);
18
19void intel_dp_link_training_set_mode(struct intel_dp *intel_dp,
20 int link_rate, bool is_vrr);
21void intel_dp_link_training_set_bw(struct intel_dp *intel_dp,
22 int link_bw, int rate_select, int lane_count,
23 bool enhanced_framing);
24
25void intel_dp_get_adjust_train(struct intel_dp *intel_dp,
26 const struct intel_crtc_state *crtc_state,
27 enum drm_dp_phy dp_phy,
28 const u8 link_status[DP_LINK_STATUS_SIZE]);
29void intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
30 const struct intel_crtc_state *crtc_state,
31 enum drm_dp_phy dp_phy,
32 u8 dp_train_pat);
33void intel_dp_set_signal_levels(struct intel_dp *intel_dp,
34 const struct intel_crtc_state *crtc_state,
35 enum drm_dp_phy dp_phy);
36void intel_dp_start_link_train(struct intel_atomic_state *state,
37 struct intel_dp *intel_dp,
38 const struct intel_crtc_state *crtc_state);
39void intel_dp_stop_link_train(struct intel_dp *intel_dp,
40 const struct intel_crtc_state *crtc_state);
41
42void
43intel_dp_dump_link_status(struct intel_dp *intel_dp, enum drm_dp_phy dp_phy,
44 const u8 link_status[DP_LINK_STATUS_SIZE]);
45
46/* Get the TPSx symbol type of the value programmed to DP_TRAINING_PATTERN_SET */
47static inline u8 intel_dp_training_pattern_symbol(u8 pattern)
48{
49 return pattern & ~DP_LINK_SCRAMBLING_DISABLE;
50}
51
52void intel_dp_128b132b_sdp_crc16(struct intel_dp *intel_dp,
53 const struct intel_crtc_state *crtc_state);
54
55void intel_dp_link_training_debugfs_add(struct intel_connector *connector);
56
57#endif /* __INTEL_DP_LINK_TRAINING_H__ */