Loading...
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2020 Intel Corporation
4 */
5
6#ifndef _INTEL_DDI_BUF_TRANS_H_
7#define _INTEL_DDI_BUF_TRANS_H_
8
9#include <linux/types.h>
10
11struct drm_i915_private;
12struct intel_encoder;
13struct intel_crtc_state;
14
15struct ddi_buf_trans {
16 u32 trans1; /* balance leg enable, de-emph level */
17 u32 trans2; /* vref sel, vswing */
18 u8 i_boost; /* SKL: I_boost; valid: 0x0, 0x1, 0x3, 0x7 */
19};
20
21struct bxt_ddi_buf_trans {
22 u8 margin; /* swing value */
23 u8 scale; /* scale value */
24 u8 enable; /* scale enable */
25 u8 deemphasis;
26};
27
28struct cnl_ddi_buf_trans {
29 u8 dw2_swing_sel;
30 u8 dw7_n_scalar;
31 u8 dw4_cursor_coeff;
32 u8 dw4_post_cursor_2;
33 u8 dw4_post_cursor_1;
34};
35
36struct icl_mg_phy_ddi_buf_trans {
37 u32 cri_txdeemph_override_11_6;
38 u32 cri_txdeemph_override_5_0;
39 u32 cri_txdeemph_override_17_12;
40};
41
42struct tgl_dkl_phy_ddi_buf_trans {
43 u32 dkl_vswing_control;
44 u32 dkl_preshoot_control;
45 u32 dkl_de_emphasis_control;
46};
47
48bool is_hobl_buf_trans(const struct cnl_ddi_buf_trans *table);
49
50int intel_ddi_hdmi_num_entries(struct intel_encoder *encoder,
51 const struct intel_crtc_state *crtc_state,
52 int *default_entry);
53
54const struct ddi_buf_trans *
55intel_ddi_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries);
56const struct ddi_buf_trans *
57intel_ddi_get_buf_trans_fdi(struct drm_i915_private *dev_priv,
58 int *n_entries);
59const struct ddi_buf_trans *
60intel_ddi_get_buf_trans_hdmi(struct intel_encoder *encoder,
61 int *n_entries);
62const struct ddi_buf_trans *
63intel_ddi_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries);
64
65const struct bxt_ddi_buf_trans *
66bxt_get_buf_trans(struct intel_encoder *encoder,
67 const struct intel_crtc_state *crtc_state,
68 int *n_entries);
69
70const struct tgl_dkl_phy_ddi_buf_trans *
71adlp_get_dkl_buf_trans(struct intel_encoder *encoder,
72 const struct intel_crtc_state *crtc_state,
73 int *n_entries);
74const struct cnl_ddi_buf_trans *
75tgl_get_combo_buf_trans(struct intel_encoder *encoder,
76 const struct intel_crtc_state *crtc_state,
77 int *n_entries);
78const struct tgl_dkl_phy_ddi_buf_trans *
79tgl_get_dkl_buf_trans(struct intel_encoder *encoder,
80 const struct intel_crtc_state *crtc_state,
81 int *n_entries);
82const struct cnl_ddi_buf_trans *
83jsl_get_combo_buf_trans(struct intel_encoder *encoder,
84 const struct intel_crtc_state *crtc_state,
85 int *n_entries);
86const struct cnl_ddi_buf_trans *
87ehl_get_combo_buf_trans(struct intel_encoder *encoder,
88 const struct intel_crtc_state *crtc_state,
89 int *n_entries);
90const struct cnl_ddi_buf_trans *
91icl_get_combo_buf_trans(struct intel_encoder *encoder,
92 const struct intel_crtc_state *crtc_state,
93 int *n_entries);
94const struct icl_mg_phy_ddi_buf_trans *
95icl_get_mg_buf_trans(struct intel_encoder *encoder,
96 const struct intel_crtc_state *crtc_state,
97 int *n_entries);
98
99const struct cnl_ddi_buf_trans *
100cnl_get_buf_trans(struct intel_encoder *encoder,
101 const struct intel_crtc_state *crtc_state,
102 int *n_entries);
103
104#endif
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2020 Intel Corporation
4 */
5
6#ifndef _INTEL_DDI_BUF_TRANS_H_
7#define _INTEL_DDI_BUF_TRANS_H_
8
9#include <linux/types.h>
10
11struct drm_i915_private;
12struct intel_encoder;
13struct intel_crtc_state;
14
15struct hsw_ddi_buf_trans {
16 u32 trans1; /* balance leg enable, de-emph level */
17 u32 trans2; /* vref sel, vswing */
18 u8 i_boost; /* SKL: I_boost; valid: 0x0, 0x1, 0x3, 0x7 */
19};
20
21struct bxt_ddi_buf_trans {
22 u8 margin; /* swing value */
23 u8 scale; /* scale value */
24 u8 enable; /* scale enable */
25 u8 deemphasis;
26};
27
28struct icl_ddi_buf_trans {
29 u8 dw2_swing_sel;
30 u8 dw7_n_scalar;
31 u8 dw4_cursor_coeff;
32 u8 dw4_post_cursor_2;
33 u8 dw4_post_cursor_1;
34};
35
36struct icl_mg_phy_ddi_buf_trans {
37 u8 cri_txdeemph_override_11_6;
38 u8 cri_txdeemph_override_5_0;
39 u8 cri_txdeemph_override_17_12;
40};
41
42struct tgl_dkl_phy_ddi_buf_trans {
43 u8 vswing;
44 u8 preshoot;
45 u8 de_emphasis;
46};
47
48struct dg2_snps_phy_buf_trans {
49 u8 vswing;
50 u8 pre_cursor;
51 u8 post_cursor;
52};
53
54union intel_ddi_buf_trans_entry {
55 struct hsw_ddi_buf_trans hsw;
56 struct bxt_ddi_buf_trans bxt;
57 struct icl_ddi_buf_trans icl;
58 struct icl_mg_phy_ddi_buf_trans mg;
59 struct tgl_dkl_phy_ddi_buf_trans dkl;
60 struct dg2_snps_phy_buf_trans snps;
61};
62
63struct intel_ddi_buf_trans {
64 const union intel_ddi_buf_trans_entry *entries;
65 u8 num_entries;
66 u8 hdmi_default_entry;
67};
68
69bool is_hobl_buf_trans(const struct intel_ddi_buf_trans *table);
70
71void intel_ddi_buf_trans_init(struct intel_encoder *encoder);
72
73#endif