summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2009-05-27 12:00:20 +0300
committerWajahat Khan <w-khan@ti.com>2009-10-19 10:26:49 -0500
commit1fd451a14582122326fa323061fedef7aff0b644 (patch)
treecc119a8176426adaded51eb0bfc043f63e403312
parent5c246e252fca402a02b03818a4d10d420659a3be (diff)
DSS2: DSI: implement timeout for DSI transfer
Proper transfer shutdown is still missing. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r--drivers/video/omap2/dss/dsi.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 050b945ae06d..df8f86d747d3 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -269,6 +269,7 @@ static struct
struct work_struct framedone_work;
struct work_struct process_work;
+ struct delayed_work framedone_timeout_work;
struct workqueue_struct *workqueue;
enum omap_dss_update_mode user_update_mode;
@@ -2756,12 +2757,34 @@ static void dsi_update_screen_dispc(struct omap_display *display,
dispc_disable_sidle();
+ queue_delayed_work(dsi.workqueue, &dsi.framedone_timeout_work,
+ msecs_to_jiffies(1000));
+
dispc_enable_lcd_out(1);
if (dsi.use_te)
dsi_vc_send_bta(1);
}
+static void framedone_timeout_callback(struct work_struct *work)
+{
+ DSSERR("framedone timeout\n");
+
+ dispc_enable_lcd_out(0);
+
+ /* XXX TODO: cancel the transfer properly */
+
+ /* XXX check that fifo is not full. otherwise we would sleep and never
+ * get to process_cmd_fifo below */
+ /* We check for target_update_mode, not update_mode. No reason to push
+ * new updates if we're turning auto update off */
+ if (dsi.target_update_mode == OMAP_DSS_UPDATE_AUTO)
+ dsi_push_autoupdate(dsi.vc[1].display);
+
+ atomic_set(&dsi.cmd_pending, 0);
+ dsi_process_cmd_fifo(NULL);
+}
+
static void framedone_callback(void *data, u32 mask)
{
if (dsi.framedone_scheduled) {
@@ -2769,6 +2792,8 @@ static void framedone_callback(void *data, u32 mask)
return;
}
+ cancel_delayed_work(&dsi.framedone_timeout_work);
+
dispc_enable_sidle();
dsi.framedone_scheduled = 1;
@@ -3834,6 +3859,8 @@ int dsi_init(void)
dsi.workqueue = create_singlethread_workqueue("dsi");
INIT_WORK(&dsi.framedone_work, framedone_worker);
INIT_WORK(&dsi.process_work, dsi_process_cmd_fifo);
+ INIT_DELAYED_WORK(&dsi.framedone_timeout_work,
+ framedone_timeout_callback);
mutex_init(&dsi.lock);