diff options
author | Sreenidhi Koti Ananda Rao <a0393742@ti.com> | 2012-02-11 00:21:31 +0530 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:56:38 +0200 |
commit | 71ad23756c823400f04c430c3e3b96eaa436d9fe (patch) | |
tree | e79e62e5d87fba7fbe1199a16f50e941a6026fb5 | |
parent | 067065b8801f3bbf59e32a947ec0abd0e62542fd (diff) | |
download | kernel_samsung_tuna-71ad23756c823400f04c430c3e3b96eaa436d9fe.zip kernel_samsung_tuna-71ad23756c823400f04c430c3e3b96eaa436d9fe.tar.gz kernel_samsung_tuna-71ad23756c823400f04c430c3e3b96eaa436d9fe.tar.bz2 |
OMAP DSI: Fix consecutive bus unlocks for manual mode panel.
Description: In manual mode panels, a semphore is used to keep track
of display queue and release. Upon the condition of framedone timeout
error the semaphore is released once by the callback handler before exiting.
If framedone for the timed-out frame arrives after 250 msec and before
next frame queuing, it releases the semaphore second time in the callback handler.
This results in warnon assert later.
This patch puts in proper check before releasing the semaphore.
This way we prevent multiple unlocks of the bus..
Change-Id: I7db034de1a286f58a7fb9187b4ff356d7ad4731b
Signed-off-by: Sreenidhi Koti <sreenidhi@ti.com>
Signed-off-by: Sujeet Barnawal <s-baranwal@ti.com>
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 25 | ||||
-rwxr-xr-x | drivers/video/omap2/dss/dsi.c | 9 | ||||
-rw-r--r-- | include/video/omapdss.h | 1 |
3 files changed, 32 insertions, 3 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index c44ae3f..9603413 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -223,11 +223,11 @@ struct taal_data { struct delayed_work te_timeout_work; bool use_dsi_bl; - bool cabc_broken; - unsigned cabc_mode; - bool intro_printed; + bool framedone_timeout; + + unsigned cabc_mode; struct workqueue_struct *workqueue; @@ -1413,8 +1413,27 @@ err: static void taal_framedone_cb(int err, void *data) { struct omap_dss_device *dssdev = data; + struct taal_data *td = dev_get_drvdata(&dssdev->dev); dev_dbg(&dssdev->dev, "framedone, err %d\n", err); + /* + * assert framadone timeout flag before + * unlocking the bus + */ + if (err && !dsi_bus_was_unlocked(dssdev)) + td->framedone_timeout = true; + + /* + * reset framadone timeout flag upon next + * framedone. Ensure no double un-lock from + * the erroneous framedone callback. + */ + if (td->framedone_timeout && !err) { + td->framedone_timeout = false; + if (dsi_bus_was_unlocked(dssdev)) + return; + } dsi_bus_unlock(dssdev); + return; } static irqreturn_t taal_te_isr(int irq, void *data) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index dde0fb5..b7fe130 100755 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -416,6 +416,15 @@ void dsi_bus_unlock(struct omap_dss_device *dssdev) } EXPORT_SYMBOL(dsi_bus_unlock); +bool dsi_bus_was_unlocked(struct omap_dss_device *dssdev) +{ + struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); + struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); + + return dsi->bus_lock.count == 1; +} +EXPORT_SYMBOL(dsi_bus_was_unlocked); + static bool dsi_bus_is_locked(struct platform_device *dsidev) { struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 3be0bc3..043c85f 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -246,6 +246,7 @@ void rfbi_bus_unlock(void); /* DSI */ void dsi_bus_lock(struct omap_dss_device *dssdev); void dsi_bus_unlock(struct omap_dss_device *dssdev); +bool dsi_bus_was_unlocked(struct omap_dss_device *dssdev); int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, int len); int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, |