summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-05-01 21:06:50 +0200
committerDenys Dmytriyenko <denys@ti.com>2012-05-03 19:09:17 -0400
commit368d7772dcde0a42e9952ca6b2762495d0f49602 (patch)
tree1ce2832e4d74efb1f422c9dbc9a819fd1533b87e
parentaaf625eb50f9a290a7250b8009beae7e050390dd (diff)
downloadmeta-ti-368d7772dcde0a42e9952ca6b2762495d0f49602.tar.gz
linux-mainline 3.2: fix build of external SGX modules
Patch downloaded from https://github.com/RobertCNelson/stable-kernel/tree/master/patches/sgx Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-rw-r--r--recipes-kernel/linux/linux-mainline-3.2/sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch321
-rw-r--r--recipes-kernel/linux/linux-mainline_3.2.bb1
2 files changed, 322 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-mainline-3.2/sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch b/recipes-kernel/linux/linux-mainline-3.2/sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch
new file mode 100644
index 00000000..9f24df03
--- /dev/null
+++ b/recipes-kernel/linux/linux-mainline-3.2/sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch
@@ -0,0 +1,321 @@
1From 4fbd1a6149222f1a075182e4d41cf1e2f72345d2 Mon Sep 17 00:00:00 2001
2From: Robert Nelson <robertcnelson@gmail.com>
3Date: Wed, 3 Aug 2011 11:08:04 -0500
4Subject: [PATCH] Revert "OMAP: DSS2: remove update_mode from omapdss"
5
6This reverts commit 8cff88c5da2197aa601409d4a7ce8f83f8de8190.
7---
8 drivers/video/omap2/displays/panel-taal.c | 17 ++++++++
9 drivers/video/omap2/dss/display.c | 45 ++++++++++++++++++++++
10 drivers/video/omap2/dss/manager.c | 59 ++++++++++++++++++++++-------
11 drivers/video/omap2/dss/venc.c | 17 ++++++++
12 include/video/omapdss.h | 11 +++++
13 5 files changed, 135 insertions(+), 14 deletions(-)
14
15diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
16index 80c3f6a..a2a7380 100644
17--- a/drivers/video/omap2/displays/panel-taal.c
18+++ b/drivers/video/omap2/displays/panel-taal.c
19@@ -1874,6 +1874,20 @@ err:
20 mutex_unlock(&td->lock);
21 }
22
23+static int taal_set_update_mode(struct omap_dss_device *dssdev,
24+ enum omap_dss_update_mode mode)
25+{
26+ if (mode != OMAP_DSS_UPDATE_MANUAL)
27+ return -EINVAL;
28+ return 0;
29+}
30+
31+static enum omap_dss_update_mode taal_get_update_mode(
32+ struct omap_dss_device *dssdev)
33+{
34+ return OMAP_DSS_UPDATE_MANUAL;
35+}
36+
37 static struct omap_dss_driver taal_driver = {
38 .probe = taal_probe,
39 .remove = __exit_p(taal_remove),
40@@ -1883,6 +1897,9 @@ static struct omap_dss_driver taal_driver = {
41 .suspend = taal_suspend,
42 .resume = taal_resume,
43
44+ .set_update_mode = taal_set_update_mode,
45+ .get_update_mode = taal_get_update_mode,
46+
47 .update = taal_update,
48 .sync = taal_sync,
49
50diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
51index be331dc..6fa445c 100644
52--- a/drivers/video/omap2/dss/display.c
53+++ b/drivers/video/omap2/dss/display.c
54@@ -65,6 +65,48 @@ static ssize_t display_enabled_store(struct device *dev,
55 return size;
56 }
57
58+static ssize_t display_upd_mode_show(struct device *dev,
59+ struct device_attribute *attr, char *buf)
60+{
61+ struct omap_dss_device *dssdev = to_dss_device(dev);
62+ enum omap_dss_update_mode mode = OMAP_DSS_UPDATE_AUTO;
63+ if (dssdev->driver->get_update_mode)
64+ mode = dssdev->driver->get_update_mode(dssdev);
65+ return snprintf(buf, PAGE_SIZE, "%d\n", mode);
66+}
67+
68+static ssize_t display_upd_mode_store(struct device *dev,
69+ struct device_attribute *attr,
70+ const char *buf, size_t size)
71+{
72+ struct omap_dss_device *dssdev = to_dss_device(dev);
73+ int val, r;
74+ enum omap_dss_update_mode mode;
75+
76+ if (!dssdev->driver->set_update_mode)
77+ return -EINVAL;
78+
79+ r = kstrtoint(buf, 0, &val);
80+ if (r)
81+ return r;
82+
83+ switch (val) {
84+ case OMAP_DSS_UPDATE_DISABLED:
85+ case OMAP_DSS_UPDATE_AUTO:
86+ case OMAP_DSS_UPDATE_MANUAL:
87+ mode = (enum omap_dss_update_mode)val;
88+ break;
89+ default:
90+ return -EINVAL;
91+ }
92+
93+ r = dssdev->driver->set_update_mode(dssdev, mode);
94+ if (r)
95+ return r;
96+
97+ return size;
98+}
99+
100 static ssize_t display_tear_show(struct device *dev,
101 struct device_attribute *attr, char *buf)
102 {
103@@ -250,6 +292,8 @@ static ssize_t display_wss_store(struct device *dev,
104
105 static DEVICE_ATTR(enabled, S_IRUGO|S_IWUSR,
106 display_enabled_show, display_enabled_store);
107+static DEVICE_ATTR(update_mode, S_IRUGO|S_IWUSR,
108+ display_upd_mode_show, display_upd_mode_store);
109 static DEVICE_ATTR(tear_elim, S_IRUGO|S_IWUSR,
110 display_tear_show, display_tear_store);
111 static DEVICE_ATTR(timings, S_IRUGO|S_IWUSR,
112@@ -263,6 +307,7 @@ static DEVICE_ATTR(wss, S_IRUGO|S_IWUSR,
113
114 static struct device_attribute *display_sysfs_attrs[] = {
115 &dev_attr_enabled,
116+ &dev_attr_update_mode,
117 &dev_attr_tear_elim,
118 &dev_attr_timings,
119 &dev_attr_rotate,
120diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
121index 6e63845..e5684a9 100644
122--- a/drivers/video/omap2/dss/manager.c
123+++ b/drivers/video/omap2/dss/manager.c
124@@ -515,6 +515,8 @@ struct overlay_cache_data {
125
126 u32 fifo_low;
127 u32 fifo_high;
128+
129+ bool manual_update;
130 };
131
132 struct manager_cache_data {
133@@ -528,6 +530,7 @@ struct manager_cache_data {
134
135 struct omap_overlay_manager_info info;
136
137+ bool manual_upd_display;
138 bool manual_update;
139 bool do_manual_update;
140
141@@ -636,15 +639,24 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
142 if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
143 return 0;
144
145- if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
146- return 0;
147-
148 if (dssdev->type == OMAP_DISPLAY_TYPE_VENC
149 || dssdev->type == OMAP_DISPLAY_TYPE_HDMI) {
150 irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
151 } else {
152- irq = (dssdev->manager->id == OMAP_DSS_CHANNEL_LCD) ?
153- DISPC_IRQ_VSYNC : DISPC_IRQ_VSYNC2;
154+ if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
155+ enum omap_dss_update_mode mode;
156+ mode = dssdev->driver->get_update_mode(dssdev);
157+ if (mode != OMAP_DSS_UPDATE_AUTO)
158+ return 0;
159+
160+ irq = (dssdev->manager->id == OMAP_DSS_CHANNEL_LCD) ?
161+ DISPC_IRQ_FRAMEDONE
162+ : DISPC_IRQ_FRAMEDONE2;
163+ } else {
164+ irq = (dssdev->manager->id == OMAP_DSS_CHANNEL_LCD) ?
165+ DISPC_IRQ_VSYNC
166+ : DISPC_IRQ_VSYNC2;
167+ }
168 }
169
170 mc = &dss_cache.manager_cache[mgr->id];
171@@ -705,15 +717,24 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
172 if (!dssdev || dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
173 return 0;
174
175- if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
176- return 0;
177-
178 if (dssdev->type == OMAP_DISPLAY_TYPE_VENC
179 || dssdev->type == OMAP_DISPLAY_TYPE_HDMI) {
180 irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
181 } else {
182- irq = (dssdev->manager->id == OMAP_DSS_CHANNEL_LCD) ?
183- DISPC_IRQ_VSYNC : DISPC_IRQ_VSYNC2;
184+ if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
185+ enum omap_dss_update_mode mode;
186+ mode = dssdev->driver->get_update_mode(dssdev);
187+ if (mode != OMAP_DSS_UPDATE_AUTO)
188+ return 0;
189+
190+ irq = (dssdev->manager->id == OMAP_DSS_CHANNEL_LCD) ?
191+ DISPC_IRQ_FRAMEDONE
192+ : DISPC_IRQ_FRAMEDONE2;
193+ } else {
194+ irq = (dssdev->manager->id == OMAP_DSS_CHANNEL_LCD) ?
195+ DISPC_IRQ_VSYNC
196+ : DISPC_IRQ_VSYNC2;
197+ }
198 }
199
200 oc = &dss_cache.overlay_cache[ovl->id];
201@@ -848,7 +869,7 @@ static int configure_overlay(enum omap_plane plane)
202 orig_outw = outw;
203 orig_outh = outh;
204
205- if (mc->manual_update && mc->do_manual_update) {
206+ if (c->manual_update && mc->do_manual_update) {
207 unsigned bpp;
208 unsigned scale_x_m = w, scale_x_d = outw;
209 unsigned scale_y_m = h, scale_y_d = outh;
210@@ -1010,7 +1031,7 @@ static int configure_dispc(void)
211 if (!oc->dirty)
212 continue;
213
214- if (mc->manual_update && !mc->do_manual_update)
215+ if (oc->manual_update && !mc->do_manual_update)
216 continue;
217
218 if (mgr_busy[oc->channel]) {
219@@ -1058,7 +1079,7 @@ static int configure_dispc(void)
220 /* We don't need GO with manual update display. LCD iface will
221 * always be turned off after frame, and new settings will be
222 * taken in to use at next update */
223- if (!mc->manual_update)
224+ if (!mc->manual_upd_display)
225 dispc_mgr_go(i);
226 }
227
228@@ -1376,6 +1397,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
229
230 oc->enabled = true;
231
232+ oc->manual_update =
233+ dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
234+ dssdev->driver->get_update_mode(dssdev) !=
235+ OMAP_DSS_UPDATE_AUTO;
236+
237 ++num_planes_enabled;
238 }
239
240@@ -1402,8 +1428,13 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
241 mc->dirty = true;
242 mc->info = mgr->info;
243
244- mc->manual_update =
245+ mc->manual_upd_display =
246 dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
247+
248+ mc->manual_update =
249+ dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
250+ dssdev->driver->get_update_mode(dssdev) !=
251+ OMAP_DSS_UPDATE_AUTO;
252 }
253
254 /* XXX TODO: Try to get fifomerge working. The problem is that it
255diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
256index b404095..a8b03c1 100644
257--- a/drivers/video/omap2/dss/venc.c
258+++ b/drivers/video/omap2/dss/venc.c
259@@ -579,6 +579,20 @@ static int venc_panel_resume(struct omap_dss_device *dssdev)
260 return venc_panel_enable(dssdev);
261 }
262
263+static enum omap_dss_update_mode venc_get_update_mode(
264+ struct omap_dss_device *dssdev)
265+{
266+ return OMAP_DSS_UPDATE_AUTO;
267+}
268+
269+static int venc_set_update_mode(struct omap_dss_device *dssdev,
270+ enum omap_dss_update_mode mode)
271+{
272+ if (mode != OMAP_DSS_UPDATE_AUTO)
273+ return -EINVAL;
274+ return 0;
275+}
276+
277 static void venc_get_timings(struct omap_dss_device *dssdev,
278 struct omap_video_timings *timings)
279 {
280@@ -663,6 +677,9 @@ static struct omap_dss_driver venc_driver = {
281 .get_resolution = omapdss_default_get_resolution,
282 .get_recommended_bpp = omapdss_default_get_recommended_bpp,
283
284+ .set_update_mode = venc_set_update_mode,
285+ .get_update_mode = venc_get_update_mode,
286+
287 .get_timings = venc_get_timings,
288 .set_timings = venc_set_timings,
289 .check_timings = venc_check_timings,
290diff --git a/include/video/omapdss.h b/include/video/omapdss.h
291index 378c7ed..540d61e 100644
292--- a/include/video/omapdss.h
293+++ b/include/video/omapdss.h
294@@ -152,6 +152,12 @@ enum omap_display_caps {
295 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1,
296 };
297
298+enum omap_dss_update_mode {
299+ OMAP_DSS_UPDATE_DISABLED = 0,
300+ OMAP_DSS_UPDATE_AUTO,
301+ OMAP_DSS_UPDATE_MANUAL,
302+};
303+
304 enum omap_dss_display_state {
305 OMAP_DSS_DISPLAY_DISABLED = 0,
306 OMAP_DSS_DISPLAY_ACTIVE,
307@@ -587,6 +593,11 @@ struct omap_dss_driver {
308 int (*resume)(struct omap_dss_device *display);
309 int (*run_test)(struct omap_dss_device *display, int test);
310
311+ int (*set_update_mode)(struct omap_dss_device *dssdev,
312+ enum omap_dss_update_mode);
313+ enum omap_dss_update_mode (*get_update_mode)(
314+ struct omap_dss_device *dssdev);
315+
316 int (*update)(struct omap_dss_device *dssdev,
317 u16 x, u16 y, u16 w, u16 h);
318 int (*sync)(struct omap_dss_device *dssdev);
319--
3201.7.7.3
321
diff --git a/recipes-kernel/linux/linux-mainline_3.2.bb b/recipes-kernel/linux/linux-mainline_3.2.bb
index efad8d01..dd86bbf7 100644
--- a/recipes-kernel/linux/linux-mainline_3.2.bb
+++ b/recipes-kernel/linux/linux-mainline_3.2.bb
@@ -69,6 +69,7 @@ SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gi
69 file://omap_fixes/0004-ARM-OMAP4-clock-Add-CPU-local-timer-clock-node.patch \ 69 file://omap_fixes/0004-ARM-OMAP4-clock-Add-CPU-local-timer-clock-node.patch \
70 file://omap_fixes/0005-ARM-OMAP3-hwmod-data-disable-multiblock-reads-on-MMC.patch \ 70 file://omap_fixes/0005-ARM-OMAP3-hwmod-data-disable-multiblock-reads-on-MMC.patch \
71 file://omap_fixes/0006-OMAP-HWMOD-add-es3plus-to-am36xx-am35xx.patch \ 71 file://omap_fixes/0006-OMAP-HWMOD-add-es3plus-to-am36xx-am35xx.patch \
72 file://sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch \
72 \ 73 \
73 file://defconfig" 74 file://defconfig"
74 75