From f9ca3cb28917cd3e60eb45882fc9320d8424e4f3 Mon Sep 17 00:00:00 2001 From: Ed Nash Date: Fri, 26 Apr 2013 07:24:20 -0400 Subject: 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. --- drivers/video/mvf_dcu.c | 8 ++++++-- 1 file 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 #include #include +#include #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; -- cgit v1.2.3