msm_fb: display: add video mode dcs cmdlist support

Add video mode dcs command list support. This patch
make sure dcs commands committed while dsi video engine
is busy so that dcs command will be transmitted at beginning
of next BLLP.

Change-Id: I11b0214ee10f3b1ef33b1da4c8e577800068cb06
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
(cherry picked from commit 7b0e0a45216714d76bf717a928a0db77bfa2868a)
This commit is contained in:
Kuogee Hsieh 2012-10-13 17:26:31 -07:00 committed by Stephen Boyd
parent e8a7ba4811
commit d821dcad2c

View file

@ -24,6 +24,7 @@
#include <linux/semaphore.h>
#include <linux/uaccess.h>
#include <linux/clk.h>
#include <linux/iopoll.h>
#include <linux/platform_device.h>
#include <linux/iopoll.h>
@ -1488,6 +1489,23 @@ int mipi_dsi_cmd_dma_rx(struct dsi_buf *rp, int rlen)
return rlen;
}
static void mipi_dsi_wait_for_video_eng_busy(void)
{
u32 status;
int sleep_us = 4000;
/*
* if video mode engine was not busy (in BLLP)
* wait to pass BLLP
*/
/* check for VIDEO_MODE_ENGINE_BUSY */
readl_poll((MIPI_DSI_BASE + 0x0004), /* DSI_STATUS */
status,
(status & 0x08),
sleep_us);
}
void mipi_dsi_cmd_mdp_busy(void)
{
u32 status;
@ -1563,6 +1581,7 @@ void mipi_dsi_cmdlist_commit(int from_mdp)
{
struct dcs_cmd_req *req;
int video;
u32 dsi_ctrl;
mutex_lock(&cmd_mutex);
req = mipi_dsi_cmdlist_get();
@ -1579,9 +1598,18 @@ void mipi_dsi_cmdlist_commit(int from_mdp)
pr_debug("%s: from_mdp=%d pid=%d\n", __func__, from_mdp, current->pid);
if (!from_mdp) { /* from put */
/* make sure dsi_cmd_mdp is idle */
mipi_dsi_cmd_mdp_busy();
dsi_ctrl = MIPI_INP(MIPI_DSI_BASE + 0x0000);
if (dsi_ctrl & 0x02) {
/* video mode, make sure dsi_cmd_mdp is busy
* sodcs command will be txed at start of BLLP
*/
mipi_dsi_wait_for_video_eng_busy();
} else {
/* command mode */
if (!from_mdp) { /* cmdlist_put */
/* make sure dsi_cmd_mdp is idle */
mipi_dsi_cmd_mdp_busy();
}
}
if (req->flags & CMD_REQ_RX)