aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-omap-pm/dss2/0082-DSS2-DSI-implement-timeout-for-DSI-transfer.patch
blob: 6d211adc92d4c861d030ba8bc86156a899906ddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From d8745c631cfcbf6b91b7ffd1c228b1c27f6d1917 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Wed, 27 May 2009 12:00:20 +0300
Subject: [PATCH 082/146] DSS2: DSI: implement timeout for DSI transfer

Proper transfer shutdown is still missing.
---
 drivers/video/omap2/dss/dsi.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index c45140f..38d3807 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);
 
-- 
1.6.2.4