msm: mdss: fix pingpong split for smart panels
Starting with 6a55d9204af7aed1c279d6563aba4763ef1b67e9, msm: mdss: add support to call panel events for one panel, pingpong split with smart panels is broken because MDSS_EVENT_PANEL_CLK_CTRL event is not sent for the slave panel. Add support to send event to slave panel when one control path is driving two panels, like in pingpong split. Also balance the resource management for smart panels to re-enable pingpong split based configuration. Change-Id: Iebe94bdd28af7aa9cb5c35031f3f89a9ab99a7eb Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org> [cip@codeaurora.org: Resolved merge conflict] Signed-off-by: Clarence Ip <cip@codeaurora.org>
This commit is contained in:
parent
c4b4c0a31c
commit
f47764d6c9
6 changed files with 204 additions and 90 deletions
|
@ -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);
|
mdata->bus_ref_cnt, changed, enable);
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
|
@ -961,9 +962,9 @@ void mdss_mdp_clk_ctrl(int enable)
|
||||||
if (changed)
|
if (changed)
|
||||||
MDSS_XLOG(mdp_clk_cnt, enable, current->pid);
|
MDSS_XLOG(mdp_clk_cnt, enable, current->pid);
|
||||||
|
|
||||||
pr_debug("%pS: clk_cnt=%d changed=%d enable=%d\n",
|
pr_debug("%pS: task:%s clk_cnt=%d changed=%d enable=%d\n",
|
||||||
__builtin_return_address(0), mdp_clk_cnt,
|
__builtin_return_address(0), current->group_leader->comm,
|
||||||
changed, enable);
|
mdata->bus_ref_cnt, changed, enable);
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
|
|
|
@ -678,6 +678,24 @@ enum mdss_screen_state {
|
||||||
MDSS_SCREEN_FORCE_BLANK,
|
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_mdp5_data(mfd) (mfd->mdp.private1)
|
||||||
#define mfd_to_mdata(mfd) (((struct mdss_overlay_private *)\
|
#define mfd_to_mdata(mfd) (((struct mdss_overlay_private *)\
|
||||||
(mfd->mdp.private1))->mdata)
|
(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_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_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,
|
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_get_prefetch_lines(struct mdss_mdp_ctl *ctl);
|
||||||
int mdss_mdp_perf_bw_check(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,
|
struct mdss_mdp_pipe **left_plist, int left_cnt,
|
||||||
|
|
|
@ -3072,7 +3072,8 @@ int mdss_mdp_ctl_destroy(struct mdss_mdp_ctl *ctl)
|
||||||
struct mdss_mdp_ctl *sctl;
|
struct mdss_mdp_ctl *sctl;
|
||||||
int rc;
|
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);
|
WARN(rc, "unable to close panel for intf=%d\n", ctl->intf_num);
|
||||||
|
|
||||||
sctl = mdss_mdp_get_split_ctl(ctl);
|
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,
|
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;
|
struct mdss_panel_data *pdata;
|
||||||
int rc = 0;
|
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;
|
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 {
|
do {
|
||||||
if (pdata->event_handler)
|
if (pdata->event_handler)
|
||||||
rc = pdata->event_handler(pdata, event, arg);
|
rc = pdata->event_handler(pdata, event, arg);
|
||||||
pdata = pdata->next;
|
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;
|
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);
|
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) {
|
if (ret) {
|
||||||
pr_err("panel power on failed ctl=%d\n", ctl->num);
|
pr_err("panel power on failed ctl=%d\n", ctl->num);
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -4300,8 +4312,8 @@ int mdss_mdp_display_wait4pingpong(struct mdss_mdp_ctl *ctl, bool use_lock)
|
||||||
if (sctl)
|
if (sctl)
|
||||||
mdss_mdp_ctl_reset(sctl, true);
|
mdss_mdp_ctl_reset(sctl, true);
|
||||||
|
|
||||||
mdss_mdp_ctl_intf_event(ctl,
|
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RESET_WRITE_PTR,
|
||||||
MDSS_EVENT_DSI_RESET_WRITE_PTR, NULL, false);
|
NULL, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
|
|
||||||
pr_debug("pingpong timeout recovery finished\n");
|
pr_debug("pingpong timeout recovery finished\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ struct mdss_mdp_cmd_ctx {
|
||||||
struct mdss_intf_recovery intf_recovery;
|
struct mdss_intf_recovery intf_recovery;
|
||||||
struct mdss_mdp_cmd_ctx *sync_ctx; /* for partial update */
|
struct mdss_mdp_cmd_ctx *sync_ctx; /* for partial update */
|
||||||
u32 pp_timeout_report_cnt;
|
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];
|
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];
|
sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX];
|
||||||
|
|
||||||
/* In pingpong split we have single controller, dual context */
|
/* 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];
|
sctx = (struct mdss_mdp_cmd_ctx *) ctl->intf_ctx[SLAVE_CTX];
|
||||||
|
|
||||||
pr_debug("%s ctl:%d pwr_state:%s event:%s\n",
|
pr_debug("%pS-->%s: task:%s ctl:%d pwr_state:%s event:%s\n",
|
||||||
__func__, ctl->num,
|
__builtin_return_address(0), __func__,
|
||||||
|
current->group_leader->comm, ctl->num,
|
||||||
get_clk_pwr_state_name(mdp5_data->resources_state),
|
get_clk_pwr_state_name(mdp5_data->resources_state),
|
||||||
get_sw_event_name(sw_event));
|
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) ||
|
if ((mdp5_data->resources_state == MDP_RSRC_CTL_STATE_OFF) ||
|
||||||
(mdp5_data->resources_state ==
|
(mdp5_data->resources_state ==
|
||||||
MDP_RSRC_CTL_STATE_GATE)) {
|
MDP_RSRC_CTL_STATE_GATE)) {
|
||||||
|
u32 flags = CTL_INTF_EVENT_FLAG_SKIP_BROADCAST;
|
||||||
|
|
||||||
/* Enable/Ungate DSI clocks and resources */
|
/* Enable/Ungate DSI clocks and resources */
|
||||||
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
|
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;
|
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
||||||
mdss_mdp_ctl_intf_event /* enable master */
|
mdss_mdp_ctl_intf_event /* enable master */
|
||||||
(ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
(ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
||||||
(void *)&clk_ctrl, true);
|
(void *)&clk_ctrl, flags);
|
||||||
|
|
||||||
if (sctx) /* then slave */
|
if (sctx) { /* then slave */
|
||||||
mdss_mdp_ctl_intf_event
|
if (sctx->pingpong_split_slave)
|
||||||
(sctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
flags |= CTL_INTF_EVENT_FLAG_SLAVE_INTF;
|
||||||
(void *)&clk_ctrl, true);
|
|
||||||
|
mdss_mdp_ctl_intf_event(sctx->ctl,
|
||||||
|
MDSS_EVENT_PANEL_CLK_CTRL,
|
||||||
|
(void *)&clk_ctrl, flags);
|
||||||
|
}
|
||||||
|
|
||||||
if (mdp5_data->resources_state ==
|
if (mdp5_data->resources_state ==
|
||||||
MDP_RSRC_CTL_STATE_GATE)
|
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)*/
|
/* Transition OFF->ON (enable resources)*/
|
||||||
if (mdp5_data->resources_state ==
|
if (mdp5_data->resources_state ==
|
||||||
MDP_RSRC_CTL_STATE_OFF) {
|
MDP_RSRC_CTL_STATE_OFF) {
|
||||||
|
|
||||||
/* Add an extra vote for the ahb bus */
|
/* Add an extra vote for the ahb bus */
|
||||||
mdss_update_reg_bus_vote(mdata->reg_bus_clt,
|
mdss_update_reg_bus_vote(mdata->reg_bus_clt,
|
||||||
VOTE_INDEX_19_MHZ);
|
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);
|
mutex_lock(&ctl->rsrc_lock);
|
||||||
MDSS_XLOG(ctl->num, mdp5_data->resources_state, sw_event, 0x44);
|
MDSS_XLOG(ctl->num, mdp5_data->resources_state, sw_event, 0x44);
|
||||||
if (mdp5_data->resources_state == MDP_RSRC_CTL_STATE_OFF) {
|
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);
|
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
|
||||||
clk_ctrl.state = MDSS_DSI_CLK_ON;
|
clk_ctrl.state = MDSS_DSI_CLK_ON;
|
||||||
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
||||||
mdss_mdp_ctl_intf_event(ctx->ctl,
|
mdss_mdp_ctl_intf_event(ctx->ctl,
|
||||||
MDSS_EVENT_PANEL_CLK_CTRL,
|
MDSS_EVENT_PANEL_CLK_CTRL,
|
||||||
(void *)&clk_ctrl,
|
(void *)&clk_ctrl, flags);
|
||||||
true);
|
|
||||||
if (sctx)
|
if (sctx) { /* then slave */
|
||||||
|
if (sctx->pingpong_split_slave)
|
||||||
|
flags |= CTL_INTF_EVENT_FLAG_SLAVE_INTF;
|
||||||
|
|
||||||
mdss_mdp_ctl_intf_event(sctx->ctl,
|
mdss_mdp_ctl_intf_event(sctx->ctl,
|
||||||
MDSS_EVENT_PANEL_CLK_CTRL,
|
MDSS_EVENT_PANEL_CLK_CTRL,
|
||||||
(void *)&clk_ctrl,
|
(void *)&clk_ctrl, flags);
|
||||||
true);
|
}
|
||||||
|
|
||||||
mdss_mdp_cmd_clk_on(ctx);
|
mdss_mdp_cmd_clk_on(ctx);
|
||||||
if (sctx)
|
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();
|
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);
|
mutex_lock(&ctx->clk_mtx);
|
||||||
MDSS_XLOG(ctx->pp_num, atomic_read(&ctx->koff_cnt), mdata->bus_ref_cnt);
|
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;
|
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);
|
mutex_lock(&ctx->clk_mtx);
|
||||||
MDSS_XLOG(ctx->pp_num, atomic_read(&ctx->koff_cnt), mdata->bus_ref_cnt);
|
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 */
|
/* Power off DSI, is caller responsibility to do slave then master */
|
||||||
if (ctx->ctl) {
|
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.state = MDSS_DSI_CLK_OFF;
|
||||||
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
||||||
mdss_mdp_ctl_intf_event
|
mdss_mdp_ctl_intf_event
|
||||||
(ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
(ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
||||||
(void *)&clk_ctrl, true);
|
(void *)&clk_ctrl, flags);
|
||||||
} else {
|
} else {
|
||||||
pr_err("OFF with ctl:NULL\n");
|
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");
|
ctx?"":"ctx", sctx?"":"sctx");
|
||||||
goto exit;
|
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) {
|
if (ctx->autorefresh_init) {
|
||||||
|
@ -1023,7 +1051,7 @@ static void clk_ctrl_delayed_off_work(struct work_struct *work)
|
||||||
== MDP_RSRC_CTL_STATE_GATE))
|
== MDP_RSRC_CTL_STATE_GATE))
|
||||||
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
|
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)
|
if (sctx)
|
||||||
mdss_mdp_cmd_clk_off(sctx);
|
mdss_mdp_cmd_clk_off(sctx);
|
||||||
|
|
||||||
|
@ -1041,7 +1069,8 @@ static void clk_ctrl_delayed_off_work(struct work_struct *work)
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
/* do this at the end, so we can also protect the global power state*/
|
/* 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);
|
mutex_unlock(&cmd_clk_mtx);
|
||||||
|
|
||||||
MDSS_XLOG(ctl->num, mdp5_data->resources_state, XLOG_FUNC_EXIT);
|
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");
|
ctx?"":"ctx", sctx?"":"sctx");
|
||||||
goto exit;
|
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) {
|
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.state = MDSS_DSI_CLK_EARLY_GATE;
|
||||||
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
||||||
/* First gate the DSI clocks for the slave controller (if present) */
|
/* First gate the DSI clocks for the slave controller (if present) */
|
||||||
if (sctx)
|
if (sctx) {
|
||||||
mdss_mdp_ctl_intf_event
|
u32 flags = CTL_INTF_EVENT_FLAG_SKIP_BROADCAST;
|
||||||
(sctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
|
||||||
(void *)&clk_ctrl, true);
|
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 */
|
/* Now gate DSI clocks for the master */
|
||||||
mdss_mdp_ctl_intf_event
|
mdss_mdp_ctl_intf_event
|
||||||
(ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
(ctx->ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
||||||
(void *)&clk_ctrl, true);
|
(void *)&clk_ctrl, CTL_INTF_EVENT_FLAG_SKIP_BROADCAST);
|
||||||
|
|
||||||
/* Gate mdp clocks */
|
/* Gate mdp clocks */
|
||||||
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
|
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
|
||||||
|
@ -1138,7 +1180,8 @@ static void clk_ctrl_gate_work(struct work_struct *work)
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
/* unlock mutex needed for split display */
|
/* 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);
|
mutex_unlock(&cmd_clk_mtx);
|
||||||
|
|
||||||
MDSS_XLOG(ctl->num, mdp5_data->resources_state, XLOG_FUNC_EXIT);
|
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.state = MDSS_DSI_CLK_OFF;
|
||||||
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
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,
|
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,
|
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;
|
pdata->panel_info.cont_splash_enabled = 0;
|
||||||
if (sctl)
|
if (sctl)
|
||||||
|
@ -1448,8 +1497,8 @@ static int mdss_mdp_cmd_set_partial_roi(struct mdss_mdp_ctl *ctl)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
/* set panel col and page addr */
|
/* set panel col and page addr */
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_ENABLE_PARTIAL_ROI,
|
||||||
MDSS_EVENT_ENABLE_PARTIAL_ROI, NULL, false);
|
NULL, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1462,7 +1511,7 @@ static int mdss_mdp_cmd_set_stream_size(struct mdss_mdp_ctl *ctl)
|
||||||
|
|
||||||
/* set dsi controller stream size */
|
/* set dsi controller stream size */
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
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;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1481,20 +1530,24 @@ static int mdss_mdp_cmd_panel_on(struct mdss_mdp_ctl *ctl,
|
||||||
if (sctl)
|
if (sctl)
|
||||||
sctx = (struct mdss_mdp_cmd_ctx *) sctl->intf_ctx[MASTER_CTX];
|
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 (!__mdss_mdp_cmd_is_panel_power_on_interactive(ctx)) {
|
||||||
if (ctl->pending_mode_switch != SWITCH_RESOLUTION) {
|
if (ctl->pending_mode_switch != SWITCH_RESOLUTION) {
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY,
|
||||||
MDSS_EVENT_LINK_READY, NULL, false);
|
NULL, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
WARN(rc, "intf %d link ready error (%d)\n",
|
WARN(rc, "intf %d link ready error (%d)\n",
|
||||||
ctl->intf_num, rc);
|
ctl->intf_num, rc);
|
||||||
|
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_UNBLANK,
|
||||||
MDSS_EVENT_UNBLANK, NULL, false);
|
NULL, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
WARN(rc, "intf %d unblank error (%d)\n",
|
WARN(rc, "intf %d unblank error (%d)\n",
|
||||||
ctl->intf_num, rc);
|
ctl->intf_num, rc);
|
||||||
|
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON,
|
||||||
MDSS_EVENT_PANEL_ON, NULL, false);
|
NULL, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
WARN(rc, "intf %d panel on error (%d)\n",
|
WARN(rc, "intf %d panel on error (%d)\n",
|
||||||
ctl->intf_num, rc);
|
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_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_REGISTER_RECOVERY_HANDLER,
|
MDSS_EVENT_REGISTER_RECOVERY_HANDLER,
|
||||||
(void *)&ctx->intf_recovery, false);
|
(void *)&ctx->intf_recovery,
|
||||||
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
|
|
||||||
ctx->intf_stopped = 0;
|
ctx->intf_stopped = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1689,7 +1743,8 @@ int mdss_mdp_cmd_kickoff(struct mdss_mdp_ctl *ctl, void *arg)
|
||||||
/*
|
/*
|
||||||
* tx dcs command if had any
|
* 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);
|
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)
|
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);
|
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__);
|
ctx = (struct mdss_mdp_cmd_ctx *)ctl->intf_ctx[MASTER_CTX];
|
||||||
else
|
if (is_pingpong_split(ctl->mfd))
|
||||||
mdss_mdp_tearcheck_enable(ctl, true);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1774,8 +1842,7 @@ int mdss_mdp_cmd_ctx_stop(struct mdss_mdp_ctl *ctl,
|
||||||
if (!ctl->pending_mode_switch) {
|
if (!ctl->pending_mode_switch) {
|
||||||
mdss_mdp_ctl_intf_event(ctl,
|
mdss_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_REGISTER_RECOVERY_HANDLER,
|
MDSS_EVENT_REGISTER_RECOVERY_HANDLER,
|
||||||
NULL,
|
NULL, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* shut down the MDP/DSI resources if still enabled */
|
/* 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:
|
panel_events:
|
||||||
if ((!is_panel_split(ctl->mfd) || is_pingpong_split(ctl->mfd) ||
|
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__);
|
pr_debug("%s: send panel events\n", __func__);
|
||||||
ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK,
|
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);
|
WARN(ret, "intf %d unblank error (%d)\n", ctl->intf_num, ret);
|
||||||
|
|
||||||
ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_OFF,
|
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);
|
WARN(ret, "intf %d unblank error (%d)\n", ctl->intf_num, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1996,8 +2065,18 @@ panel_events:
|
||||||
ctl->ops.reconfigure = NULL;
|
ctl->ops.reconfigure = NULL;
|
||||||
|
|
||||||
end:
|
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;
|
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);
|
MDSS_XLOG(ctl->num, atomic_read(&ctx->koff_cnt), XLOG_FUNC_EXIT);
|
||||||
mutex_unlock(&ctl->offlock);
|
mutex_unlock(&ctl->offlock);
|
||||||
pr_debug("%s:-\n", __func__);
|
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,
|
static int mdss_mdp_cmd_ctx_setup(struct mdss_mdp_ctl *ctl,
|
||||||
struct mdss_mdp_cmd_ctx *ctx, int pp_num,
|
struct mdss_mdp_cmd_ctx *ctx, int pp_num,
|
||||||
int pingpong_split_slave)
|
bool pingpong_split_slave)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
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;
|
clk_ctrl.client = DSI_CLK_REQ_DSI_CLIENT;
|
||||||
if (sctl)
|
if (sctl)
|
||||||
mdss_mdp_ctl_intf_event(sctl,
|
mdss_mdp_ctl_intf_event(sctl,
|
||||||
MDSS_EVENT_PANEL_CLK_CTRL,
|
MDSS_EVENT_PANEL_CLK_CTRL, (void *)&clk_ctrl,
|
||||||
(void *)&clk_ctrl, true);
|
CTL_INTF_EVENT_FLAG_SKIP_BROADCAST);
|
||||||
|
|
||||||
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RECONFIG_CMD,
|
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,
|
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;
|
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
||||||
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
|
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
|
||||||
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
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_stop(ctl, MDSS_PANEL_POWER_OFF);
|
||||||
mdss_mdp_ctl_intf_event(ctl,
|
mdss_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_DSI_DYNAMIC_SWITCH,
|
MDSS_EVENT_DSI_DYNAMIC_SWITCH,
|
||||||
(void *) mode, false);
|
(void *) mode,
|
||||||
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
} else {
|
} else {
|
||||||
/* release ref count after switch is complete */
|
/* release ref count after switch is complete */
|
||||||
clk_ctrl.state = MDSS_DSI_CLK_OFF;
|
clk_ctrl.state = MDSS_DSI_CLK_OFF;
|
||||||
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
clk_ctrl.client = DSI_CLK_REQ_MDP_CLIENT;
|
||||||
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
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_iommu_ctrl(0);
|
||||||
mdss_bus_bandwidth_ctrl(false);
|
mdss_bus_bandwidth_ctrl(false);
|
||||||
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
|
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
|
||||||
|
|
|
@ -459,7 +459,7 @@ static int mdss_mdp_video_ctx_stop(struct mdss_mdp_ctl *ctl,
|
||||||
mutex_lock(&ctl->offlock);
|
mutex_lock(&ctl->offlock);
|
||||||
if (ctx->timegen_en) {
|
if (ctx->timegen_en) {
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK, NULL,
|
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_BLANK, NULL,
|
||||||
false);
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
if (rc == -EBUSY) {
|
if (rc == -EBUSY) {
|
||||||
pr_debug("intf #%d busy don't turn off\n",
|
pr_debug("intf #%d busy don't turn off\n",
|
||||||
ctl->intf_num);
|
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);
|
mdss_mdp_turn_off_time_engine(ctl, ctx, frame_rate);
|
||||||
|
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_OFF, NULL,
|
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);
|
WARN(rc, "intf %d timegen off error (%d)\n", ctl->intf_num, rc);
|
||||||
|
|
||||||
mdss_bus_bandwidth_ctrl(false);
|
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,
|
rc = mdss_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_PANEL_UPDATE_FPS,
|
MDSS_EVENT_PANEL_UPDATE_FPS,
|
||||||
(void *) (unsigned long) new_fps,
|
(void *) (unsigned long) new_fps,
|
||||||
false);
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
WARN(rc, "intf %d panel fps update error (%d)\n",
|
WARN(rc, "intf %d panel fps update error (%d)\n",
|
||||||
ctl->intf_num, rc);
|
ctl->intf_num, rc);
|
||||||
} else if (pdata->panel_info.dfps_update
|
} 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,
|
rc = mdss_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_PANEL_UPDATE_FPS,
|
MDSS_EVENT_PANEL_UPDATE_FPS,
|
||||||
(void *) (unsigned long) new_fps,
|
(void *) (unsigned long) new_fps,
|
||||||
false);
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
WARN(rc, "intf %d panel fps update error (%d)\n",
|
WARN(rc, "intf %d panel fps update error (%d)\n",
|
||||||
ctl->intf_num, rc);
|
ctl->intf_num, rc);
|
||||||
|
|
||||||
|
@ -1028,7 +1028,7 @@ exit_dfps:
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
rc = mdss_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_PANEL_UPDATE_FPS,
|
MDSS_EVENT_PANEL_UPDATE_FPS,
|
||||||
(void *) (unsigned long) new_fps,
|
(void *) (unsigned long) new_fps,
|
||||||
false);
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
WARN(rc, "intf %d panel fps update error (%d)\n",
|
WARN(rc, "intf %d panel fps update error (%d)\n",
|
||||||
ctl->intf_num, rc);
|
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) {
|
if (!ctx->timegen_en) {
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, NULL,
|
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_LINK_READY, NULL,
|
||||||
false);
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_warn("intf #%d link ready error (%d)\n",
|
pr_warn("intf #%d link ready error (%d)\n",
|
||||||
ctl->intf_num, rc);
|
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,
|
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);
|
WARN(rc, "intf %d unblank error (%d)\n", ctl->intf_num, rc);
|
||||||
|
|
||||||
pr_debug("enabling timing gen for intf=%d\n", ctl->intf_num);
|
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;
|
ctx->timegen_en = true;
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_ON, NULL,
|
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);
|
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,
|
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_POST_PANEL_ON, NULL,
|
||||||
false);
|
CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1147,7 +1147,7 @@ int mdss_mdp_video_reconfigure_splash_done(struct mdss_mdp_ctl *ctl,
|
||||||
|
|
||||||
if (!handoff) {
|
if (!handoff) {
|
||||||
ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CONT_SPLASH_BEGIN,
|
ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CONT_SPLASH_BEGIN,
|
||||||
NULL, false);
|
NULL, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("%s: Failed to handle 'CONT_SPLASH_BEGIN' event\n"
|
pr_err("%s: Failed to handle 'CONT_SPLASH_BEGIN' event\n"
|
||||||
, __func__);
|
, __func__);
|
||||||
|
@ -1173,7 +1173,8 @@ int mdss_mdp_video_reconfigure_splash_done(struct mdss_mdp_ctl *ctl,
|
||||||
msleep(20);
|
msleep(20);
|
||||||
|
|
||||||
ret = mdss_mdp_ctl_intf_event(ctl,
|
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;
|
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,
|
if (mdss_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_REGISTER_RECOVERY_HANDLER,
|
MDSS_EVENT_REGISTER_RECOVERY_HANDLER,
|
||||||
(void *)&ctx->intf_recovery,
|
(void *)&ctx->intf_recovery,
|
||||||
false)) {
|
CTL_INTF_EVENT_FLAG_DEFAULT)) {
|
||||||
pr_err("Failed to register intf recovery handler\n");
|
pr_err("Failed to register intf recovery handler\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -1531,7 +1532,7 @@ void mdss_mdp_switch_to_cmd_mode(struct mdss_mdp_ctl *ctl, int prep)
|
||||||
|
|
||||||
if (!prep) {
|
if (!prep) {
|
||||||
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RECONFIG_CMD,
|
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_RECONFIG_CMD,
|
||||||
(void *) mode, false);
|
(void *) mode, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
return;
|
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 */
|
/* Start off by sending command to initial cmd mode */
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
rc = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_DYNAMIC_SWITCH,
|
||||||
MDSS_EVENT_DSI_DYNAMIC_SWITCH, (void *) mode, false);
|
(void *) mode, CTL_INTF_EVENT_FLAG_DEFAULT);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_err("intf #%d busy don't turn off, rc=%d\n",
|
pr_err("intf #%d busy don't turn off, rc=%d\n",
|
||||||
ctl->intf_num, rc);
|
ctl->intf_num, rc);
|
||||||
|
|
|
@ -1741,7 +1741,7 @@ int mdss_mode_switch_post(struct msm_fb_data_type *mfd, u32 mode)
|
||||||
pr_debug("%s, start\n", __func__);
|
pr_debug("%s, start\n", __func__);
|
||||||
rc = mdss_mdp_ctl_intf_event(ctl,
|
rc = mdss_mdp_ctl_intf_event(ctl,
|
||||||
MDSS_EVENT_DSI_DYNAMIC_SWITCH,
|
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__);
|
pr_debug("%s, end\n", __func__);
|
||||||
} else if (mode == MIPI_CMD_PANEL) {
|
} 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;
|
clk_ctrl.client = DSI_CLK_REQ_DSI_CLIENT;
|
||||||
if (sctl)
|
if (sctl)
|
||||||
mdss_mdp_ctl_intf_event(sctl,
|
mdss_mdp_ctl_intf_event(sctl,
|
||||||
MDSS_EVENT_PANEL_CLK_CTRL,
|
MDSS_EVENT_PANEL_CLK_CTRL, (void *)&clk_ctrl,
|
||||||
(void *)&clk_ctrl, true);
|
CTL_INTF_EVENT_FLAG_SKIP_BROADCAST);
|
||||||
|
|
||||||
mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_PANEL_CLK_CTRL,
|
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) {
|
} else if (mode == SWITCH_RESOLUTION) {
|
||||||
if (ctl->ops.reconfigure)
|
if (ctl->ops.reconfigure)
|
||||||
rc = ctl->ops.reconfigure(ctl, mode, 0);
|
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,
|
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)
|
if (ret)
|
||||||
pr_err("Dynamic switch to %s mode failed!\n",
|
pr_err("Dynamic switch to %s mode failed!\n",
|
||||||
mode ? "command" : "video");
|
mode ? "command" : "video");
|
||||||
|
|
Loading…
Add table
Reference in a new issue