diff --git a/drivers/video/fbdev/msm/mdss_mdp.c b/drivers/video/fbdev/msm/mdss_mdp.c index 57033cb004ff..16d0e760e1d2 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.c +++ b/drivers/video/fbdev/msm/mdss_mdp.c @@ -911,7 +911,8 @@ void mdss_bus_bandwidth_ctrl(int enable) } } - pr_debug("bw_cnt=%d changed=%d enable=%d\n", + pr_debug("%pS: task:%s bw_cnt=%d changed=%d enable=%d\n", + __builtin_return_address(0), current->group_leader->comm, mdata->bus_ref_cnt, changed, enable); if (changed) { @@ -961,9 +962,9 @@ void mdss_mdp_clk_ctrl(int enable) if (changed) MDSS_XLOG(mdp_clk_cnt, enable, current->pid); - pr_debug("%pS: clk_cnt=%d changed=%d enable=%d\n", - __builtin_return_address(0), mdp_clk_cnt, - changed, enable); + pr_debug("%pS: task:%s clk_cnt=%d changed=%d enable=%d\n", + __builtin_return_address(0), current->group_leader->comm, + mdata->bus_ref_cnt, changed, enable); if (changed) { if (enable) { diff --git a/drivers/video/fbdev/msm/mdss_mdp.h b/drivers/video/fbdev/msm/mdss_mdp.h index 0472f70e9c18..16e6cc1b3c67 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.h +++ b/drivers/video/fbdev/msm/mdss_mdp.h @@ -678,6 +678,24 @@ enum mdss_screen_state { MDSS_SCREEN_FORCE_BLANK, }; +/** + * enum mdss_mdp_clt_intf_event_flags - flags specifying how event to should + * be sent to panel drivers. + * + * @CTL_INTF_EVENT_FLAG_DEFAULT: this flag denotes default behaviour where + * event will be send to all panels attached this + * display, recursively in split-DSI. + * @CTL_INTF_EVENT_FLAG_SKIP_BROADCAST: this flag sends event only to panel + * associated with this ctl. + * @CTL_INTF_EVENT_FLAG_SLAVE_INTF: this flag sends event only to slave panel + * associated with this ctl, i.e pingpong-split + */ +enum mdss_mdp_clt_intf_event_flags { + CTL_INTF_EVENT_FLAG_DEFAULT = 0, + CTL_INTF_EVENT_FLAG_SKIP_BROADCAST = BIT(1), + CTL_INTF_EVENT_FLAG_SLAVE_INTF = BIT(2), +}; + #define mfd_to_mdp5_data(mfd) (mfd->mdp.private1) #define mfd_to_mdata(mfd) (((struct mdss_overlay_private *)\ (mfd->mdp.private1))->mdata) @@ -1065,7 +1083,7 @@ int mdss_mdp_ctl_destroy(struct mdss_mdp_ctl *ctl); int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl, bool handoff); int mdss_mdp_ctl_stop(struct mdss_mdp_ctl *ctl, int panel_power_mode); int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg, - bool skip_broadcast); + u32 flags); int mdss_mdp_get_prefetch_lines(struct mdss_mdp_ctl *ctl); int mdss_mdp_perf_bw_check(struct mdss_mdp_ctl *ctl, struct mdss_mdp_pipe **left_plist, int left_cnt, diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index a19daa4e1837..d498633b1fad 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -3072,7 +3072,8 @@ int mdss_mdp_ctl_destroy(struct mdss_mdp_ctl *ctl) struct mdss_mdp_ctl *sctl; int rc; - rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CLOSE, NULL, false); + rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CLOSE, NULL, + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "unable to close panel for intf=%d\n", ctl->intf_num); sctl = mdss_mdp_get_split_ctl(ctl); @@ -3087,7 +3088,7 @@ int mdss_mdp_ctl_destroy(struct mdss_mdp_ctl *ctl) } int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg, - bool skip_broadcast) + u32 flags) { struct mdss_panel_data *pdata; int rc = 0; @@ -3097,13 +3098,23 @@ int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg, pdata = ctl->panel_data; - pr_debug("sending ctl=%d event=%d\n", ctl->num, event); + if (flags & CTL_INTF_EVENT_FLAG_SLAVE_INTF) { + pdata = pdata->next; + if (!pdata) { + pr_err("Error: event=%d flags=0x%x, ctl%d slave intf is not present\n", + event, flags, ctl->num); + return -EINVAL; + } + } + + pr_debug("sending ctl=%d event=%d flag=0x%x\n", ctl->num, event, flags); do { if (pdata->event_handler) rc = pdata->event_handler(pdata, event, arg); pdata = pdata->next; - } while (rc == 0 && pdata && pdata->active && !skip_broadcast); + } while (rc == 0 && pdata && pdata->active && + !(flags & CTL_INTF_EVENT_FLAG_SKIP_BROADCAST)); return rc; } @@ -3277,7 +3288,8 @@ int mdss_mdp_ctl_start(struct mdss_mdp_ctl *ctl, bool handoff) mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); - ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_RESET, NULL, false); + ret = mdss_mdp_ctl_intf_event(ctl, + MDSS_EVENT_RESET, NULL, CTL_INTF_EVENT_FLAG_DEFAULT); if (ret) { pr_err("panel power on failed ctl=%d\n", ctl->num); goto error; @@ -4300,8 +4312,8 @@ int mdss_mdp_display_wait4pingpong(struct mdss_mdp_ctl *ctl, bool use_lock) if (sctl) mdss_mdp_ctl_reset(sctl, true); - mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_DSI_RESET_WRITE_PTR, NULL, false); + mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RESET_WRITE_PTR, + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); pr_debug("pingpong timeout recovery finished\n"); } diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c b/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c index 3f63c11a50d5..5144edfec893 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c @@ -63,7 +63,7 @@ struct mdss_mdp_cmd_ctx { struct mdss_intf_recovery intf_recovery; struct mdss_mdp_cmd_ctx *sync_ctx; /* for partial update */ u32 pp_timeout_report_cnt; - int pingpong_split_slave; + bool pingpong_split_slave; }; struct mdss_mdp_cmd_ctx mdss_mdp_cmd_ctx_list[MAX_SESSIONS]; @@ -475,11 +475,12 @@ int mdss_mdp_resource_control(struct mdss_mdp_ctl *ctl, u32 sw_event) sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX]; /* In pingpong split we have single controller, dual context */ - if (ctl->mfd->split_mode == MDP_PINGPONG_SPLIT) + if (is_pingpong_split(ctl->mfd)) sctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[SLAVE_CTX]; - pr_debug("%s ctl:%d pwr_state:%s event:%s\n", - __func__, ctl->num, + pr_debug("%pS-->%s: task:%s ctl:%d pwr_state:%s event:%s\n", + __builtin_return_address(0), __func__, + current->group_leader->comm, ctl->num, get_clk_pwr_state_name(mdp5_data->resources_state), get_sw_event_name(sw_event)); @@ -528,6 +529,7 @@ int mdss_mdp_resource_control(struct mdss_mdp_ctl *ctl, u32 sw_event) if ((mdp5_data->resources_state == MDP_RSRC_CTL_STATE_OFF) || (mdp5_data->resources_state == MDP_RSRC_CTL_STATE_GATE)) { + u32 flags = CTL_INTF_EVENT_FLAG_SKIP_BROADCAST; /* Enable/Ungate DSI clocks and resources */ mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); @@ -536,12 +538,16 @@ int mdss_mdp_resource_control(struct mdss_mdp_ctl *ctl, u32 sw_event) clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT; mdss_mdp_ctl_intf_event /* enable master */ (ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + (void *)&clk_ctrl, flags); - if (sctx) /* then slave */ - mdss_mdp_ctl_intf_event - (sctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + if (sctx) { /* then slave */ + if (sctx->pingpong_split_slave) + flags |= CTL_INTF_EVENT_FLAG_SLAVE_INTF; + + mdss_mdp_ctl_intf_event(sctx->ctl, + MDSS_EVENT_PANEL_CLK_CTRL, + (void *)&clk_ctrl, flags); + } if (mdp5_data->resources_state == MDP_RSRC_CTL_STATE_GATE) @@ -552,7 +558,6 @@ int mdss_mdp_resource_control(struct mdss_mdp_ctl *ctl, u32 sw_event) /* Transition OFF->ON (enable resources)*/ if (mdp5_data->resources_state == MDP_RSRC_CTL_STATE_OFF) { - /* Add an extra vote for the ahb bus */ mdss_update_reg_bus_vote(mdata->reg_bus_clt, VOTE_INDEX_19_MHZ); @@ -722,18 +727,23 @@ int mdss_mdp_resource_control(struct mdss_mdp_ctl *ctl, u32 sw_event) mutex_lock(&ctl->rsrc_lock); MDSS_XLOG(ctl->num, mdp5_data->resources_state, sw_event, 0x44); if (mdp5_data->resources_state == MDP_RSRC_CTL_STATE_OFF) { + u32 flags = CTL_INTF_EVENT_FLAG_SKIP_BROADCAST; + mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); clk_ctrl.state = MDSS_DSI_CLK_ON; clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT; mdss_mdp_ctl_intf_event(ctx->ctl, - MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, - true); - if (sctx) + MDSS_EVENT_PANEL_CLK_CTRL, + (void *)&clk_ctrl, flags); + + if (sctx) { /* then slave */ + if (sctx->pingpong_split_slave) + flags |= CTL_INTF_EVENT_FLAG_SLAVE_INTF; + mdss_mdp_ctl_intf_event(sctx->ctl, - MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, - true); + MDSS_EVENT_PANEL_CLK_CTRL, + (void *)&clk_ctrl, flags); + } mdss_mdp_cmd_clk_on(ctx); if (sctx) @@ -765,6 +775,9 @@ static inline void mdss_mdp_cmd_clk_on(struct mdss_mdp_cmd_ctx *ctx) { struct mdss_data_type *mdata = mdss_mdp_get_mdata(); + pr_debug("%pS-->%s: task:%s ctx%d\n", __builtin_return_address(0), + __func__, current->group_leader->comm, ctx->pp_num); + mutex_lock(&ctx->clk_mtx); MDSS_XLOG(ctx->pp_num, atomic_read(&ctx->koff_cnt), mdata->bus_ref_cnt); @@ -785,6 +798,9 @@ static inline void mdss_mdp_cmd_clk_off(struct mdss_mdp_cmd_ctx *ctx) return; } + pr_debug("%pS-->%s: task:%s ctx%d\n", __builtin_return_address(0), + __func__, current->group_leader->comm, ctx->pp_num); + mutex_lock(&ctx->clk_mtx); MDSS_XLOG(ctx->pp_num, atomic_read(&ctx->koff_cnt), mdata->bus_ref_cnt); @@ -792,11 +808,16 @@ static inline void mdss_mdp_cmd_clk_off(struct mdss_mdp_cmd_ctx *ctx) /* Power off DSI, is caller responsibility to do slave then master */ if (ctx->ctl) { + u32 flags = CTL_INTF_EVENT_FLAG_SKIP_BROADCAST; + + if (ctx->pingpong_split_slave) + flags |= CTL_INTF_EVENT_FLAG_SLAVE_INTF; + clk_ctrl.state = MDSS_DSI_CLK_OFF; clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT; mdss_mdp_ctl_intf_event (ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + (void *)&clk_ctrl, flags); } else { pr_err("OFF with ctl:NULL\n"); } @@ -1004,6 +1025,13 @@ static void clk_ctrl_delayed_off_work(struct work_struct *work) ctx?"":"ctx", sctx?"":"sctx"); goto exit; } + } else if (is_pingpong_split(ctl->mfd)) { + mutex_lock(&cmd_clk_mtx); + sctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[SLAVE_CTX]; + if (!sctx) { + pr_err("invalid sctx\n"); + goto exit; + } } if (ctx->autorefresh_init) { @@ -1023,7 +1051,7 @@ static void clk_ctrl_delayed_off_work(struct work_struct *work) == MDP_RSRC_CTL_STATE_GATE)) mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); - /* first power off the slave DSI (if present) */ + /* first power off the slave DSI (if present) */ if (sctx) mdss_mdp_cmd_clk_off(sctx); @@ -1041,7 +1069,8 @@ static void clk_ctrl_delayed_off_work(struct work_struct *work) exit: /* do this at the end, so we can also protect the global power state*/ - if (ctl->mfd->split_mode == MDP_DUAL_LM_DUAL_DISPLAY) + if ((ctl->mfd->split_mode == MDP_DUAL_LM_DUAL_DISPLAY) || + is_pingpong_split(ctl->mfd)) mutex_unlock(&cmd_clk_mtx); MDSS_XLOG(ctl->num, mdp5_data->resources_state, XLOG_FUNC_EXIT); @@ -1103,6 +1132,13 @@ static void clk_ctrl_gate_work(struct work_struct *work) ctx?"":"ctx", sctx?"":"sctx"); goto exit; } + } else if (is_pingpong_split(ctl->mfd)) { + mutex_lock(&cmd_clk_mtx); + sctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[SLAVE_CTX]; + if (!sctx) { + pr_err("invalid sctx\n"); + goto exit; + } } if (ctx->autorefresh_init) { @@ -1120,15 +1156,21 @@ static void clk_ctrl_gate_work(struct work_struct *work) clk_ctrl.state = MDSS_DSI_CLK_EARLY_GATE; clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT; /* First gate the DSI clocks for the slave controller (if present) */ - if (sctx) - mdss_mdp_ctl_intf_event - (sctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + if (sctx) { + u32 flags = CTL_INTF_EVENT_FLAG_SKIP_BROADCAST; + + if (sctx->pingpong_split_slave) + flags |= CTL_INTF_EVENT_FLAG_SLAVE_INTF; + + mdss_mdp_ctl_intf_event(sctx->ctl, + MDSS_EVENT_PANEL_CLK_CTRL, + (void *)&clk_ctrl, flags); + } /* Now gate DSI clocks for the master */ mdss_mdp_ctl_intf_event (ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + (void *)&clk_ctrl, CTL_INTF_EVENT_FLAG_SKIP_BROADCAST); /* Gate mdp clocks */ mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); @@ -1138,7 +1180,8 @@ static void clk_ctrl_gate_work(struct work_struct *work) exit: /* unlock mutex needed for split display */ - if (ctl->mfd->split_mode == MDP_DUAL_LM_DUAL_DISPLAY) + if ((ctl->mfd->split_mode == MDP_DUAL_LM_DUAL_DISPLAY) || + is_pingpong_split(ctl->mfd)) mutex_unlock(&cmd_clk_mtx); MDSS_XLOG(ctl->num, mdp5_data->resources_state, XLOG_FUNC_EXIT); @@ -1304,12 +1347,18 @@ int mdss_mdp_cmd_reconfigure_splash_done(struct mdss_mdp_ctl *ctl, clk_ctrl.state = MDSS_DSI_CLK_OFF; clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT; - if (sctl) + if (sctl) { + u32 flags = CTL_INTF_EVENT_FLAG_SKIP_BROADCAST; + + if (is_pingpong_split(sctl->mfd)) + flags |= CTL_INTF_EVENT_FLAG_SLAVE_INTF; + mdss_mdp_ctl_intf_event(sctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + (void *)&clk_ctrl, flags); + } mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + (void *)&clk_ctrl, CTL_INTF_EVENT_FLAG_SKIP_BROADCAST); pdata->panel_info.cont_splash_enabled = 0; if (sctl) @@ -1448,8 +1497,8 @@ static int mdss_mdp_cmd_set_partial_roi(struct mdss_mdp_ctl *ctl) return rc; /* set panel col and page addr */ - rc = mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_ENABLE_PARTIAL_ROI, NULL, false); + rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_ENABLE_PARTIAL_ROI, + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); return rc; } @@ -1462,7 +1511,7 @@ static int mdss_mdp_cmd_set_stream_size(struct mdss_mdp_ctl *ctl) /* set dsi controller stream size */ rc = mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_DSI_STREAM_SIZE, NULL, false); + MDSS_EVENT_DSI_STREAM_SIZE, NULL, CTL_INTF_EVENT_FLAG_DEFAULT); return rc; } @@ -1481,20 +1530,24 @@ static int mdss_mdp_cmd_panel_on(struct mdss_mdp_ctl *ctl, if (sctl) sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX]; + /* In pingpong split we have single controller, dual context */ + if (is_pingpong_split(ctl->mfd)) + sctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[SLAVE_CTX]; + if (!__mdss_mdp_cmd_is_panel_power_on_interactive(ctx)) { if (ctl->pending_mode_switch != SWITCH_RESOLUTION) { - rc = mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_LINK_READY, NULL, false); + rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d link ready error (%d)\n", ctl->intf_num, rc); - rc = mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_UNBLANK, NULL, false); + rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_UNBLANK, + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d unblank error (%d)\n", ctl->intf_num, rc); - rc = mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_PANEL_ON, NULL, false); + rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON, + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d panel on error (%d)\n", ctl->intf_num, rc); @@ -1509,7 +1562,8 @@ static int mdss_mdp_cmd_panel_on(struct mdss_mdp_ctl *ctl, mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_REGISTER_RECOVERY_HANDLER, - (void *)&ctx->intf_recovery, false); + (void *)&ctx->intf_recovery, + CTL_INTF_EVENT_FLAG_DEFAULT); ctx->intf_stopped = 0; } else { @@ -1689,7 +1743,8 @@ int mdss_mdp_cmd_kickoff(struct mdss_mdp_ctl *ctl, void *arg) /* * tx dcs command if had any */ - mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_CMDLIST_KOFF, NULL, false); + mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_CMDLIST_KOFF, NULL, + CTL_INTF_EVENT_FLAG_DEFAULT); mdss_mdp_cmd_set_stream_size(ctl); @@ -1736,11 +1791,24 @@ int mdss_mdp_cmd_kickoff(struct mdss_mdp_ctl *ctl, void *arg) int mdss_mdp_cmd_restore(struct mdss_mdp_ctl *ctl, bool locked) { + struct mdss_mdp_cmd_ctx *ctx, *sctx = NULL; + pr_debug("%s: called for ctl%d\n", __func__, ctl->num); - if (mdss_mdp_cmd_tearcheck_setup(ctl->intf_ctx[MASTER_CTX], locked)) - pr_warn("%s: tearcheck setup failed\n", __func__); - else - mdss_mdp_tearcheck_enable(ctl, true); + + ctx = (struct mdss_mdp_cmd_ctx *)ctl->intf_ctx[MASTER_CTX]; + if (is_pingpong_split(ctl->mfd)) + sctx = (struct mdss_mdp_cmd_ctx *)ctl->intf_ctx[SLAVE_CTX]; + + if (mdss_mdp_cmd_tearcheck_setup(ctx, locked)) { + pr_warn("%s: ctx%d tearcheck setup failed\n", __func__, + ctx->pp_num); + } else { + if (sctx && mdss_mdp_cmd_tearcheck_setup(sctx, locked)) + pr_warn("%s: ctx%d tearcheck setup failed\n", __func__, + sctx->pp_num); + else + mdss_mdp_tearcheck_enable(ctl, true); + } return 0; } @@ -1774,8 +1842,7 @@ int mdss_mdp_cmd_ctx_stop(struct mdss_mdp_ctl *ctl, if (!ctl->pending_mode_switch) { mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_REGISTER_RECOVERY_HANDLER, - NULL, - false); + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); } /* shut down the MDP/DSI resources if still enabled */ @@ -1968,14 +2035,16 @@ int mdss_mdp_cmd_stop(struct mdss_mdp_ctl *ctl, int panel_power_state) panel_events: if ((!is_panel_split(ctl->mfd) || is_pingpong_split(ctl->mfd) || - (is_panel_split(ctl->mfd) && sctl)) && send_panel_events) { + (is_panel_split(ctl->mfd) && sctl)) && send_panel_events) { pr_debug("%s: send panel events\n", __func__); ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK, - (void *) (long int) panel_power_state, false); + (void *) (long int) panel_power_state, + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(ret, "intf %d unblank error (%d)\n", ctl->intf_num, ret); ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_OFF, - (void *) (long int) panel_power_state, false); + (void *) (long int) panel_power_state, + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(ret, "intf %d unblank error (%d)\n", ctl->intf_num, ret); } @@ -1996,8 +2065,18 @@ panel_events: ctl->ops.reconfigure = NULL; end: - if (!IS_ERR_VALUE(ret)) + if (!IS_ERR_VALUE(ret)) { + struct mdss_mdp_cmd_ctx *sctx = NULL; + ctx->panel_power_state = panel_power_state; + /* In pingpong split we have single controller, dual context */ + if (is_pingpong_split(ctl->mfd)) + sctx = (struct mdss_mdp_cmd_ctx *) + ctl->intf_ctx[SLAVE_CTX]; + if (sctx) + sctx->panel_power_state = panel_power_state; + } + MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), XLOG_FUNC_EXIT); mutex_unlock(&ctl->offlock); pr_debug("%s:-\n", __func__); @@ -2058,7 +2137,7 @@ static int mdss_mdp_cmd_early_wake_up(struct mdss_mdp_ctl *ctl) static int mdss_mdp_cmd_ctx_setup(struct mdss_mdp_ctl *ctl, struct mdss_mdp_cmd_ctx *ctx, int pp_num, - int pingpong_split_slave) + bool pingpong_split_slave) { int ret = 0; @@ -2230,17 +2309,17 @@ void mdss_mdp_switch_to_vid_mode(struct mdss_mdp_ctl *ctl, int prep) clk_ctrl.client = DSI_CLK_REQ_DSI_CLIENT; if (sctl) mdss_mdp_ctl_intf_event(sctl, - MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + MDSS_EVENT_PANEL_CLK_CTRL, (void *)&clk_ctrl, + CTL_INTF_EVENT_FLAG_SKIP_BROADCAST); mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + (void *)&clk_ctrl, CTL_INTF_EVENT_FLAG_SKIP_BROADCAST); return; } mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RECONFIG_CMD, - (void *) mode, false); + (void *) mode, CTL_INTF_EVENT_FLAG_DEFAULT); } static int mdss_mdp_cmd_reconfigure(struct mdss_mdp_ctl *ctl, @@ -2277,18 +2356,21 @@ static int mdss_mdp_cmd_reconfigure(struct mdss_mdp_ctl *ctl, clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT; mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON); mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, false); + (void *)&clk_ctrl, + CTL_INTF_EVENT_FLAG_DEFAULT); mdss_mdp_ctl_stop(ctl, MDSS_PANEL_POWER_OFF); mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_DYNAMIC_SWITCH, - (void *) mode, false); + (void *) mode, + CTL_INTF_EVENT_FLAG_DEFAULT); } else { /* release ref count after switch is complete */ clk_ctrl.state = MDSS_DSI_CLK_OFF; clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT; mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, false); + (void *)&clk_ctrl, + CTL_INTF_EVENT_FLAG_DEFAULT); mdss_iommu_ctrl(0); mdss_bus_bandwidth_ctrl(false); mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF); diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c index 78c04503e86e..5f8d86ddd0db 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c @@ -459,7 +459,7 @@ static int mdss_mdp_video_ctx_stop(struct mdss_mdp_ctl *ctl, mutex_lock(&ctl->offlock); if (ctx->timegen_en) { rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK, NULL, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); if (rc == -EBUSY) { pr_debug("intf #%d busy don't turn off\n", ctl->intf_num); @@ -475,7 +475,7 @@ static int mdss_mdp_video_ctx_stop(struct mdss_mdp_ctl *ctl, mdss_mdp_turn_off_time_engine(ctl, ctx, frame_rate); rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_OFF, NULL, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d timegen off error (%d)\n", ctl->intf_num, rc); mdss_bus_bandwidth_ctrl(false); @@ -941,7 +941,7 @@ static int mdss_mdp_video_config_fps(struct mdss_mdp_ctl *ctl, rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_UPDATE_FPS, (void *) (unsigned long) new_fps, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d panel fps update error (%d)\n", ctl->intf_num, rc); } else if (pdata->panel_info.dfps_update @@ -993,7 +993,7 @@ static int mdss_mdp_video_config_fps(struct mdss_mdp_ctl *ctl, rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_UPDATE_FPS, (void *) (unsigned long) new_fps, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d panel fps update error (%d)\n", ctl->intf_num, rc); @@ -1028,7 +1028,7 @@ exit_dfps: rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_UPDATE_FPS, (void *) (unsigned long) new_fps, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d panel fps update error (%d)\n", ctl->intf_num, rc); } @@ -1065,7 +1065,7 @@ static int mdss_mdp_video_display(struct mdss_mdp_ctl *ctl, void *arg) if (!ctx->timegen_en) { rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, NULL, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); if (rc) { pr_warn("intf #%d link ready error (%d)\n", ctl->intf_num, rc); @@ -1075,7 +1075,7 @@ static int mdss_mdp_video_display(struct mdss_mdp_ctl *ctl, void *arg) } rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_UNBLANK, NULL, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d unblank error (%d)\n", ctl->intf_num, rc); pr_debug("enabling timing gen for intf=%d\n", ctl->intf_num); @@ -1112,10 +1112,10 @@ static int mdss_mdp_video_display(struct mdss_mdp_ctl *ctl, void *arg) ctx->timegen_en = true; rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON, NULL, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); WARN(rc, "intf %d panel on error (%d)\n", ctl->intf_num, rc); mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_POST_PANEL_ON, NULL, - false); + CTL_INTF_EVENT_FLAG_DEFAULT); } return 0; @@ -1147,7 +1147,7 @@ int mdss_mdp_video_reconfigure_splash_done(struct mdss_mdp_ctl *ctl, if (!handoff) { ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CONT_SPLASH_BEGIN, - NULL, false); + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); if (ret) { pr_err("%s: Failed to handle 'CONT_SPLASH_BEGIN' event\n" , __func__); @@ -1173,7 +1173,8 @@ int mdss_mdp_video_reconfigure_splash_done(struct mdss_mdp_ctl *ctl, msleep(20); ret = mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_CONT_SPLASH_FINISH, NULL, false); + MDSS_EVENT_CONT_SPLASH_FINISH, NULL, + CTL_INTF_EVENT_FLAG_DEFAULT); } return ret; @@ -1355,7 +1356,7 @@ static int mdss_mdp_video_ctx_setup(struct mdss_mdp_ctl *ctl, if (mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_REGISTER_RECOVERY_HANDLER, (void *)&ctx->intf_recovery, - false)) { + CTL_INTF_EVENT_FLAG_DEFAULT)) { pr_err("Failed to register intf recovery handler\n"); return -EINVAL; } @@ -1531,7 +1532,7 @@ void mdss_mdp_switch_to_cmd_mode(struct mdss_mdp_ctl *ctl, int prep) if (!prep) { mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RECONFIG_CMD, - (void *) mode, false); + (void *) mode, CTL_INTF_EVENT_FLAG_DEFAULT); return; } @@ -1543,8 +1544,8 @@ void mdss_mdp_switch_to_cmd_mode(struct mdss_mdp_ctl *ctl, int prep) } /* Start off by sending command to initial cmd mode */ - rc = mdss_mdp_ctl_intf_event(ctl, - MDSS_EVENT_DSI_DYNAMIC_SWITCH, (void *) mode, false); + rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_DYNAMIC_SWITCH, + (void *) mode, CTL_INTF_EVENT_FLAG_DEFAULT); if (rc) { pr_err("intf #%d busy don't turn off, rc=%d\n", ctl->intf_num, rc); diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index 0a67cb9208de..1955990f43b9 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -1741,7 +1741,7 @@ int mdss_mode_switch_post(struct msm_fb_data_type *mfd, u32 mode) pr_debug("%s, start\n", __func__); rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_DYNAMIC_SWITCH, - (void *) MIPI_VIDEO_PANEL, false); + (void *) MIPI_VIDEO_PANEL, CTL_INTF_EVENT_FLAG_DEFAULT); pr_debug("%s, end\n", __func__); } else if (mode == MIPI_CMD_PANEL) { /* @@ -1753,11 +1753,11 @@ int mdss_mode_switch_post(struct msm_fb_data_type *mfd, u32 mode) clk_ctrl.client = DSI_CLK_REQ_DSI_CLIENT; if (sctl) mdss_mdp_ctl_intf_event(sctl, - MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + MDSS_EVENT_PANEL_CLK_CTRL, (void *)&clk_ctrl, + CTL_INTF_EVENT_FLAG_SKIP_BROADCAST); mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL, - (void *)&clk_ctrl, true); + (void *)&clk_ctrl, CTL_INTF_EVENT_FLAG_SKIP_BROADCAST); } else if (mode == SWITCH_RESOLUTION) { if (ctl->ops.reconfigure) rc = ctl->ops.reconfigure(ctl, mode, 0); @@ -4861,7 +4861,7 @@ static int mdss_mdp_update_panel_info(struct msm_fb_data_type *mfd, } ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_UPDATE_PANEL_DATA, - (void *)(unsigned long)mode, false); + (void *)(unsigned long)mode, CTL_INTF_EVENT_FLAG_DEFAULT); if (ret) pr_err("Dynamic switch to %s mode failed!\n", mode ? "command" : "video");