diff options
author | Jay Bhukhanwala <jbhukhanwala@nvidia.com> | 2017-10-17 20:02:10 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-24 04:26:43 -0400 |
commit | f67529adae4180da0821812da0f7668b29c13e68 (patch) | |
tree | a9c2dcc2040dec7f2f4112612e2f65cd1d31e348 /drivers | |
parent | 8dda6e08a0e2999562d613e6dbe3b0c90b4a11a0 (diff) |
tegra: dp: Integrate t19x specific code paths
There are certain DP initialization sequences specific to T19x.
- Fork paths wherever required to incorporate chip specific logic
TDS-1553
Change-Id: If28eb7f55e8f7a5bad7ca0f2a35bfece3fa6d19c
Signed-off-by: Jay Bhukhanwala <jbhukhanwala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1570524
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shu Zhong <shuz@nvidia.com>
Reviewed-by: Santosh Galma <galmar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/dc/dp.c | 176 | ||||
-rw-r--r-- | drivers/video/tegra/dc/dp.h | 6 | ||||
-rw-r--r-- | drivers/video/tegra/dc/dp_lt.c | 16 | ||||
-rw-r--r-- | drivers/video/tegra/dc/dp_lt.h | 1 | ||||
-rw-r--r-- | drivers/video/tegra/dc/sor.c | 3 | ||||
-rw-r--r-- | drivers/video/tegra/dc/sor.h | 22 |
6 files changed, 130 insertions, 94 deletions
diff --git a/drivers/video/tegra/dc/dp.c b/drivers/video/tegra/dc/dp.c index 4ac21c384..cad1be38e 100644 --- a/drivers/video/tegra/dc/dp.c +++ b/drivers/video/tegra/dc/dp.c | |||
@@ -1149,7 +1149,7 @@ static int tegra_dc_init_default_panel_link_cfg(struct tegra_dc_dp_link_config * | |||
1149 | */ | 1149 | */ |
1150 | if (!cfg->is_valid) { | 1150 | if (!cfg->is_valid) { |
1151 | cfg->max_lane_count = 4; | 1151 | cfg->max_lane_count = 4; |
1152 | cfg->tps3_supported = false; | 1152 | cfg->tps = TEGRA_DC_DP_TRAINING_PATTERN_2; |
1153 | cfg->support_enhanced_framing = true; | 1153 | cfg->support_enhanced_framing = true; |
1154 | cfg->downspread = true; | 1154 | cfg->downspread = true; |
1155 | cfg->support_fast_lt = true; | 1155 | cfg->support_fast_lt = true; |
@@ -1164,8 +1164,8 @@ static int tegra_dc_init_default_panel_link_cfg(struct tegra_dc_dp_link_config * | |||
1164 | return 0; | 1164 | return 0; |
1165 | } | 1165 | } |
1166 | 1166 | ||
1167 | static void tegra_dp_set_max_link_bw(struct tegra_dc_sor_data *sor, | 1167 | void tegra_dp_set_max_link_bw(struct tegra_dc_sor_data *sor, |
1168 | struct tegra_dc_dp_link_config *cfg) | 1168 | struct tegra_dc_dp_link_config *cfg) |
1169 | { | 1169 | { |
1170 | unsigned int key; /* Index into the link speed table */ | 1170 | unsigned int key; /* Index into the link speed table */ |
1171 | 1171 | ||
@@ -1176,90 +1176,103 @@ static void tegra_dp_set_max_link_bw(struct tegra_dc_sor_data *sor, | |||
1176 | cfg->max_link_bw = sor->link_speeds[key].link_rate; | 1176 | cfg->max_link_bw = sor->link_speeds[key].link_rate; |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | static int tegra_dp_init_max_link_cfg(struct tegra_dc_dp_data *dp, | 1179 | static int __tegra_dp_init_max_link_cfg(struct tegra_dc_dp_data *dp, |
1180 | struct tegra_dc_dp_link_config *cfg) | 1180 | struct tegra_dc_dp_link_config *cfg) |
1181 | { | 1181 | { |
1182 | if (dp->dc->out->type == TEGRA_DC_OUT_FAKE_DP) | 1182 | u8 dpcd_data; |
1183 | tegra_dc_init_default_panel_link_cfg(cfg); | 1183 | int ret; |
1184 | else { | ||
1185 | u8 dpcd_data; | ||
1186 | int ret; | ||
1187 | 1184 | ||
1188 | if (dp->sink_cap_valid) | 1185 | if (dp->sink_cap_valid) |
1189 | dpcd_data = dp->sink_cap[NV_DPCD_MAX_LANE_COUNT]; | 1186 | dpcd_data = dp->sink_cap[NV_DPCD_MAX_LANE_COUNT]; |
1190 | else | 1187 | else |
1191 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, | 1188 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, |
1192 | NV_DPCD_MAX_LANE_COUNT, &dpcd_data)); | 1189 | NV_DPCD_MAX_LANE_COUNT, &dpcd_data)); |
1193 | 1190 | ||
1194 | cfg->max_lane_count = dpcd_data & NV_DPCD_MAX_LANE_COUNT_MASK; | 1191 | cfg->max_lane_count = dpcd_data & NV_DPCD_MAX_LANE_COUNT_MASK; |
1195 | 1192 | ||
1196 | if (cfg->max_lane_count >= 4) | 1193 | if (cfg->max_lane_count >= 4) |
1197 | cfg->max_lane_count = 4; | 1194 | cfg->max_lane_count = 4; |
1198 | else if (cfg->max_lane_count >= 2) | 1195 | else if (cfg->max_lane_count >= 2) |
1199 | cfg->max_lane_count = 2; | 1196 | cfg->max_lane_count = 2; |
1200 | else | 1197 | else |
1201 | cfg->max_lane_count = 1; | 1198 | cfg->max_lane_count = 1; |
1202 | 1199 | ||
1203 | if (dp->pdata && dp->pdata->lanes && | 1200 | if (dp->pdata && dp->pdata->lanes && |
1204 | dp->pdata->lanes < cfg->max_lane_count) | 1201 | dp->pdata->lanes < cfg->max_lane_count) |
1205 | cfg->max_lane_count = dp->pdata->lanes; | 1202 | cfg->max_lane_count = dp->pdata->lanes; |
1206 | 1203 | ||
1207 | cfg->tps3_supported = | 1204 | if (dpcd_data & NV_DPCD_MAX_LANE_COUNT_TPS3_SUPPORTED_YES) |
1208 | (dpcd_data & | 1205 | cfg->tps = TEGRA_DC_DP_TRAINING_PATTERN_3; |
1209 | NV_DPCD_MAX_LANE_COUNT_TPS3_SUPPORTED_YES) ? | 1206 | |
1210 | true : false; | 1207 | cfg->support_enhanced_framing = |
1211 | cfg->support_enhanced_framing = | 1208 | (dpcd_data & NV_DPCD_MAX_LANE_COUNT_ENHANCED_FRAMING_YES) ? |
1212 | (dpcd_data & NV_DPCD_MAX_LANE_COUNT_ENHANCED_FRAMING_YES) ? | 1209 | true : false; |
1210 | |||
1211 | if (dp->sink_cap_valid) | ||
1212 | dpcd_data = dp->sink_cap[NV_DPCD_MAX_DOWNSPREAD]; | ||
1213 | else | ||
1214 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, | ||
1215 | NV_DPCD_MAX_DOWNSPREAD, &dpcd_data)); | ||
1216 | cfg->downspread = | ||
1217 | (dpcd_data & NV_DPCD_MAX_DOWNSPREAD_VAL_0_5_PCT) ? | ||
1218 | true : false; | ||
1219 | cfg->support_fast_lt = (dpcd_data & | ||
1220 | NV_DPCD_MAX_DOWNSPREAD_NO_AUX_HANDSHAKE_LT_T) ? | ||
1213 | true : false; | 1221 | true : false; |
1214 | 1222 | ||
1215 | if (dp->sink_cap_valid) | 1223 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, |
1216 | dpcd_data = dp->sink_cap[NV_DPCD_MAX_DOWNSPREAD]; | 1224 | NV_DPCD_TRAINING_AUX_RD_INTERVAL, &dpcd_data)); |
1217 | else | 1225 | cfg->aux_rd_interval = dpcd_data; |
1218 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, | ||
1219 | NV_DPCD_MAX_DOWNSPREAD, &dpcd_data)); | ||
1220 | cfg->downspread = | ||
1221 | (dpcd_data & NV_DPCD_MAX_DOWNSPREAD_VAL_0_5_PCT) ? | ||
1222 | true : false; | ||
1223 | cfg->support_fast_lt = (dpcd_data & | ||
1224 | NV_DPCD_MAX_DOWNSPREAD_NO_AUX_HANDSHAKE_LT_T) ? | ||
1225 | true : false; | ||
1226 | 1226 | ||
1227 | if (dp->sink_cap_valid) | ||
1228 | cfg->max_link_bw = | ||
1229 | dp->sink_cap[NV_DPCD_MAX_LINK_BANDWIDTH]; | ||
1230 | else | ||
1227 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, | 1231 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, |
1228 | NV_DPCD_TRAINING_AUX_RD_INTERVAL, &dpcd_data)); | 1232 | NV_DPCD_MAX_LINK_BANDWIDTH, |
1229 | cfg->aux_rd_interval = dpcd_data; | 1233 | &cfg->max_link_bw)); |
1230 | 1234 | ||
1231 | if (dp->sink_cap_valid) | 1235 | tegra_dp_set_max_link_bw(dp->sor, cfg); |
1232 | cfg->max_link_bw = | 1236 | |
1233 | dp->sink_cap[NV_DPCD_MAX_LINK_BANDWIDTH]; | 1237 | if (dp->pdata && dp->pdata->link_bw && |
1234 | else | 1238 | dp->pdata->link_bw < cfg->max_link_bw) |
1235 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, | 1239 | cfg->max_link_bw = dp->pdata->link_bw; |
1236 | NV_DPCD_MAX_LINK_BANDWIDTH, | 1240 | |
1237 | &cfg->max_link_bw)); | 1241 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, NV_DPCD_EDP_CONFIG_CAP, |
1238 | 1242 | &dpcd_data)); | |
1239 | tegra_dp_set_max_link_bw(dp->sor, cfg); | 1243 | cfg->alt_scramber_reset_cap = |
1240 | 1244 | (dpcd_data & NV_DPCD_EDP_CONFIG_CAP_ASC_RESET_YES) ? | |
1241 | if (dp->pdata && dp->pdata->link_bw && | 1245 | true : false; |
1242 | dp->pdata->link_bw < cfg->max_link_bw) | 1246 | cfg->only_enhanced_framing = (dpcd_data & |
1243 | cfg->max_link_bw = dp->pdata->link_bw; | 1247 | NV_DPCD_EDP_CONFIG_CAP_FRAMING_CHANGE_YES) ? |
1244 | 1248 | true : false; | |
1245 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, NV_DPCD_EDP_CONFIG_CAP, | 1249 | cfg->edp_cap = (dpcd_data & |
1246 | &dpcd_data)); | 1250 | NV_DPCD_EDP_CONFIG_CAP_DISPLAY_CONTROL_CAP_YES) ? |
1247 | cfg->alt_scramber_reset_cap = | 1251 | true : false; |
1248 | (dpcd_data & NV_DPCD_EDP_CONFIG_CAP_ASC_RESET_YES) ? | 1252 | |
1249 | true : false; | 1253 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, NV_DPCD_FEATURE_ENUM_LIST, |
1250 | cfg->only_enhanced_framing = (dpcd_data & | 1254 | &dpcd_data)); |
1251 | NV_DPCD_EDP_CONFIG_CAP_FRAMING_CHANGE_YES) ? | 1255 | cfg->support_vsc_ext_colorimetry = (dpcd_data & |
1252 | true : false; | 1256 | NV_DPCD_FEATURE_ENUM_LIST_VSC_EXT_COLORIMETRY) ? |
1253 | cfg->edp_cap = (dpcd_data & | 1257 | true : false; |
1254 | NV_DPCD_EDP_CONFIG_CAP_DISPLAY_CONTROL_CAP_YES) ? | 1258 | |
1255 | true : false; | 1259 | return 0; |
1256 | 1260 | } | |
1257 | CHECK_RET(tegra_dc_dp_dpcd_read(dp, NV_DPCD_FEATURE_ENUM_LIST, | 1261 | |
1258 | &dpcd_data)); | 1262 | static int tegra_dp_init_max_link_cfg(struct tegra_dc_dp_data *dp, |
1259 | cfg->support_vsc_ext_colorimetry = (dpcd_data & | 1263 | struct tegra_dc_dp_link_config *cfg) |
1260 | NV_DPCD_FEATURE_ENUM_LIST_VSC_EXT_COLORIMETRY) ? | 1264 | { |
1261 | true : false; | 1265 | int ret = 0; |
1262 | } | 1266 | |
1267 | if (dp->dc->out->type == TEGRA_DC_OUT_FAKE_DP) | ||
1268 | tegra_dc_init_default_panel_link_cfg(cfg); | ||
1269 | else if (tegra_dc_is_t19x()) | ||
1270 | ret = tegra_dp_init_max_link_cfg_t19x(dp, cfg); | ||
1271 | else | ||
1272 | ret = __tegra_dp_init_max_link_cfg(dp, cfg); | ||
1273 | |||
1274 | if (ret) | ||
1275 | return ret; | ||
1263 | 1276 | ||
1264 | cfg->bits_per_pixel = dp->dc->out->depth ? : 24; | 1277 | cfg->bits_per_pixel = dp->dc->out->depth ? : 24; |
1265 | 1278 | ||
@@ -1275,6 +1288,7 @@ static int tegra_dp_init_max_link_cfg(struct tegra_dc_dp_data *dp, | |||
1275 | tegra_dc_dp_calc_config(dp, dp->mode, cfg); | 1288 | tegra_dc_dp_calc_config(dp, dp->mode, cfg); |
1276 | 1289 | ||
1277 | dp->max_link_cfg = *cfg; | 1290 | dp->max_link_cfg = *cfg; |
1291 | |||
1278 | return 0; | 1292 | return 0; |
1279 | } | 1293 | } |
1280 | 1294 | ||
@@ -1294,7 +1308,6 @@ static int tegra_dc_dp_set_assr(struct tegra_dc_dp_data *dp, bool ena) | |||
1294 | return 0; | 1308 | return 0; |
1295 | } | 1309 | } |
1296 | 1310 | ||
1297 | |||
1298 | static int tegra_dp_set_link_bandwidth(struct tegra_dc_dp_data *dp, u8 link_bw) | 1311 | static int tegra_dp_set_link_bandwidth(struct tegra_dc_dp_data *dp, u8 link_bw) |
1299 | { | 1312 | { |
1300 | tegra_dc_sor_set_link_bandwidth(dp->sor, link_bw); | 1313 | tegra_dc_sor_set_link_bandwidth(dp->sor, link_bw); |
@@ -1867,6 +1880,7 @@ static void tegra_dp_hpd_config(struct tegra_dc_dp_data *dp) | |||
1867 | static void tegra_dp_dpcd_init(struct tegra_dc_dp_data *dp) | 1880 | static void tegra_dp_dpcd_init(struct tegra_dc_dp_data *dp) |
1868 | { | 1881 | { |
1869 | struct tegra_dc_dp_link_config *cfg = &dp->link_cfg; | 1882 | struct tegra_dc_dp_link_config *cfg = &dp->link_cfg; |
1883 | int ret; | ||
1870 | u32 size_ieee_oui = 3, auxstat; | 1884 | u32 size_ieee_oui = 3, auxstat; |
1871 | u8 data_ieee_oui_be[3] = {(NV_IEEE_OUI >> 16) & 0xff, | 1885 | u8 data_ieee_oui_be[3] = {(NV_IEEE_OUI >> 16) & 0xff, |
1872 | (NV_IEEE_OUI >> 8) & 0xff, | 1886 | (NV_IEEE_OUI >> 8) & 0xff, |
@@ -1877,9 +1891,9 @@ static void tegra_dp_dpcd_init(struct tegra_dc_dp_data *dp) | |||
1877 | dev_err(&dp->dc->ndev->dev, | 1891 | dev_err(&dp->dc->ndev->dev, |
1878 | "dp: failed to read the revision number from sink\n"); | 1892 | "dp: failed to read the revision number from sink\n"); |
1879 | 1893 | ||
1880 | if (tegra_dp_init_max_link_cfg(dp, cfg)) | 1894 | ret = tegra_dp_init_max_link_cfg(dp, cfg); |
1881 | dev_err(&dp->dc->ndev->dev, | 1895 | if (ret) |
1882 | "dp: failed to init link configuration\n"); | 1896 | dev_err(&dp->dc->ndev->dev, "dp: failed to init link cfg\n"); |
1883 | 1897 | ||
1884 | tegra_dc_dpaux_write(dp->dpaux, DPAUX_DP_AUXCTL_CMD_AUXWR, | 1898 | tegra_dc_dpaux_write(dp->dpaux, DPAUX_DP_AUXCTL_CMD_AUXWR, |
1885 | NV_DPCD_SOURCE_IEEE_OUI, data_ieee_oui_be, &size_ieee_oui, | 1899 | NV_DPCD_SOURCE_IEEE_OUI, data_ieee_oui_be, &size_ieee_oui, |
diff --git a/drivers/video/tegra/dc/dp.h b/drivers/video/tegra/dc/dp.h index 083bf2cc5..cd19b426f 100644 --- a/drivers/video/tegra/dc/dp.h +++ b/drivers/video/tegra/dc/dp.h | |||
@@ -378,4 +378,10 @@ static inline void tegra_dp_set_outdata(struct tegra_dc_dp_data *dp, | |||
378 | #define NV_DPCD_HDCP_RXSTATUS (0x00069493) | 378 | #define NV_DPCD_HDCP_RXSTATUS (0x00069493) |
379 | #define NV_DPCD_HDCP_RSVD (0x00069494) | 379 | #define NV_DPCD_HDCP_RSVD (0x00069494) |
380 | #define NV_DPCD_HDCP_DBG (0x00069518) | 380 | #define NV_DPCD_HDCP_DBG (0x00069518) |
381 | |||
382 | int __attribute__((weak)) tegra_dp_init_max_link_cfg_t19x( | ||
383 | struct tegra_dc_dp_data *dp, | ||
384 | struct tegra_dc_dp_link_config *cfg); | ||
385 | void tegra_dp_set_max_link_bw(struct tegra_dc_sor_data *sor, | ||
386 | struct tegra_dc_dp_link_config *cfg); | ||
381 | #endif | 387 | #endif |
diff --git a/drivers/video/tegra/dc/dp_lt.c b/drivers/video/tegra/dc/dp_lt.c index 8efad87ce..3997a6bfa 100644 --- a/drivers/video/tegra/dc/dp_lt.c +++ b/drivers/video/tegra/dc/dp_lt.c | |||
@@ -63,7 +63,8 @@ static inline bool is_pc2_supported(struct tegra_dp_lt_data *lt_data) | |||
63 | struct tegra_dc_dp_link_config *cfg = <_data->dp->link_cfg; | 63 | struct tegra_dc_dp_link_config *cfg = <_data->dp->link_cfg; |
64 | struct tegra_dp_out *dp_out = lt_data->dp->dc->out->dp_out; | 64 | struct tegra_dp_out *dp_out = lt_data->dp->dc->out->dp_out; |
65 | 65 | ||
66 | return (!dp_out->pc2_disabled && cfg->tps3_supported); | 66 | return (!dp_out->pc2_disabled && |
67 | cfg->tps == TEGRA_DC_DP_TRAINING_PATTERN_3); | ||
67 | } | 68 | } |
68 | 69 | ||
69 | /* | 70 | /* |
@@ -413,11 +414,8 @@ static int do_fast_lt_no_handshake(struct tegra_dp_lt_data *lt_data) | |||
413 | set_lt_tpg(lt_data, TEGRA_DC_DP_TRAINING_PATTERN_1); | 414 | set_lt_tpg(lt_data, TEGRA_DC_DP_TRAINING_PATTERN_1); |
414 | usleep_range(500, 600); | 415 | usleep_range(500, 600); |
415 | 416 | ||
416 | /* transmit link training pattern 2/3 for min of 500us */ | 417 | /* transmit channel equalization training pattern for min of 500us */ |
417 | if (lt_data->dp->link_cfg.tps3_supported) | 418 | set_lt_tpg(lt_data, lt_data->dp->link_cfg.tps); |
418 | set_lt_tpg(lt_data, TEGRA_DC_DP_TRAINING_PATTERN_3); | ||
419 | else | ||
420 | set_lt_tpg(lt_data, TEGRA_DC_DP_TRAINING_PATTERN_2); | ||
421 | usleep_range(500, 600); | 419 | usleep_range(500, 600); |
422 | 420 | ||
423 | return 0; | 421 | return 0; |
@@ -692,7 +690,6 @@ static void lt_channel_equalization_state(struct tegra_dp_lt_data *lt_data) | |||
692 | { | 690 | { |
693 | int tgt_state; | 691 | int tgt_state; |
694 | int timeout; | 692 | int timeout; |
695 | u32 tp_src = TEGRA_DC_DP_TRAINING_PATTERN_2; | ||
696 | bool cr_done = true; | 693 | bool cr_done = true; |
697 | bool ce_done = true; | 694 | bool ce_done = true; |
698 | bool cur_hpd; | 695 | bool cur_hpd; |
@@ -707,10 +704,7 @@ static void lt_channel_equalization_state(struct tegra_dp_lt_data *lt_data) | |||
707 | goto done; | 704 | goto done; |
708 | } | 705 | } |
709 | 706 | ||
710 | if (lt_data->dp->link_cfg.tps3_supported) | 707 | set_lt_tpg(lt_data, lt_data->dp->link_cfg.tps); |
711 | tp_src = TEGRA_DC_DP_TRAINING_PATTERN_3; | ||
712 | |||
713 | set_lt_tpg(lt_data, tp_src); | ||
714 | wait_aux_training(lt_data, false); | 708 | wait_aux_training(lt_data, false); |
715 | 709 | ||
716 | cr_done = get_clock_recovery_status(lt_data); | 710 | cr_done = get_clock_recovery_status(lt_data); |
diff --git a/drivers/video/tegra/dc/dp_lt.h b/drivers/video/tegra/dc/dp_lt.h index 9df98ecb4..4f1daa0d7 100644 --- a/drivers/video/tegra/dc/dp_lt.h +++ b/drivers/video/tegra/dc/dp_lt.h | |||
@@ -58,7 +58,6 @@ struct tegra_dp_lt_data { | |||
58 | struct completion lt_complete; | 58 | struct completion lt_complete; |
59 | 59 | ||
60 | u8 no_aux_handshake; | 60 | u8 no_aux_handshake; |
61 | u8 tps3_supported; | ||
62 | u8 aux_rd_interval; | 61 | u8 aux_rd_interval; |
63 | 62 | ||
64 | bool lt_config_valid; | 63 | bool lt_config_valid; |
diff --git a/drivers/video/tegra/dc/sor.c b/drivers/video/tegra/dc/sor.c index 7f8d9bf5e..abb321f67 100644 --- a/drivers/video/tegra/dc/sor.c +++ b/drivers/video/tegra/dc/sor.c | |||
@@ -829,6 +829,9 @@ struct tegra_dc_sor_data *tegra_dc_sor_init(struct tegra_dc *dc, | |||
829 | 829 | ||
830 | tegra_dc_populate_min_mode(); | 830 | tegra_dc_populate_min_mode(); |
831 | 831 | ||
832 | if (tegra_dc_is_t19x()) | ||
833 | tegra_sor_init_quirks_t19x(sor); | ||
834 | |||
832 | return sor; | 835 | return sor; |
833 | 836 | ||
834 | err_rst: __maybe_unused | 837 | err_rst: __maybe_unused |
diff --git a/drivers/video/tegra/dc/sor.h b/drivers/video/tegra/dc/sor.h index 0147878ec..41c73faae 100644 --- a/drivers/video/tegra/dc/sor.h +++ b/drivers/video/tegra/dc/sor.h | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "dc_priv.h" | 29 | #include "dc_priv.h" |
30 | #include "sor_regs.h" | 30 | #include "sor_regs.h" |
31 | 31 | ||
32 | /* Handle to a training pattern data object. Serves as the sole interface of | ||
33 | * APIs and data structures to the training pattern data object | ||
34 | */ | ||
32 | enum tegra_dc_dp_training_pattern_key { | 35 | enum tegra_dc_dp_training_pattern_key { |
33 | TEGRA_DC_DP_TRAINING_PATTERN_DISABLE, | 36 | TEGRA_DC_DP_TRAINING_PATTERN_DISABLE, |
34 | TEGRA_DC_DP_TRAINING_PATTERN_1, | 37 | TEGRA_DC_DP_TRAINING_PATTERN_1, |
@@ -41,6 +44,16 @@ enum tegra_dc_dp_training_pattern_key { | |||
41 | TEGRA_DC_DP_TRAINING_PATTERN_HBR2_COMPLIANCE, | 44 | TEGRA_DC_DP_TRAINING_PATTERN_HBR2_COMPLIANCE, |
42 | }; | 45 | }; |
43 | 46 | ||
47 | /* | ||
48 | * tegra_dc_dp_training_pattern - Training Pattern data object | ||
49 | * @dpcd_val - DPCD value defined by DP spec, corresponding to the TPS | ||
50 | * (Training Pattern Sequence). Used to hint the TPS to the sink | ||
51 | * that the source intends to use for link training | ||
52 | * @sor_reg_val - SOR value corresponding to the TPS. Used to force the source | ||
53 | * to use this TPS | ||
54 | * @scrambling - Denotes whether the bit stream needs to be scrambled | ||
55 | * @chan_coding - Denotes whether the bit stream needs to be 8b/10b coded | ||
56 | */ | ||
44 | struct tegra_dc_dp_training_pattern { | 57 | struct tegra_dc_dp_training_pattern { |
45 | u8 dpcd_val; | 58 | u8 dpcd_val; |
46 | u8 sor_reg_val; | 59 | u8 sor_reg_val; |
@@ -118,7 +131,12 @@ struct tegra_dc_dp_link_config { | |||
118 | u32 preemphasis[4]; | 131 | u32 preemphasis[4]; |
119 | u32 postcursor[4]; | 132 | u32 postcursor[4]; |
120 | 133 | ||
121 | bool tps3_supported; | 134 | /* |
135 | * Training Pattern Sequence to start channel equalization with, | ||
136 | * calculated based on an intersection of source and sink capabilities | ||
137 | */ | ||
138 | u32 tps; | ||
139 | |||
122 | u8 aux_rd_interval; | 140 | u8 aux_rd_interval; |
123 | }; | 141 | }; |
124 | 142 | ||
@@ -249,6 +267,8 @@ u32 __attribute__((weak)) | |||
249 | tegra_sor_get_pixel_depth_t19x(struct tegra_dc *dc); | 267 | tegra_sor_get_pixel_depth_t19x(struct tegra_dc *dc); |
250 | u32 __attribute__((weak)) | 268 | u32 __attribute__((weak)) |
251 | tegra_sor_get_adjusted_hblank_t19x(struct tegra_dc *dc, u32 hblank_end); | 269 | tegra_sor_get_adjusted_hblank_t19x(struct tegra_dc *dc, u32 hblank_end); |
270 | void __attribute__((weak)) tegra_sor_init_quirks_t19x( | ||
271 | struct tegra_dc_sor_data *sor); | ||
252 | 272 | ||
253 | static inline u32 nv_sor_head_state0(u32 i) | 273 | static inline u32 nv_sor_head_state0(u32 i) |
254 | { | 274 | { |