summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-18 15:32:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-18 15:36:06 +0000
commit673abd92f999829bdd67d0273c43570a62123a63 (patch)
tree63132d1ffc1cb5bf50d244b184ca8d58a9cbc85c /meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch
parentfed61beb31c47e2d96af905a7047fe78d64c9bd0 (diff)
downloadpoky-673abd92f999829bdd67d0273c43570a62123a63.tar.gz
conf/machine: Drop older machines with no recent updates
These are all moving to meta-extras. Ideally in the future machines such as these will be maintained to topic specific layers as we move to a more layer oriented model. If this causes a problem for anyone please discuss it on the mailing list. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch101
1 files changed, 0 insertions, 101 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch
deleted file mode 100644
index e9fc76ce15..0000000000
--- a/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0049-DSS2-VRAM-clear-allocated-area-with-DMA.patch
+++ /dev/null
@@ -1,101 +0,0 @@
1From 02034cc79f69512a6037f03ad1243c28f59fdd8a Mon Sep 17 00:00:00 2001
2From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
3Date: Wed, 22 Apr 2009 10:25:20 +0300
4Subject: [PATCH] DSS2: VRAM: clear allocated area with DMA
5
6Use DMA constant fill feature to clear VRAM area when
7someone allocates it.
8---
9 arch/arm/plat-omap/vram.c | 57 +++++++++++++++++++++++++++++++++++++++++++++
10 1 files changed, 57 insertions(+), 0 deletions(-)
11
12diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
13index 8e9fe77..90276ac 100644
14--- a/arch/arm/plat-omap/vram.c
15+++ b/arch/arm/plat-omap/vram.c
16@@ -31,11 +31,13 @@
17 #include <linux/seq_file.h>
18 #include <linux/bootmem.h>
19 #include <linux/omapfb.h>
20+#include <linux/completion.h>
21
22 #include <asm/setup.h>
23
24 #include <mach/sram.h>
25 #include <mach/vram.h>
26+#include <mach/dma.h>
27
28 #ifdef DEBUG
29 #define DBG(format, ...) printk(KERN_DEBUG "VRAM: " format, ## __VA_ARGS__)
30@@ -276,6 +278,59 @@ int omap_vram_reserve(unsigned long paddr, size_t size)
31 }
32 EXPORT_SYMBOL(omap_vram_reserve);
33
34+static void _omap_vram_dma_cb(int lch, u16 ch_status, void *data)
35+{
36+ struct completion *compl = data;
37+ complete(compl);
38+}
39+
40+static int _omap_vram_clear(u32 paddr, unsigned pages)
41+{
42+ struct completion compl;
43+ unsigned elem_count;
44+ unsigned frame_count;
45+ int r;
46+ int lch;
47+
48+ init_completion(&compl);
49+
50+ r = omap_request_dma(OMAP_DMA_NO_DEVICE, "VRAM DMA",
51+ _omap_vram_dma_cb,
52+ &compl, &lch);
53+ if (r) {
54+ pr_err("VRAM: request_dma failed for memory clear\n");
55+ return -EBUSY;
56+ }
57+
58+ elem_count = pages * PAGE_SIZE / 4;
59+ frame_count = 1;
60+
61+ omap_set_dma_transfer_params(lch, OMAP_DMA_DATA_TYPE_S32,
62+ elem_count, frame_count,
63+ OMAP_DMA_SYNC_ELEMENT,
64+ 0, 0);
65+
66+ omap_set_dma_dest_params(lch, 0, OMAP_DMA_AMODE_POST_INC,
67+ paddr, 0, 0);
68+
69+ omap_set_dma_color_mode(lch, OMAP_DMA_CONSTANT_FILL, 0x000000);
70+
71+ omap_start_dma(lch);
72+
73+ if (wait_for_completion_timeout(&compl, msecs_to_jiffies(1000)) == 0) {
74+ omap_stop_dma(lch);
75+ pr_err("VRAM: dma timeout while clearing memory\n");
76+ r = -EIO;
77+ goto err;
78+ }
79+
80+ r = 0;
81+err:
82+ omap_free_dma(lch);
83+
84+ return r;
85+}
86+
87 static int _omap_vram_alloc(int mtype, unsigned pages, unsigned long *paddr)
88 {
89 struct vram_region *rm;
90@@ -313,6 +368,8 @@ found:
91
92 *paddr = start;
93
94+ _omap_vram_clear(start, pages);
95+
96 return 0;
97 }
98
99--
1001.5.6.5
101