mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
drm/msm/dp: allow dp_ctrl stream APIs to use any panel passed to it
With MST, multiple sinks share a single DP controller, so a cached panel in msm_dp_ctrl_private can no longer represent the per-stream sink. Drop the cache and pass panel explicitly to all stream-related dp_ctrl APIs. Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/742745/ Link: https://lore.kernel.org/r/20260728-dp_mstclean-v9-10-f7779fce10f4@oss.qualcomm.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
parent
477d23a695
commit
2f0e61b6c5
|
|
@ -114,7 +114,6 @@ struct msm_dp_ctrl_private {
|
|||
struct drm_device *drm_dev;
|
||||
struct device *dev;
|
||||
struct drm_dp_aux *aux;
|
||||
struct msm_dp_panel *panel;
|
||||
struct msm_dp_link *link;
|
||||
void __iomem *ahb_base;
|
||||
void __iomem *link_base;
|
||||
|
|
@ -202,7 +201,8 @@ static int msm_dp_aux_link_configure(struct drm_dp_aux *aux,
|
|||
/*
|
||||
* NOTE: resetting DP controller will also clear any pending HPD related interrupts
|
||||
*/
|
||||
void msm_dp_ctrl_reset(struct msm_dp_ctrl *msm_dp_ctrl)
|
||||
void msm_dp_ctrl_reset(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
struct msm_dp_ctrl_private *ctrl =
|
||||
container_of(msm_dp_ctrl, struct msm_dp_ctrl_private, msm_dp_ctrl);
|
||||
|
|
@ -217,10 +217,9 @@ void msm_dp_ctrl_reset(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
sw_reset &= ~DP_SW_RESET;
|
||||
msm_dp_write_ahb(ctrl, REG_DP_SW_RESET, sw_reset);
|
||||
|
||||
if (!ctrl->hw_revision) {
|
||||
if (!ctrl->hw_revision)
|
||||
ctrl->hw_revision = msm_dp_read_ahb(ctrl, REG_DP_HW_VERSION);
|
||||
ctrl->panel->hw_revision = ctrl->hw_revision;
|
||||
}
|
||||
panel->hw_revision = ctrl->hw_revision;
|
||||
}
|
||||
|
||||
static u32 msm_dp_ctrl_get_aux_interrupt(struct msm_dp_ctrl_private *ctrl)
|
||||
|
|
@ -418,10 +417,11 @@ static void msm_dp_ctrl_config_ctrl_streams(struct msm_dp_ctrl_private *ctrl,
|
|||
msm_dp_write_link(ctrl, REG_DP_CONFIGURATION_CTRL, config);
|
||||
}
|
||||
|
||||
static void msm_dp_ctrl_config_ctrl_link(struct msm_dp_ctrl_private *ctrl)
|
||||
static void msm_dp_ctrl_config_ctrl_link(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
u32 config = 0;
|
||||
const u8 *dpcd = ctrl->panel->dpcd;
|
||||
const u8 *dpcd = panel->dpcd;
|
||||
|
||||
/* Default-> LSCLK DIV: 1/4 LCLK */
|
||||
config |= (2 << DP_CONFIGURATION_CTRL_LSCLK_DIV_SHIFT);
|
||||
|
|
@ -484,13 +484,14 @@ static void msm_dp_ctrl_config_misc1_misc0(struct msm_dp_ctrl_private *ctrl,
|
|||
msm_dp_write_link(ctrl, REG_DP_MISC1_MISC0, misc_val);
|
||||
}
|
||||
|
||||
static void msm_dp_ctrl_configure_source_params(struct msm_dp_ctrl_private *ctrl)
|
||||
static void msm_dp_ctrl_configure_source_params(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
msm_dp_ctrl_config_ctrl_streams(ctrl, ctrl->panel);
|
||||
msm_dp_ctrl_config_ctrl_streams(ctrl, panel);
|
||||
|
||||
msm_dp_ctrl_config_misc1_misc0(ctrl, ctrl->panel);
|
||||
msm_dp_ctrl_config_misc1_misc0(ctrl, panel);
|
||||
|
||||
msm_dp_panel_timing_cfg(ctrl->panel, ctrl->msm_dp_ctrl.wide_bus_en);
|
||||
msm_dp_panel_timing_cfg(panel, ctrl->msm_dp_ctrl.wide_bus_en);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1260,20 +1261,21 @@ static void _dp_ctrl_calc_tu(struct msm_dp_ctrl_private *ctrl,
|
|||
}
|
||||
|
||||
static void msm_dp_ctrl_calc_tu_parameters(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
struct msm_dp_vc_tu_mapping_table *tu_table)
|
||||
{
|
||||
struct msm_dp_tu_calc_input in;
|
||||
struct drm_display_mode *drm_mode;
|
||||
const struct drm_display_mode *drm_mode;
|
||||
|
||||
drm_mode = &ctrl->panel->msm_dp_mode.drm_mode;
|
||||
drm_mode = &panel->msm_dp_mode.drm_mode;
|
||||
|
||||
in.lclk = ctrl->link->link_params.rate / 1000;
|
||||
in.pclk_khz = drm_mode->clock;
|
||||
in.hactive = drm_mode->hdisplay;
|
||||
in.hporch = drm_mode->htotal - drm_mode->hdisplay;
|
||||
in.nlanes = ctrl->link->link_params.num_lanes;
|
||||
in.bpp = ctrl->panel->msm_dp_mode.bpp;
|
||||
in.pixel_enc = ctrl->panel->msm_dp_mode.out_fmt_is_yuv_420 ? 420 : 444;
|
||||
in.bpp = panel->msm_dp_mode.bpp;
|
||||
in.pixel_enc = panel->msm_dp_mode.out_fmt_is_yuv_420 ? 420 : 444;
|
||||
in.dsc_en = 0;
|
||||
in.async_en = 0;
|
||||
in.fec_en = 0;
|
||||
|
|
@ -1283,14 +1285,15 @@ static void msm_dp_ctrl_calc_tu_parameters(struct msm_dp_ctrl_private *ctrl,
|
|||
_dp_ctrl_calc_tu(ctrl, &in, tu_table);
|
||||
}
|
||||
|
||||
static void msm_dp_ctrl_setup_tr_unit(struct msm_dp_ctrl_private *ctrl)
|
||||
static void msm_dp_ctrl_setup_tr_unit(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
u32 msm_dp_tu = 0x0;
|
||||
u32 valid_boundary = 0x0;
|
||||
u32 valid_boundary2 = 0x0;
|
||||
struct msm_dp_vc_tu_mapping_table tu_calc_table;
|
||||
|
||||
msm_dp_ctrl_calc_tu_parameters(ctrl, &tu_calc_table);
|
||||
msm_dp_ctrl_calc_tu_parameters(ctrl, panel, &tu_calc_table);
|
||||
|
||||
msm_dp_tu |= tu_calc_table.tu_size_minus1;
|
||||
valid_boundary |= tu_calc_table.valid_boundary_link;
|
||||
|
|
@ -1442,6 +1445,7 @@ static int msm_dp_ctrl_set_pattern_state_bit(struct msm_dp_ctrl_private *ctrl,
|
|||
}
|
||||
|
||||
static int msm_dp_ctrl_link_train_1(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
int *training_step, enum drm_dp_phy dp_phy)
|
||||
{
|
||||
int delay_us;
|
||||
|
|
@ -1450,7 +1454,7 @@ static int msm_dp_ctrl_link_train_1(struct msm_dp_ctrl_private *ctrl,
|
|||
int const maximum_retries = 4;
|
||||
|
||||
delay_us = drm_dp_read_clock_recovery_delay(ctrl->aux,
|
||||
ctrl->panel->dpcd, dp_phy, false);
|
||||
panel->dpcd, dp_phy, false);
|
||||
|
||||
msm_dp_write_link(ctrl, REG_DP_STATE_CTRL, 0);
|
||||
|
||||
|
|
@ -1536,14 +1540,15 @@ static int msm_dp_ctrl_link_rate_down_shift(struct msm_dp_ctrl_private *ctrl)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_link_lane_down_shift(struct msm_dp_ctrl_private *ctrl)
|
||||
static int msm_dp_ctrl_link_lane_down_shift(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
|
||||
if (ctrl->link->link_params.num_lanes == 1)
|
||||
return -1;
|
||||
|
||||
ctrl->link->link_params.num_lanes /= 2;
|
||||
ctrl->link->link_params.rate = ctrl->panel->link_info.rate;
|
||||
ctrl->link->link_params.rate = panel->link_info.rate;
|
||||
|
||||
ctrl->link->phy_params.p_level = 0;
|
||||
ctrl->link->phy_params.v_level = 0;
|
||||
|
|
@ -1552,6 +1557,7 @@ static int msm_dp_ctrl_link_lane_down_shift(struct msm_dp_ctrl_private *ctrl)
|
|||
}
|
||||
|
||||
static void msm_dp_ctrl_clear_training_pattern(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
enum drm_dp_phy dp_phy)
|
||||
{
|
||||
int delay_us;
|
||||
|
|
@ -1559,11 +1565,12 @@ static void msm_dp_ctrl_clear_training_pattern(struct msm_dp_ctrl_private *ctrl,
|
|||
msm_dp_ctrl_train_pattern_set(ctrl, DP_TRAINING_PATTERN_DISABLE, dp_phy);
|
||||
|
||||
delay_us = drm_dp_read_channel_eq_delay(ctrl->aux,
|
||||
ctrl->panel->dpcd, dp_phy, false);
|
||||
panel->dpcd, dp_phy, false);
|
||||
fsleep(delay_us);
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_link_train_2(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
int *training_step, enum drm_dp_phy dp_phy)
|
||||
{
|
||||
int delay_us;
|
||||
|
|
@ -1574,16 +1581,16 @@ static int msm_dp_ctrl_link_train_2(struct msm_dp_ctrl_private *ctrl,
|
|||
u8 link_status[DP_LINK_STATUS_SIZE];
|
||||
|
||||
delay_us = drm_dp_read_channel_eq_delay(ctrl->aux,
|
||||
ctrl->panel->dpcd, dp_phy, false);
|
||||
panel->dpcd, dp_phy, false);
|
||||
|
||||
msm_dp_write_link(ctrl, REG_DP_STATE_CTRL, 0);
|
||||
|
||||
*training_step = DP_TRAINING_2;
|
||||
|
||||
if (drm_dp_tps4_supported(ctrl->panel->dpcd)) {
|
||||
if (drm_dp_tps4_supported(panel->dpcd)) {
|
||||
pattern = DP_TRAINING_PATTERN_4;
|
||||
state_ctrl_bit = 4;
|
||||
} else if (drm_dp_tps3_supported(ctrl->panel->dpcd)) {
|
||||
} else if (drm_dp_tps3_supported(panel->dpcd)) {
|
||||
pattern = DP_TRAINING_PATTERN_3;
|
||||
state_ctrl_bit = 3;
|
||||
} else {
|
||||
|
|
@ -1620,18 +1627,19 @@ static int msm_dp_ctrl_link_train_2(struct msm_dp_ctrl_private *ctrl,
|
|||
}
|
||||
|
||||
static int msm_dp_ctrl_link_train_1_2(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
int *training_step, enum drm_dp_phy dp_phy)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = msm_dp_ctrl_link_train_1(ctrl, training_step, dp_phy);
|
||||
ret = msm_dp_ctrl_link_train_1(ctrl, panel, training_step, dp_phy);
|
||||
if (ret) {
|
||||
DRM_ERROR("link training #1 on phy %d failed. ret=%d\n", dp_phy, ret);
|
||||
return ret;
|
||||
}
|
||||
drm_dbg_dp(ctrl->drm_dev, "link training #1 on phy %d successful\n", dp_phy);
|
||||
|
||||
ret = msm_dp_ctrl_link_train_2(ctrl, training_step, dp_phy);
|
||||
ret = msm_dp_ctrl_link_train_2(ctrl, panel, training_step, dp_phy);
|
||||
if (ret) {
|
||||
DRM_ERROR("link training #2 on phy %d failed. ret=%d\n", dp_phy, ret);
|
||||
return ret;
|
||||
|
|
@ -1642,17 +1650,18 @@ static int msm_dp_ctrl_link_train_1_2(struct msm_dp_ctrl_private *ctrl,
|
|||
}
|
||||
|
||||
static int msm_dp_ctrl_link_train(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
int *training_step)
|
||||
{
|
||||
int i;
|
||||
int ret = 0;
|
||||
const u8 *dpcd = ctrl->panel->dpcd;
|
||||
const u8 *dpcd = panel->dpcd;
|
||||
u8 encoding[] = { 0, DP_SET_ANSI_8B10B };
|
||||
u8 assr;
|
||||
struct msm_dp_link_info link_info = {0};
|
||||
|
||||
msm_dp_ctrl_config_ctrl_link(ctrl);
|
||||
msm_dp_ctrl_config_ctrl_streams(ctrl, ctrl->panel);
|
||||
msm_dp_ctrl_config_ctrl_link(ctrl, panel);
|
||||
msm_dp_ctrl_config_ctrl_streams(ctrl, panel);
|
||||
|
||||
link_info.num_lanes = ctrl->link->link_params.num_lanes;
|
||||
link_info.rate = ctrl->link->link_params.rate;
|
||||
|
|
@ -1675,8 +1684,8 @@ static int msm_dp_ctrl_link_train(struct msm_dp_ctrl_private *ctrl,
|
|||
for (i = ctrl->link->lttpr_count - 1; i >= 0; i--) {
|
||||
enum drm_dp_phy dp_phy = DP_PHY_LTTPR(i);
|
||||
|
||||
ret = msm_dp_ctrl_link_train_1_2(ctrl, training_step, dp_phy);
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, dp_phy);
|
||||
ret = msm_dp_ctrl_link_train_1_2(ctrl, panel, training_step, dp_phy);
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, panel, dp_phy);
|
||||
|
||||
if (ret)
|
||||
break;
|
||||
|
|
@ -1687,7 +1696,7 @@ static int msm_dp_ctrl_link_train(struct msm_dp_ctrl_private *ctrl,
|
|||
goto end;
|
||||
}
|
||||
|
||||
ret = msm_dp_ctrl_link_train_1_2(ctrl, training_step, DP_PHY_DPRX);
|
||||
ret = msm_dp_ctrl_link_train_1_2(ctrl, panel, training_step, DP_PHY_DPRX);
|
||||
if (ret) {
|
||||
DRM_ERROR("link training on sink failed. ret=%d\n", ret);
|
||||
goto end;
|
||||
|
|
@ -1700,6 +1709,7 @@ static int msm_dp_ctrl_link_train(struct msm_dp_ctrl_private *ctrl,
|
|||
}
|
||||
|
||||
static int msm_dp_ctrl_setup_main_link(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
int *training_step)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
@ -1715,7 +1725,7 @@ static int msm_dp_ctrl_setup_main_link(struct msm_dp_ctrl_private *ctrl,
|
|||
* a link training pattern, we have to first do soft reset.
|
||||
*/
|
||||
|
||||
ret = msm_dp_ctrl_link_train(ctrl, training_step);
|
||||
ret = msm_dp_ctrl_link_train(ctrl, panel, training_step);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1814,11 +1824,12 @@ static void msm_dp_ctrl_link_clk_disable(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
str_on_off(ctrl->core_clks_on));
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_enable_mainlink_clocks(struct msm_dp_ctrl_private *ctrl)
|
||||
static int msm_dp_ctrl_enable_mainlink_clocks(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
int ret = 0;
|
||||
struct phy *phy = ctrl->phy;
|
||||
const u8 *dpcd = ctrl->panel->dpcd;
|
||||
const u8 *dpcd = panel->dpcd;
|
||||
|
||||
ctrl->phy_opts.dp.lanes = ctrl->link->link_params.num_lanes;
|
||||
ctrl->phy_opts.dp.link_rate = ctrl->link->link_params.rate / 100;
|
||||
|
|
@ -1870,13 +1881,14 @@ static void msm_dp_ctrl_psr_exit(struct msm_dp_ctrl_private *ctrl)
|
|||
msm_dp_write_link(ctrl, REG_PSR_CMD, cmd);
|
||||
}
|
||||
|
||||
void msm_dp_ctrl_config_psr(struct msm_dp_ctrl *msm_dp_ctrl)
|
||||
void msm_dp_ctrl_config_psr(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
struct msm_dp_ctrl_private *ctrl = container_of(msm_dp_ctrl,
|
||||
struct msm_dp_ctrl_private, msm_dp_ctrl);
|
||||
u32 cfg;
|
||||
|
||||
if (!ctrl->panel->psr_cap.version)
|
||||
if (!panel->psr_cap.version)
|
||||
return;
|
||||
|
||||
/* enable PSR1 function */
|
||||
|
|
@ -1891,12 +1903,13 @@ void msm_dp_ctrl_config_psr(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
drm_dp_dpcd_write(ctrl->aux, DP_PSR_EN_CFG, &cfg, 1);
|
||||
}
|
||||
|
||||
void msm_dp_ctrl_set_psr(struct msm_dp_ctrl *msm_dp_ctrl, bool enter)
|
||||
void msm_dp_ctrl_set_psr(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel, bool enter)
|
||||
{
|
||||
struct msm_dp_ctrl_private *ctrl = container_of(msm_dp_ctrl,
|
||||
struct msm_dp_ctrl_private, msm_dp_ctrl);
|
||||
|
||||
if (!ctrl->panel->psr_cap.version)
|
||||
if (!panel->psr_cap.version)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
|
@ -1966,7 +1979,8 @@ void msm_dp_ctrl_phy_exit(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
phy_exit(phy);
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_reinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
|
||||
static int msm_dp_ctrl_reinitialize_mainlink(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
struct phy *phy = ctrl->phy;
|
||||
int ret = 0;
|
||||
|
|
@ -1987,7 +2001,7 @@ static int msm_dp_ctrl_reinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
|
|||
/* hw recommended delay before re-enabling clocks */
|
||||
msleep(20);
|
||||
|
||||
ret = msm_dp_ctrl_enable_mainlink_clocks(ctrl);
|
||||
ret = msm_dp_ctrl_enable_mainlink_clocks(ctrl, panel);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to enable mainlink clks. ret=%d\n", ret);
|
||||
return ret;
|
||||
|
|
@ -1996,7 +2010,8 @@ static int msm_dp_ctrl_reinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_deinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
|
||||
static int msm_dp_ctrl_deinitialize_mainlink(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
struct phy *phy;
|
||||
|
||||
|
|
@ -2004,7 +2019,7 @@ static int msm_dp_ctrl_deinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
|
|||
|
||||
msm_dp_ctrl_mainlink_disable(ctrl);
|
||||
|
||||
msm_dp_ctrl_reset(&ctrl->msm_dp_ctrl);
|
||||
msm_dp_ctrl_reset(&ctrl->msm_dp_ctrl, panel);
|
||||
|
||||
dev_pm_opp_set_rate(ctrl->dev, 0);
|
||||
msm_dp_ctrl_link_clk_disable(&ctrl->msm_dp_ctrl);
|
||||
|
|
@ -2018,7 +2033,8 @@ static int msm_dp_ctrl_deinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_link_maintenance(struct msm_dp_ctrl_private *ctrl)
|
||||
static int msm_dp_ctrl_link_maintenance(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
int ret = 0;
|
||||
int training_step = DP_TRAINING_NONE;
|
||||
|
|
@ -2028,11 +2044,11 @@ static int msm_dp_ctrl_link_maintenance(struct msm_dp_ctrl_private *ctrl)
|
|||
ctrl->link->phy_params.p_level = 0;
|
||||
ctrl->link->phy_params.v_level = 0;
|
||||
|
||||
ret = msm_dp_ctrl_setup_main_link(ctrl, &training_step);
|
||||
ret = msm_dp_ctrl_setup_main_link(ctrl, panel, &training_step);
|
||||
if (ret)
|
||||
goto end;
|
||||
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, DP_PHY_DPRX);
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, panel, DP_PHY_DPRX);
|
||||
|
||||
msm_dp_write_link(ctrl, REG_DP_STATE_CTRL, DP_STATE_CTRL_SEND_VIDEO);
|
||||
|
||||
|
|
@ -2211,7 +2227,8 @@ static void msm_dp_ctrl_off_pixel_clk(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
}
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_process_phy_test_request(struct msm_dp_ctrl_private *ctrl)
|
||||
static int msm_dp_ctrl_process_phy_test_request(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
int ret;
|
||||
unsigned long pixel_rate;
|
||||
|
|
@ -2227,15 +2244,15 @@ static int msm_dp_ctrl_process_phy_test_request(struct msm_dp_ctrl_private *ctrl
|
|||
* running. Add the global reset just before disabling the
|
||||
* link clocks and core clocks.
|
||||
*/
|
||||
msm_dp_ctrl_off(&ctrl->msm_dp_ctrl);
|
||||
msm_dp_ctrl_off(&ctrl->msm_dp_ctrl, panel);
|
||||
|
||||
ret = msm_dp_ctrl_on_link(&ctrl->msm_dp_ctrl);
|
||||
ret = msm_dp_ctrl_on_link(&ctrl->msm_dp_ctrl, panel);
|
||||
if (ret) {
|
||||
DRM_ERROR("failed to enable DP link controller\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
pixel_rate = ctrl->panel->msm_dp_mode.drm_mode.clock;
|
||||
pixel_rate = panel->msm_dp_mode.drm_mode.clock;
|
||||
ret = msm_dp_ctrl_on_pixel_clk(ctrl, pixel_rate);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -2245,7 +2262,8 @@ static int msm_dp_ctrl_process_phy_test_request(struct msm_dp_ctrl_private *ctrl
|
|||
return 0;
|
||||
}
|
||||
|
||||
void msm_dp_ctrl_handle_sink_request(struct msm_dp_ctrl *msm_dp_ctrl)
|
||||
void msm_dp_ctrl_handle_sink_request(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
struct msm_dp_ctrl_private *ctrl;
|
||||
u32 sink_request = 0x0;
|
||||
|
|
@ -2260,14 +2278,14 @@ void msm_dp_ctrl_handle_sink_request(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
|
||||
if (sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) {
|
||||
drm_dbg_dp(ctrl->drm_dev, "PHY_TEST_PATTERN request\n");
|
||||
if (msm_dp_ctrl_process_phy_test_request(ctrl)) {
|
||||
if (msm_dp_ctrl_process_phy_test_request(ctrl, panel)) {
|
||||
DRM_ERROR("process phy_test_req failed\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (sink_request & DP_LINK_STATUS_UPDATED) {
|
||||
if (msm_dp_ctrl_link_maintenance(ctrl)) {
|
||||
if (msm_dp_ctrl_link_maintenance(ctrl, panel)) {
|
||||
DRM_ERROR("LM failed: TEST_LINK_TRAINING\n");
|
||||
return;
|
||||
}
|
||||
|
|
@ -2275,7 +2293,7 @@ void msm_dp_ctrl_handle_sink_request(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
|
||||
if (sink_request & DP_TEST_LINK_TRAINING) {
|
||||
msm_dp_link_send_test_response(ctrl->link);
|
||||
if (msm_dp_ctrl_link_maintenance(ctrl)) {
|
||||
if (msm_dp_ctrl_link_maintenance(ctrl, panel)) {
|
||||
DRM_ERROR("LM failed: TEST_LINK_TRAINING\n");
|
||||
return;
|
||||
}
|
||||
|
|
@ -2311,7 +2329,8 @@ static bool msm_dp_ctrl_channel_eq_ok(struct msm_dp_ctrl_private *ctrl)
|
|||
return drm_dp_channel_eq_ok(link_status, num_lanes);
|
||||
}
|
||||
|
||||
int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
||||
int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_dp_ctrl_private *ctrl;
|
||||
|
|
@ -2327,8 +2346,8 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
|
||||
ctrl = container_of(msm_dp_ctrl, struct msm_dp_ctrl_private, msm_dp_ctrl);
|
||||
|
||||
rate = ctrl->panel->link_info.rate;
|
||||
pixel_rate = ctrl->panel->msm_dp_mode.drm_mode.clock;
|
||||
rate = panel->link_info.rate;
|
||||
pixel_rate = panel->msm_dp_mode.drm_mode.clock;
|
||||
|
||||
msm_dp_ctrl_core_clk_enable(&ctrl->msm_dp_ctrl);
|
||||
|
||||
|
|
@ -2340,8 +2359,8 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
} else {
|
||||
ctrl->link->link_params.rate = rate;
|
||||
ctrl->link->link_params.num_lanes =
|
||||
ctrl->panel->link_info.num_lanes;
|
||||
if (ctrl->panel->msm_dp_mode.out_fmt_is_yuv_420)
|
||||
panel->link_info.num_lanes;
|
||||
if (panel->msm_dp_mode.out_fmt_is_yuv_420)
|
||||
pixel_rate >>= 1;
|
||||
}
|
||||
|
||||
|
|
@ -2349,13 +2368,13 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
ctrl->link->link_params.rate, ctrl->link->link_params.num_lanes,
|
||||
pixel_rate);
|
||||
|
||||
rc = msm_dp_ctrl_enable_mainlink_clocks(ctrl);
|
||||
rc = msm_dp_ctrl_enable_mainlink_clocks(ctrl, panel);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
while (--link_train_max_retries) {
|
||||
training_step = DP_TRAINING_NONE;
|
||||
rc = msm_dp_ctrl_setup_main_link(ctrl, &training_step);
|
||||
rc = msm_dp_ctrl_setup_main_link(ctrl, panel, &training_step);
|
||||
if (rc == 0) {
|
||||
/* training completed successfully */
|
||||
break;
|
||||
|
|
@ -2374,7 +2393,7 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
* some lanes are ready,
|
||||
* reduce lane number
|
||||
*/
|
||||
rc = msm_dp_ctrl_link_lane_down_shift(ctrl);
|
||||
rc = msm_dp_ctrl_link_lane_down_shift(ctrl, panel);
|
||||
if (rc < 0) { /* lane == 1 already */
|
||||
/* end with failure */
|
||||
break;
|
||||
|
|
@ -2395,7 +2414,7 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
ctrl->link->link_params.num_lanes))
|
||||
rc = msm_dp_ctrl_link_rate_down_shift(ctrl);
|
||||
else
|
||||
rc = msm_dp_ctrl_link_lane_down_shift(ctrl);
|
||||
rc = msm_dp_ctrl_link_lane_down_shift(ctrl, panel);
|
||||
|
||||
if (rc < 0) {
|
||||
/* end with failure */
|
||||
|
|
@ -2403,10 +2422,10 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
}
|
||||
|
||||
/* stop link training before start re training */
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, DP_PHY_DPRX);
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, panel, DP_PHY_DPRX);
|
||||
}
|
||||
|
||||
rc = msm_dp_ctrl_reinitialize_mainlink(ctrl);
|
||||
rc = msm_dp_ctrl_reinitialize_mainlink(ctrl, panel);
|
||||
if (rc) {
|
||||
DRM_ERROR("Failed to reinitialize mainlink. rc=%d\n", rc);
|
||||
break;
|
||||
|
|
@ -2427,20 +2446,21 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
* link training failed
|
||||
* end txing train pattern here
|
||||
*/
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, DP_PHY_DPRX);
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, panel, DP_PHY_DPRX);
|
||||
|
||||
msm_dp_ctrl_deinitialize_mainlink(ctrl);
|
||||
msm_dp_ctrl_deinitialize_mainlink(ctrl, panel);
|
||||
rc = -ECONNRESET;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int msm_dp_ctrl_link_retrain(struct msm_dp_ctrl_private *ctrl)
|
||||
static int msm_dp_ctrl_link_retrain(struct msm_dp_ctrl_private *ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
int training_step = DP_TRAINING_NONE;
|
||||
|
||||
return msm_dp_ctrl_setup_main_link(ctrl, &training_step);
|
||||
return msm_dp_ctrl_setup_main_link(ctrl, panel, &training_step);
|
||||
}
|
||||
|
||||
static void msm_dp_ctrl_config_msa(struct msm_dp_ctrl_private *ctrl,
|
||||
|
|
@ -2511,7 +2531,9 @@ static void msm_dp_ctrl_config_msa(struct msm_dp_ctrl_private *ctrl,
|
|||
msm_dp_write_link(ctrl, REG_DP_SOFTWARE_NVID, nvid);
|
||||
}
|
||||
|
||||
int msm_dp_ctrl_prepare_stream_on(struct msm_dp_ctrl *msm_dp_ctrl, bool force_link_train)
|
||||
int msm_dp_ctrl_prepare_stream_on(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
bool force_link_train)
|
||||
{
|
||||
int ret = 0;
|
||||
struct msm_dp_ctrl_private *ctrl;
|
||||
|
|
@ -2530,7 +2552,7 @@ int msm_dp_ctrl_prepare_stream_on(struct msm_dp_ctrl *msm_dp_ctrl, bool force_li
|
|||
ctrl->core_clks_on, ctrl->link_clks_on, ctrl->stream_clks_on);
|
||||
|
||||
if (!ctrl->link_clks_on) { /* link clk is off */
|
||||
ret = msm_dp_ctrl_enable_mainlink_clocks(ctrl);
|
||||
ret = msm_dp_ctrl_enable_mainlink_clocks(ctrl, panel);
|
||||
if (ret) {
|
||||
DRM_ERROR("Failed to start link clocks. ret=%d\n", ret);
|
||||
return ret;
|
||||
|
|
@ -2538,15 +2560,15 @@ int msm_dp_ctrl_prepare_stream_on(struct msm_dp_ctrl *msm_dp_ctrl, bool force_li
|
|||
}
|
||||
|
||||
if (force_link_train || !msm_dp_ctrl_channel_eq_ok(ctrl))
|
||||
msm_dp_ctrl_link_retrain(ctrl);
|
||||
msm_dp_ctrl_link_retrain(ctrl, panel);
|
||||
|
||||
/* stop txing train pattern to end link training */
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, DP_PHY_DPRX);
|
||||
msm_dp_ctrl_clear_training_pattern(ctrl, panel, DP_PHY_DPRX);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl)
|
||||
int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl, struct msm_dp_panel *panel)
|
||||
{
|
||||
int ret = 0;
|
||||
bool mainlink_ready = false;
|
||||
|
|
@ -2559,10 +2581,10 @@ int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
|
||||
ctrl = container_of(msm_dp_ctrl, struct msm_dp_ctrl_private, msm_dp_ctrl);
|
||||
|
||||
pixel_rate_orig = ctrl->panel->msm_dp_mode.drm_mode.clock;
|
||||
pixel_rate_orig = panel->msm_dp_mode.drm_mode.clock;
|
||||
pixel_rate = pixel_rate_orig;
|
||||
|
||||
if (msm_dp_ctrl->wide_bus_en || ctrl->panel->msm_dp_mode.out_fmt_is_yuv_420)
|
||||
if (msm_dp_ctrl->wide_bus_en || panel->msm_dp_mode.out_fmt_is_yuv_420)
|
||||
pixel_rate >>= 1;
|
||||
|
||||
drm_dbg_dp(ctrl->drm_dev, "pixel_rate=%lu\n", pixel_rate);
|
||||
|
|
@ -2579,18 +2601,18 @@ int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
|
||||
msm_dp_ctrl_lane_mapping(ctrl);
|
||||
msm_dp_setup_peripheral_flush(ctrl);
|
||||
msm_dp_ctrl_config_ctrl_link(ctrl);
|
||||
msm_dp_ctrl_config_ctrl_link(ctrl, panel);
|
||||
|
||||
msm_dp_ctrl_configure_source_params(ctrl);
|
||||
msm_dp_ctrl_configure_source_params(ctrl, panel);
|
||||
|
||||
msm_dp_ctrl_config_msa(ctrl,
|
||||
ctrl->link->link_params.rate,
|
||||
pixel_rate_orig,
|
||||
ctrl->panel->msm_dp_mode.out_fmt_is_yuv_420);
|
||||
panel->msm_dp_mode.out_fmt_is_yuv_420);
|
||||
|
||||
msm_dp_panel_clear_dsc_dto(ctrl->panel);
|
||||
msm_dp_panel_clear_dsc_dto(panel);
|
||||
|
||||
msm_dp_ctrl_setup_tr_unit(ctrl);
|
||||
msm_dp_ctrl_setup_tr_unit(ctrl, panel);
|
||||
|
||||
msm_dp_write_link(ctrl, REG_DP_STATE_CTRL, DP_STATE_CTRL_SEND_VIDEO);
|
||||
|
||||
|
|
@ -2618,7 +2640,8 @@ void msm_dp_ctrl_reinit_phy(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
phy_init(phy);
|
||||
}
|
||||
|
||||
void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl)
|
||||
void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
struct msm_dp_ctrl_private *ctrl;
|
||||
struct phy *phy;
|
||||
|
|
@ -2626,11 +2649,11 @@ void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
ctrl = container_of(msm_dp_ctrl, struct msm_dp_ctrl_private, msm_dp_ctrl);
|
||||
phy = ctrl->phy;
|
||||
|
||||
msm_dp_panel_disable_vsc_sdp(ctrl->panel);
|
||||
msm_dp_panel_disable_vsc_sdp(panel);
|
||||
|
||||
msm_dp_ctrl_mainlink_disable(ctrl);
|
||||
|
||||
msm_dp_ctrl_reset(&ctrl->msm_dp_ctrl);
|
||||
msm_dp_ctrl_reset(&ctrl->msm_dp_ctrl, panel);
|
||||
|
||||
msm_dp_ctrl_off_pixel_clk(msm_dp_ctrl);
|
||||
dev_pm_opp_set_rate(ctrl->dev, 0);
|
||||
|
|
@ -2639,7 +2662,8 @@ void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
phy_power_off(phy);
|
||||
}
|
||||
|
||||
irqreturn_t msm_dp_ctrl_isr(struct msm_dp_ctrl *msm_dp_ctrl)
|
||||
irqreturn_t msm_dp_ctrl_isr(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel)
|
||||
{
|
||||
struct msm_dp_ctrl_private *ctrl;
|
||||
u32 isr;
|
||||
|
|
@ -2650,7 +2674,7 @@ irqreturn_t msm_dp_ctrl_isr(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
|
||||
ctrl = container_of(msm_dp_ctrl, struct msm_dp_ctrl_private, msm_dp_ctrl);
|
||||
|
||||
if (ctrl->panel->psr_cap.version) {
|
||||
if (panel->psr_cap.version) {
|
||||
isr = msm_dp_ctrl_get_psr_interrupt(ctrl);
|
||||
|
||||
if (isr)
|
||||
|
|
@ -2739,7 +2763,7 @@ static int msm_dp_ctrl_clk_init(struct msm_dp_ctrl *msm_dp_ctrl)
|
|||
}
|
||||
|
||||
struct msm_dp_ctrl *msm_dp_ctrl_get(struct device *dev, struct msm_dp_link *link,
|
||||
struct msm_dp_panel *panel, struct drm_dp_aux *aux,
|
||||
struct drm_dp_aux *aux,
|
||||
struct phy *phy,
|
||||
void __iomem *ahb_base,
|
||||
void __iomem *link_base)
|
||||
|
|
@ -2747,7 +2771,7 @@ struct msm_dp_ctrl *msm_dp_ctrl_get(struct device *dev, struct msm_dp_link *link
|
|||
struct msm_dp_ctrl_private *ctrl;
|
||||
int ret;
|
||||
|
||||
if (!dev || !panel || !aux || !link) {
|
||||
if (!dev || !aux || !link) {
|
||||
DRM_ERROR("invalid input\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
|
@ -2775,7 +2799,6 @@ struct msm_dp_ctrl *msm_dp_ctrl_get(struct device *dev, struct msm_dp_link *link
|
|||
init_completion(&ctrl->video_comp);
|
||||
|
||||
/* in parameters */
|
||||
ctrl->panel = panel;
|
||||
ctrl->aux = aux;
|
||||
ctrl->link = link;
|
||||
ctrl->dev = dev;
|
||||
|
|
|
|||
|
|
@ -16,28 +16,36 @@ struct msm_dp_ctrl {
|
|||
|
||||
struct phy;
|
||||
|
||||
int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
int msm_dp_ctrl_prepare_stream_on(struct msm_dp_ctrl *msm_dp_ctrl, bool force_link_train);
|
||||
void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel);
|
||||
int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl, struct msm_dp_panel *panel);
|
||||
int msm_dp_ctrl_prepare_stream_on(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel,
|
||||
bool force_link_train);
|
||||
void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel);
|
||||
void msm_dp_ctrl_push_idle(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
irqreturn_t msm_dp_ctrl_isr(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
void msm_dp_ctrl_handle_sink_request(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
irqreturn_t msm_dp_ctrl_isr(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel);
|
||||
void msm_dp_ctrl_handle_sink_request(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel);
|
||||
struct msm_dp_ctrl *msm_dp_ctrl_get(struct device *dev,
|
||||
struct msm_dp_link *link,
|
||||
struct msm_dp_panel *panel,
|
||||
struct drm_dp_aux *aux,
|
||||
struct phy *phy,
|
||||
void __iomem *ahb_base,
|
||||
void __iomem *link_base);
|
||||
|
||||
void msm_dp_ctrl_reset(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
void msm_dp_ctrl_reset(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel);
|
||||
void msm_dp_ctrl_phy_init(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
void msm_dp_ctrl_phy_exit(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
void msm_dp_ctrl_irq_phy_exit(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
|
||||
void msm_dp_ctrl_set_psr(struct msm_dp_ctrl *msm_dp_ctrl, bool enable);
|
||||
void msm_dp_ctrl_config_psr(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
void msm_dp_ctrl_set_psr(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel, bool enable);
|
||||
void msm_dp_ctrl_config_psr(struct msm_dp_ctrl *msm_dp_ctrl,
|
||||
struct msm_dp_panel *panel);
|
||||
|
||||
int msm_dp_ctrl_core_clk_enable(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
void msm_dp_ctrl_core_clk_disable(struct msm_dp_ctrl *msm_dp_ctrl);
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ static void msm_dp_display_host_init(struct msm_dp_display_private *dp)
|
|||
dp->phy_initialized);
|
||||
|
||||
msm_dp_ctrl_core_clk_enable(dp->ctrl);
|
||||
msm_dp_ctrl_reset(dp->ctrl);
|
||||
msm_dp_ctrl_reset(dp->ctrl, dp->panel);
|
||||
msm_dp_ctrl_enable_irq(dp->ctrl);
|
||||
msm_dp_aux_init(dp->aux);
|
||||
dp->core_initialized = true;
|
||||
|
|
@ -371,7 +371,7 @@ static void msm_dp_display_host_deinit(struct msm_dp_display_private *dp)
|
|||
dp->msm_dp_display.connector_type, dp->core_initialized,
|
||||
dp->phy_initialized);
|
||||
|
||||
msm_dp_ctrl_reset(dp->ctrl);
|
||||
msm_dp_ctrl_reset(dp->ctrl, dp->panel);
|
||||
msm_dp_ctrl_disable_irq(dp->ctrl);
|
||||
msm_dp_aux_deinit(dp->aux);
|
||||
msm_dp_ctrl_core_clk_disable(dp->ctrl);
|
||||
|
|
@ -392,7 +392,7 @@ static int msm_dp_display_handle_irq_hpd(struct msm_dp_display_private *dp)
|
|||
|
||||
drm_dbg_dp(dp->drm_dev, "%d\n", sink_request);
|
||||
|
||||
msm_dp_ctrl_handle_sink_request(dp->ctrl);
|
||||
msm_dp_ctrl_handle_sink_request(dp->ctrl, dp->panel);
|
||||
|
||||
if (sink_request & DP_TEST_LINK_VIDEO_PATTERN)
|
||||
msm_dp_display_handle_video_request(dp);
|
||||
|
|
@ -570,8 +570,8 @@ static int msm_dp_init_sub_modules(struct msm_dp_display_private *dp)
|
|||
goto error_link;
|
||||
}
|
||||
|
||||
dp->ctrl = msm_dp_ctrl_get(dev, dp->link, dp->panel, dp->aux,
|
||||
phy, dp->ahb_base, dp->link_base);
|
||||
dp->ctrl = msm_dp_ctrl_get(dev, dp->link, dp->aux,
|
||||
phy, dp->ahb_base, dp->link_base);
|
||||
if (IS_ERR(dp->ctrl)) {
|
||||
rc = PTR_ERR(dp->ctrl);
|
||||
DRM_ERROR("failed to initialize ctrl, rc = %d\n", rc);
|
||||
|
|
@ -642,14 +642,14 @@ static int msm_dp_display_prepare_link(struct msm_dp_display_private *dp)
|
|||
force_link_train = true;
|
||||
}
|
||||
|
||||
rc = msm_dp_ctrl_on_link(dp->ctrl);
|
||||
rc = msm_dp_ctrl_on_link(dp->ctrl, dp->panel);
|
||||
if (rc) {
|
||||
DRM_ERROR("Failed link training (rc=%d)\n", rc);
|
||||
// TODO: schedule drm_connector_set_link_status_property()
|
||||
return rc;
|
||||
}
|
||||
|
||||
return msm_dp_ctrl_prepare_stream_on(dp->ctrl, force_link_train);
|
||||
return msm_dp_ctrl_prepare_stream_on(dp->ctrl, dp->panel, force_link_train);
|
||||
}
|
||||
|
||||
static int msm_dp_display_enable(struct msm_dp_display_private *dp)
|
||||
|
|
@ -663,7 +663,7 @@ static int msm_dp_display_enable(struct msm_dp_display_private *dp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
rc = msm_dp_ctrl_on_stream(dp->ctrl);
|
||||
rc = msm_dp_ctrl_on_stream(dp->ctrl, dp->panel);
|
||||
if (!rc)
|
||||
msm_dp_display->power_on = true;
|
||||
|
||||
|
|
@ -688,7 +688,7 @@ static int msm_dp_display_post_enable(struct msm_dp *msm_dp_display)
|
|||
msm_dp_display_handle_plugged_change(msm_dp_display, true);
|
||||
|
||||
if (msm_dp_display->psr_supported)
|
||||
msm_dp_ctrl_config_psr(dp->ctrl);
|
||||
msm_dp_ctrl_config_psr(dp->ctrl, dp->panel);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -727,7 +727,7 @@ static int msm_dp_display_disable(struct msm_dp_display_private *dp)
|
|||
|
||||
/* set dongle to D3 (power off) mode */
|
||||
msm_dp_link_psm_config(dp->link, &dp->panel->link_info, true);
|
||||
msm_dp_ctrl_off(dp->ctrl);
|
||||
msm_dp_ctrl_off(dp->ctrl, dp->panel);
|
||||
/* re-init the PHY so that we can listen to Dongle disconnect */
|
||||
msm_dp_ctrl_reinit_phy(dp->ctrl);
|
||||
} else {
|
||||
|
|
@ -735,7 +735,7 @@ static int msm_dp_display_disable(struct msm_dp_display_private *dp)
|
|||
* unplugged interrupt
|
||||
* dongle unplugged out of DUT
|
||||
*/
|
||||
msm_dp_ctrl_off(dp->ctrl);
|
||||
msm_dp_ctrl_off(dp->ctrl, dp->panel);
|
||||
msm_dp_display_host_phy_exit(dp);
|
||||
}
|
||||
|
||||
|
|
@ -879,7 +879,7 @@ void msm_dp_display_set_psr(struct msm_dp *msm_dp_display, bool enter)
|
|||
}
|
||||
|
||||
dp = container_of(msm_dp_display, struct msm_dp_display_private, msm_dp_display);
|
||||
msm_dp_ctrl_set_psr(dp->ctrl, enter);
|
||||
msm_dp_ctrl_set_psr(dp->ctrl, dp->panel, enter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -989,7 +989,7 @@ static irqreturn_t msm_dp_display_irq_handler(int irq, void *dev_id)
|
|||
}
|
||||
|
||||
/* DP controller isr */
|
||||
ret |= msm_dp_ctrl_isr(dp->ctrl);
|
||||
ret |= msm_dp_ctrl_isr(dp->ctrl, dp->panel);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user