From e832d03830dc5a1dd542938c2b880ff5ab55892b Mon Sep 17 00:00:00 2001 From: Fancy Fang Date: Tue, 22 Aug 2017 16:51:00 +0800 Subject: [PATCH] MLK-16242-6 video: fbdev: dcss: refine cfifo synchronization logic Remove the synchronization workaround in 'commit_to_fifo()' and add ctxld wq flush calls in pan display, since the pan display usually requires blocking mode behavior. But other functions can also work in non-blocking mode, so perform synchronization handling in 'commit_to_fifo' is not good for the interfaces which doesn't require blocking mode. Signed-off-by: Fancy Fang --- drivers/video/fbdev/mxc/imx_dcss.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/video/fbdev/mxc/imx_dcss.c b/drivers/video/fbdev/mxc/imx_dcss.c index 289912c7c698..610d9438cba9 100644 --- a/drivers/video/fbdev/mxc/imx_dcss.c +++ b/drivers/video/fbdev/mxc/imx_dcss.c @@ -2170,7 +2170,6 @@ static int commit_to_fifo(uint32_t channel, struct ctxld_commit *cc; struct cbuffer *cb; struct ctxld_unit *unit = NULL; - uint32_t ctxld_status, timeout; if (channel > 2 || !info) return -EINVAL; @@ -2186,27 +2185,6 @@ static int commit_to_fifo(uint32_t channel, cb = &chan_info->cb; commit_size = cb->sb_data_len + cb->db_data_len; - /* timeout is 1000ms */ - timeout = 1001; - /* TODO: workaround for making fifo commit to be synchronous */ - ctxld_status = readl(info->base + CTX_LD_START + CTXLD_CTRL_STATUS); - while (--timeout && (ctxld_status & 0x1)) { - mdelay(1); - ctxld_status = readl(info->base + CTX_LD_START + CTXLD_CTRL_STATUS); - } - - if (!timeout) { - dev_err(&pdev->dev, "%s: context loader timeout\n", __func__); - - /* drop this commit */ - cb->db_data_len = 0; - cb->sb_data_len = 0; - - kfree(cc); - - return -EBUSY; - } - restart: spin_lock(&cfifo->cqueue.lock); @@ -2572,6 +2550,9 @@ static int dcss_pan_display(struct fb_var_screeninfo *var, return ret; } + /* make pan display synchronously */ + flush_workqueue(info->ctxld_wq); + return 0; } -- 2.17.1