diff options
| author | raghavendra ambadas <rambad@codeaurora.org> | 2020-04-02 15:27:47 +0530 |
|---|---|---|
| committer | raghavendra ambadas <rambad@codeaurora.org> | 2020-04-09 17:41:29 +0530 |
| commit | a4896cc8c835959d2cd37168547765b949695838 (patch) | |
| tree | a66aed34e7ed5d7e28d984473c947d47384ae76d | |
| parent | 85d75e131d471e8d0bdcba22077913f6d3508e1e (diff) | |
fbdev: msm: wait for frame complete before triggering dma cmd
In dual dsi case while updating backlight through dcs commands
there is a chance of getting both the readptr and dma_tx interrupt
very close, due to which DSI0 may start cmd mdp transfer and
DSI1 will start cmd dma transfer and cause deadlock.
To fix the issue do not trigger dma commands close to TE.
Change-Id: I38536477a1ab71167a5e315a2b2c4a2b0c215b4a
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_cmd.h | 3 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_host.c | 14 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_panel.c | 4 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c | 7 |
4 files changed, 16 insertions, 12 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi_cmd.h b/drivers/video/fbdev/msm/mdss_dsi_cmd.h index 0ca968a00460..f323a2b665b6 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_cmd.h +++ b/drivers/video/fbdev/msm/mdss_dsi_cmd.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2016, 2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -101,6 +101,7 @@ struct dsi_cmd_desc { #define CMD_CLK_CTRL 0x0004 #define CMD_REQ_UNICAST 0x0008 #define CMD_REQ_DMA_TPG 0x0040 +#define CMD_REQ_DCS 0x0080 #define CMD_REQ_NO_MAX_PKT_SIZE 0x0008 #define CMD_REQ_LP_MODE 0x0010 #define CMD_REQ_HS_MODE 0x0020 diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c index 34cedaaa5864..a34a3424d990 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_host.c +++ b/drivers/video/fbdev/msm/mdss_dsi_host.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, 2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2668,7 +2668,7 @@ int mdss_dsi_cmdlist_rx(struct mdss_dsi_ctrl_pdata *ctrl, } static inline bool mdss_dsi_delay_cmd(struct mdss_dsi_ctrl_pdata *ctrl, - bool from_mdp) + bool from_mdp, struct dcs_cmd_req *req) { unsigned long flags; bool mdp_busy = false; @@ -2678,9 +2678,9 @@ static inline bool mdss_dsi_delay_cmd(struct mdss_dsi_ctrl_pdata *ctrl, goto exit; /* delay only for split dsi, cmd mode and burst mode enabled cases */ - if (!mdss_dsi_is_hw_config_split(ctrl->shared_data) || + if ((!mdss_dsi_is_hw_config_split(ctrl->shared_data) || !(ctrl->panel_mode == DSI_CMD_MODE) || - !ctrl->burst_mode_enabled) + !ctrl->burst_mode_enabled) && !(req->flags & CMD_REQ_DCS)) goto exit; /* delay only if cmd is not from mdp and panel has been initialized */ @@ -2689,8 +2689,10 @@ static inline bool mdss_dsi_delay_cmd(struct mdss_dsi_ctrl_pdata *ctrl, /* if broadcast enabled, apply delay only if this is the ctrl trigger */ if (mdss_dsi_sync_wait_enable(ctrl) && - !mdss_dsi_sync_wait_trigger(ctrl)) + (!mdss_dsi_sync_wait_trigger(ctrl) && !(req->flags & CMD_REQ_DCS))) goto exit; + else + need_wait = true; spin_lock_irqsave(&ctrl->mdp_lock, flags); if (ctrl->mdp_busy == true) @@ -2830,7 +2832,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) * mdp path */ mutex_lock(&ctrl->mutex); - if (mdss_dsi_delay_cmd(ctrl, from_mdp)) + if (mdss_dsi_delay_cmd(ctrl, from_mdp, req)) ctrl->mdp_callback->fxn(ctrl->mdp_callback->data, MDP_INTF_CALLBACK_DSI_WAIT); mutex_unlock(&ctrl->mutex); diff --git a/drivers/video/fbdev/msm/mdss_dsi_panel.c b/drivers/video/fbdev/msm/mdss_dsi_panel.c index bf695ae0beaf..fd269d7baf09 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_panel.c +++ b/drivers/video/fbdev/msm/mdss_dsi_panel.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, 2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -234,7 +234,7 @@ static void mdss_dsi_panel_bklt_dcs(struct mdss_dsi_ctrl_pdata *ctrl, int level) memset(&cmdreq, 0, sizeof(cmdreq)); cmdreq.cmds = &backlight_cmd; cmdreq.cmds_cnt = 1; - cmdreq.flags = CMD_REQ_COMMIT | CMD_CLK_CTRL; + cmdreq.flags = CMD_REQ_COMMIT | CMD_CLK_CTRL | CMD_REQ_DCS; cmdreq.rlen = 0; cmdreq.cb = NULL; diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c b/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c index b46e955f280b..fea8f0917dee 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c @@ -1228,11 +1228,12 @@ static int mdss_mdp_cmd_intf_callback(void *data, int event) __func__, atomic_read(&ctx->rdptr_cnt), event); /* - * if we are going to suspended or pp split is not enabled, - * just return + * if we are going to suspended, just return */ - if (ctx->intf_stopped || !is_pingpong_split(ctx->ctl->mfd)) + if (ctx->intf_stopped) { + pr_debug("%s: Intf stopped\n", __func__); return -EINVAL; + } atomic_inc(&ctx->rdptr_cnt); /* enable clks and rd_ptr interrupt */ |
