Loading drivers/gpu/drm/msm/dp/dp_ctrl.c +25 −28 Original line number Diff line number Diff line Loading @@ -128,8 +128,10 @@ static void dp_ctrl_push_idle(struct dp_ctrl_private *ctrl, int const idle_pattern_completion_timeout_ms = HZ / 10; u32 state = 0x0; if (!ctrl->power_on) if (!ctrl->power_on) { pr_err("CTRL off, return\n"); return; } if (!ctrl->mst_mode) { state = ST_PUSH_IDLE; Loading Loading @@ -461,6 +463,8 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl) ctrl->link->phy_params.p_level = 0; ctrl->link->phy_params.v_level = 0; ctrl->catalog->config_ctrl(ctrl->catalog); link_info.num_lanes = ctrl->link->link_params.lane_count; link_info.rate = drm_dp_bw_code_to_link_rate( ctrl->link->link_params.bw_code); Loading Loading @@ -508,6 +512,8 @@ static int dp_ctrl_setup_main_link(struct dp_ctrl_private *ctrl) { int ret = 0; ctrl->catalog->mainlink_ctrl(ctrl->catalog, true); if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) goto end; Loading Loading @@ -581,7 +587,7 @@ static int dp_ctrl_link_setup(struct dp_ctrl_private *ctrl) catalog->phy_lane_cfg(catalog, ctrl->orientation, link_params->lane_count); while (--link_train_max_retries && !atomic_read(&ctrl->aborted)) { while (--link_train_max_retries || !atomic_read(&ctrl->aborted)) { pr_debug("bw_code=%d, lane_count=%d\n", link_params->bw_code, link_params->lane_count); Loading Loading @@ -708,11 +714,6 @@ static void dp_ctrl_host_deinit(struct dp_ctrl *dp_ctrl) pr_debug("Host deinitialized successfully\n"); } static void dp_ctrl_send_video(struct dp_ctrl_private *ctrl) { ctrl->catalog->state_ctrl(ctrl->catalog, ST_SEND_VIDEO); } static int dp_ctrl_link_maintenance(struct dp_ctrl *dp_ctrl) { int ret = 0; Loading @@ -725,31 +726,25 @@ static int dp_ctrl_link_maintenance(struct dp_ctrl *dp_ctrl) ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_COMPLETED; ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_FAILED; if (!ctrl->power_on) { pr_err("ctrl off\n"); if (!ctrl->power_on || atomic_read(&ctrl->aborted)) { pr_err("CTRL off, return\n"); ret = -EINVAL; goto end; } if (atomic_read(&ctrl->aborted)) goto end; ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_COMPLETED; ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_FAILED; ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_STARTED; ret = dp_ctrl_setup_main_link(ctrl); ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_STARTED; if (ret) { ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_FAILED; goto end; } ctrl->catalog->reset(ctrl->catalog); dp_ctrl_disable_link_clock(ctrl); ret = dp_ctrl_link_setup(ctrl); ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_STARTED; if (ret) ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_FAILED; else ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_COMPLETED; dp_ctrl_send_video(ctrl); ret = dp_ctrl_wait4video_ready(ctrl); end: return ret; } Loading Loading @@ -846,6 +841,11 @@ static void dp_ctrl_send_phy_test_pattern(struct dp_ctrl_private *ctrl) dp_link_get_phy_test_pattern(pattern_requested)); } static void dp_ctrl_send_video(struct dp_ctrl_private *ctrl) { ctrl->catalog->state_ctrl(ctrl->catalog, ST_SEND_VIDEO); } static void dp_ctrl_mst_calculate_rg(struct dp_ctrl_private *ctrl, struct dp_panel *panel, u32 *p_x_int, u32 *p_y_frac_enum) { Loading Loading @@ -1077,9 +1077,6 @@ static void dp_ctrl_stream_off(struct dp_ctrl *dp_ctrl, struct dp_panel *panel) ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); if (!ctrl->power_on) return; panel->hw_cfg(panel, false); dp_ctrl_disable_stream_clocks(ctrl, panel); Loading drivers/gpu/drm/msm/dp/dp_display.c +67 −29 Original line number Diff line number Diff line Loading @@ -848,40 +848,37 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev) return rc; } static void dp_display_stream_disable(struct dp_display_private *dp, struct dp_panel *dp_panel) static void dp_display_handle_maintenance_req(struct dp_display_private *dp) { if (!dp->active_stream_cnt) { pr_err("invalid active_stream_cnt (%d)\n"); return; } int idx; struct dp_panel *dp_panel; pr_debug("stream_id=%d, active_stream_cnt=%d\n", dp_panel->stream_id, dp->active_stream_cnt); for (idx = DP_STREAM_0; idx < DP_STREAM_MAX; idx++) { if (!dp->active_panels[idx]) continue; dp_panel = dp->active_panels[idx]; if (dp_panel->audio_supported) dp_panel->audio->off(dp_panel->audio); dp->ctrl->stream_pre_off(dp->ctrl, dp_panel); dp->ctrl->stream_off(dp->ctrl, dp_panel); dp->active_panels[dp_panel->stream_id] = NULL; dp->active_stream_cnt--; } static int dp_display_stream_enable(struct dp_display_private *dp, struct dp_panel *dp_panel) { int rc = 0; rc = dp->ctrl->stream_on(dp->ctrl, dp_panel); dp->ctrl->link_maintenance(dp->ctrl); if (dp->debug->tpg_state) dp_panel->tpg_config(dp_panel, true); for (idx = DP_STREAM_0; idx < DP_STREAM_MAX; idx++) { if (!dp->active_panels[idx]) continue; if (!rc) { dp->active_panels[dp_panel->stream_id] = dp_panel; dp->active_stream_cnt++; } dp_panel = dp->active_panels[idx]; pr_debug("dp active_stream_cnt:%d\n", dp->active_stream_cnt); dp->ctrl->stream_on(dp->ctrl, dp_panel); return rc; if (dp_panel->audio_supported) dp_panel->audio->on(dp_panel->audio); } } static void dp_display_mst_attention(struct dp_display_private *dp) Loading Loading @@ -925,12 +922,12 @@ static void dp_display_attention_work(struct work_struct *work) if (dp->link->sink_request & DP_TEST_LINK_TRAINING) { dp->link->send_test_response(dp->link); dp->ctrl->link_maintenance(dp->ctrl); dp_display_handle_maintenance_req(dp); goto mst_attention; } if (dp->link->sink_request & DP_LINK_STATUS_UPDATED) dp->ctrl->link_maintenance(dp->ctrl); dp_display_handle_maintenance_req(dp); if (dp_display_is_hdcp_enabled(dp) && dp->hdcp.ops->cp_irq) dp->hdcp.ops->cp_irq(dp->hdcp.data); Loading Loading @@ -1343,6 +1340,26 @@ static int dp_display_set_stream_info(struct dp_display *dp_display, return rc; } static int dp_display_stream_enable(struct dp_display_private *dp, struct dp_panel *dp_panel) { int rc = 0; rc = dp->ctrl->stream_on(dp->ctrl, dp_panel); if (dp->debug->tpg_state) dp_panel->tpg_config(dp_panel, true); if (!rc) { dp->active_panels[dp_panel->stream_id] = dp_panel; dp->active_stream_cnt++; } pr_debug("dp active_stream_cnt:%d\n", dp->active_stream_cnt); return rc; } static int dp_display_enable(struct dp_display *dp_display, void *panel) { int rc = 0; Loading @@ -1357,8 +1374,13 @@ static int dp_display_enable(struct dp_display *dp_display, void *panel) mutex_lock(&dp->session_lock); if (!dp->core_initialized) { pr_err("host not initialized\n"); if (atomic_read(&dp->aborted)) { pr_err("aborted\n"); goto end; } if (!dp_display_is_ready(dp) || !dp->core_initialized) { pr_err("display not ready\n"); goto end; } Loading Loading @@ -1489,6 +1511,22 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel) return 0; } static void dp_display_stream_disable(struct dp_display_private *dp, struct dp_panel *dp_panel) { if (!dp->active_stream_cnt) { pr_err("invalid active_stream_cnt (%d)\n"); return; } pr_debug("stream_id=%d, active_stream_cnt=%d\n", dp_panel->stream_id, dp->active_stream_cnt); dp->ctrl->stream_off(dp->ctrl, dp_panel); dp->active_panels[dp_panel->stream_id] = NULL; dp->active_stream_cnt--; } static int dp_display_disable(struct dp_display *dp_display, void *panel) { struct dp_display_private *dp = NULL; Loading Loading
drivers/gpu/drm/msm/dp/dp_ctrl.c +25 −28 Original line number Diff line number Diff line Loading @@ -128,8 +128,10 @@ static void dp_ctrl_push_idle(struct dp_ctrl_private *ctrl, int const idle_pattern_completion_timeout_ms = HZ / 10; u32 state = 0x0; if (!ctrl->power_on) if (!ctrl->power_on) { pr_err("CTRL off, return\n"); return; } if (!ctrl->mst_mode) { state = ST_PUSH_IDLE; Loading Loading @@ -461,6 +463,8 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl) ctrl->link->phy_params.p_level = 0; ctrl->link->phy_params.v_level = 0; ctrl->catalog->config_ctrl(ctrl->catalog); link_info.num_lanes = ctrl->link->link_params.lane_count; link_info.rate = drm_dp_bw_code_to_link_rate( ctrl->link->link_params.bw_code); Loading Loading @@ -508,6 +512,8 @@ static int dp_ctrl_setup_main_link(struct dp_ctrl_private *ctrl) { int ret = 0; ctrl->catalog->mainlink_ctrl(ctrl->catalog, true); if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) goto end; Loading Loading @@ -581,7 +587,7 @@ static int dp_ctrl_link_setup(struct dp_ctrl_private *ctrl) catalog->phy_lane_cfg(catalog, ctrl->orientation, link_params->lane_count); while (--link_train_max_retries && !atomic_read(&ctrl->aborted)) { while (--link_train_max_retries || !atomic_read(&ctrl->aborted)) { pr_debug("bw_code=%d, lane_count=%d\n", link_params->bw_code, link_params->lane_count); Loading Loading @@ -708,11 +714,6 @@ static void dp_ctrl_host_deinit(struct dp_ctrl *dp_ctrl) pr_debug("Host deinitialized successfully\n"); } static void dp_ctrl_send_video(struct dp_ctrl_private *ctrl) { ctrl->catalog->state_ctrl(ctrl->catalog, ST_SEND_VIDEO); } static int dp_ctrl_link_maintenance(struct dp_ctrl *dp_ctrl) { int ret = 0; Loading @@ -725,31 +726,25 @@ static int dp_ctrl_link_maintenance(struct dp_ctrl *dp_ctrl) ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_COMPLETED; ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_FAILED; if (!ctrl->power_on) { pr_err("ctrl off\n"); if (!ctrl->power_on || atomic_read(&ctrl->aborted)) { pr_err("CTRL off, return\n"); ret = -EINVAL; goto end; } if (atomic_read(&ctrl->aborted)) goto end; ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_COMPLETED; ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_FAILED; ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_STARTED; ret = dp_ctrl_setup_main_link(ctrl); ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_STARTED; if (ret) { ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_FAILED; goto end; } ctrl->catalog->reset(ctrl->catalog); dp_ctrl_disable_link_clock(ctrl); ret = dp_ctrl_link_setup(ctrl); ctrl->aux->state &= ~DP_STATE_LINK_MAINTENANCE_STARTED; if (ret) ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_FAILED; else ctrl->aux->state |= DP_STATE_LINK_MAINTENANCE_COMPLETED; dp_ctrl_send_video(ctrl); ret = dp_ctrl_wait4video_ready(ctrl); end: return ret; } Loading Loading @@ -846,6 +841,11 @@ static void dp_ctrl_send_phy_test_pattern(struct dp_ctrl_private *ctrl) dp_link_get_phy_test_pattern(pattern_requested)); } static void dp_ctrl_send_video(struct dp_ctrl_private *ctrl) { ctrl->catalog->state_ctrl(ctrl->catalog, ST_SEND_VIDEO); } static void dp_ctrl_mst_calculate_rg(struct dp_ctrl_private *ctrl, struct dp_panel *panel, u32 *p_x_int, u32 *p_y_frac_enum) { Loading Loading @@ -1077,9 +1077,6 @@ static void dp_ctrl_stream_off(struct dp_ctrl *dp_ctrl, struct dp_panel *panel) ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl); if (!ctrl->power_on) return; panel->hw_cfg(panel, false); dp_ctrl_disable_stream_clocks(ctrl, panel); Loading
drivers/gpu/drm/msm/dp/dp_display.c +67 −29 Original line number Diff line number Diff line Loading @@ -848,40 +848,37 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev) return rc; } static void dp_display_stream_disable(struct dp_display_private *dp, struct dp_panel *dp_panel) static void dp_display_handle_maintenance_req(struct dp_display_private *dp) { if (!dp->active_stream_cnt) { pr_err("invalid active_stream_cnt (%d)\n"); return; } int idx; struct dp_panel *dp_panel; pr_debug("stream_id=%d, active_stream_cnt=%d\n", dp_panel->stream_id, dp->active_stream_cnt); for (idx = DP_STREAM_0; idx < DP_STREAM_MAX; idx++) { if (!dp->active_panels[idx]) continue; dp_panel = dp->active_panels[idx]; if (dp_panel->audio_supported) dp_panel->audio->off(dp_panel->audio); dp->ctrl->stream_pre_off(dp->ctrl, dp_panel); dp->ctrl->stream_off(dp->ctrl, dp_panel); dp->active_panels[dp_panel->stream_id] = NULL; dp->active_stream_cnt--; } static int dp_display_stream_enable(struct dp_display_private *dp, struct dp_panel *dp_panel) { int rc = 0; rc = dp->ctrl->stream_on(dp->ctrl, dp_panel); dp->ctrl->link_maintenance(dp->ctrl); if (dp->debug->tpg_state) dp_panel->tpg_config(dp_panel, true); for (idx = DP_STREAM_0; idx < DP_STREAM_MAX; idx++) { if (!dp->active_panels[idx]) continue; if (!rc) { dp->active_panels[dp_panel->stream_id] = dp_panel; dp->active_stream_cnt++; } dp_panel = dp->active_panels[idx]; pr_debug("dp active_stream_cnt:%d\n", dp->active_stream_cnt); dp->ctrl->stream_on(dp->ctrl, dp_panel); return rc; if (dp_panel->audio_supported) dp_panel->audio->on(dp_panel->audio); } } static void dp_display_mst_attention(struct dp_display_private *dp) Loading Loading @@ -925,12 +922,12 @@ static void dp_display_attention_work(struct work_struct *work) if (dp->link->sink_request & DP_TEST_LINK_TRAINING) { dp->link->send_test_response(dp->link); dp->ctrl->link_maintenance(dp->ctrl); dp_display_handle_maintenance_req(dp); goto mst_attention; } if (dp->link->sink_request & DP_LINK_STATUS_UPDATED) dp->ctrl->link_maintenance(dp->ctrl); dp_display_handle_maintenance_req(dp); if (dp_display_is_hdcp_enabled(dp) && dp->hdcp.ops->cp_irq) dp->hdcp.ops->cp_irq(dp->hdcp.data); Loading Loading @@ -1343,6 +1340,26 @@ static int dp_display_set_stream_info(struct dp_display *dp_display, return rc; } static int dp_display_stream_enable(struct dp_display_private *dp, struct dp_panel *dp_panel) { int rc = 0; rc = dp->ctrl->stream_on(dp->ctrl, dp_panel); if (dp->debug->tpg_state) dp_panel->tpg_config(dp_panel, true); if (!rc) { dp->active_panels[dp_panel->stream_id] = dp_panel; dp->active_stream_cnt++; } pr_debug("dp active_stream_cnt:%d\n", dp->active_stream_cnt); return rc; } static int dp_display_enable(struct dp_display *dp_display, void *panel) { int rc = 0; Loading @@ -1357,8 +1374,13 @@ static int dp_display_enable(struct dp_display *dp_display, void *panel) mutex_lock(&dp->session_lock); if (!dp->core_initialized) { pr_err("host not initialized\n"); if (atomic_read(&dp->aborted)) { pr_err("aborted\n"); goto end; } if (!dp_display_is_ready(dp) || !dp->core_initialized) { pr_err("display not ready\n"); goto end; } Loading Loading @@ -1489,6 +1511,22 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel) return 0; } static void dp_display_stream_disable(struct dp_display_private *dp, struct dp_panel *dp_panel) { if (!dp->active_stream_cnt) { pr_err("invalid active_stream_cnt (%d)\n"); return; } pr_debug("stream_id=%d, active_stream_cnt=%d\n", dp_panel->stream_id, dp->active_stream_cnt); dp->ctrl->stream_off(dp->ctrl, dp_panel); dp->active_panels[dp_panel->stream_id] = NULL; dp->active_stream_cnt--; } static int dp_display_disable(struct dp_display *dp_display, void *panel) { struct dp_display_private *dp = NULL; Loading