diff options
author | Ed Nash <enash54@gmail.com> | 2013-04-26 07:24:20 -0400 |
---|---|---|
committer | Ed Nash <enash54@gmail.com> | 2013-04-26 07:24:20 -0400 |
commit | f9ca3cb28917cd3e60eb45882fc9320d8424e4f3 (patch) | |
tree | 7e842ab3547f6e4d9e2e191e47f21a87da1ed651 | |
parent | 3f9ca1a36347c86266f65a654f0f71799540554b (diff) |
use dma bufeers rather than kmalloc buffers to make sure coherent ram between cpu and dcu. This showed up when painting a large bootlogo. holes would appear and then fill in as the boot progressed.
-rw-r--r-- | drivers/video/mvf_dcu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/mvf_dcu.c b/drivers/video/mvf_dcu.c index d9fc6fa664c7..036097b77fcb 100644 --- a/drivers/video/mvf_dcu.c +++ b/drivers/video/mvf_dcu.c @@ -32,6 +32,7 @@ #include <asm/mach-types.h> #include <mach/mvf.h> #include <mach/mvf-dcu-fb.h> +#include <linux/dma-mapping.h> #define DRIVER_NAME "mvf-dcu" @@ -430,15 +431,16 @@ static void update_lcdc(struct fb_info *info) static int map_video_memory(struct fb_info *info) { + dma_addr_t dma_handle; u32 smem_len = info->fix.line_length * info->var.yres_virtual; - info->screen_base = kzalloc(smem_len, GFP_KERNEL); + info->screen_base = dma_alloc_coherent(NULL, smem_len, &dma_handle, GFP_KERNEL); if (info->screen_base == NULL) { printk(KERN_ERR "Unable to allocate fb memory\n"); return -ENOMEM; } mutex_lock(&info->mm_lock); - info->fix.smem_start = virt_to_phys(info->screen_base); + info->fix.smem_start = dma_handle; info->fix.smem_len = smem_len; mutex_unlock(&info->mm_lock); info->screen_size = info->fix.smem_len; @@ -449,6 +451,8 @@ static int map_video_memory(struct fb_info *info) static void unmap_video_memory(struct fb_info *info) { mutex_lock(&info->mm_lock); + if(info->screen_base) + dma_free_coherent(NULL, info->fix.smem_len, info->screen_base, info->fix.smem_start); info->screen_base = NULL; info->fix.smem_start = 0; info->fix.smem_len = 0; |