diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-08-30 09:54:01 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-07 13:02:09 -0400 |
commit | 5ae1f3723f089a67ef3bbcba9b8ad1150c091632 (patch) | |
tree | bcbffebdab946dfe1ba4f4311904037a2cb429e3 /drivers | |
parent | ca444158723f3b92531dc552c154fed108f8bc15 (diff) |
OMAPDSS: VRAM: Remove clearing with sDMA
Currently vram.c clears the allocated memory automatically using OMAP
system DMA. In an effort to reduce OMAP dependencies, we'll do the
memory clear with CPU from now on.
The previous patch implemented memory clear in the omapfb driver, and
this patch removes the now obsolete clear functionality from vram.c.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/vram.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/drivers/video/omap2/vram.c b/drivers/video/omap2/vram.c index 87e421e25afe..f2b15c4a75bc 100644 --- a/drivers/video/omap2/vram.c +++ b/drivers/video/omap2/vram.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <asm/setup.h> | 34 | #include <asm/setup.h> |
35 | 35 | ||
36 | #include <plat/vram.h> | 36 | #include <plat/vram.h> |
37 | #include <plat/dma.h> | ||
38 | 37 | ||
39 | #ifdef DEBUG | 38 | #ifdef DEBUG |
40 | #define DBG(format, ...) pr_debug("VRAM: " format, ## __VA_ARGS__) | 39 | #define DBG(format, ...) pr_debug("VRAM: " format, ## __VA_ARGS__) |
@@ -250,59 +249,6 @@ int omap_vram_reserve(unsigned long paddr, size_t size) | |||
250 | } | 249 | } |
251 | EXPORT_SYMBOL(omap_vram_reserve); | 250 | EXPORT_SYMBOL(omap_vram_reserve); |
252 | 251 | ||
253 | static void _omap_vram_dma_cb(int lch, u16 ch_status, void *data) | ||
254 | { | ||
255 | struct completion *compl = data; | ||
256 | complete(compl); | ||
257 | } | ||
258 | |||
259 | static int _omap_vram_clear(u32 paddr, unsigned pages) | ||
260 | { | ||
261 | struct completion compl; | ||
262 | unsigned elem_count; | ||
263 | unsigned frame_count; | ||
264 | int r; | ||
265 | int lch; | ||
266 | |||
267 | init_completion(&compl); | ||
268 | |||
269 | r = omap_request_dma(OMAP_DMA_NO_DEVICE, "VRAM DMA", | ||
270 | _omap_vram_dma_cb, | ||
271 | &compl, &lch); | ||
272 | if (r) { | ||
273 | pr_err("VRAM: request_dma failed for memory clear\n"); | ||
274 | return -EBUSY; | ||
275 | } | ||
276 | |||
277 | elem_count = pages * PAGE_SIZE / 4; | ||
278 | frame_count = 1; | ||
279 | |||
280 | omap_set_dma_transfer_params(lch, OMAP_DMA_DATA_TYPE_S32, | ||
281 | elem_count, frame_count, | ||
282 | OMAP_DMA_SYNC_ELEMENT, | ||
283 | 0, 0); | ||
284 | |||
285 | omap_set_dma_dest_params(lch, 0, OMAP_DMA_AMODE_POST_INC, | ||
286 | paddr, 0, 0); | ||
287 | |||
288 | omap_set_dma_color_mode(lch, OMAP_DMA_CONSTANT_FILL, 0x000000); | ||
289 | |||
290 | omap_start_dma(lch); | ||
291 | |||
292 | if (wait_for_completion_timeout(&compl, msecs_to_jiffies(1000)) == 0) { | ||
293 | omap_stop_dma(lch); | ||
294 | pr_err("VRAM: dma timeout while clearing memory\n"); | ||
295 | r = -EIO; | ||
296 | goto err; | ||
297 | } | ||
298 | |||
299 | r = 0; | ||
300 | err: | ||
301 | omap_free_dma(lch); | ||
302 | |||
303 | return r; | ||
304 | } | ||
305 | |||
306 | static int _omap_vram_alloc(unsigned pages, unsigned long *paddr) | 252 | static int _omap_vram_alloc(unsigned pages, unsigned long *paddr) |
307 | { | 253 | { |
308 | struct vram_region *rm; | 254 | struct vram_region *rm; |
@@ -337,8 +283,6 @@ found: | |||
337 | 283 | ||
338 | *paddr = start; | 284 | *paddr = start; |
339 | 285 | ||
340 | _omap_vram_clear(start, pages); | ||
341 | |||
342 | return 0; | 286 | return 0; |
343 | } | 287 | } |
344 | 288 | ||