[PATCH 4/9] video: stm: use uncached memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To avoid caching effects on the display use uncached memory.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/video/stm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/video/stm.c b/drivers/video/stm.c
index 92bff9c..c825092 100644
--- a/drivers/video/stm.c
+++ b/drivers/video/stm.c
@@ -24,6 +24,8 @@
 #include <errno.h>
 #include <xfuncs.h>
 #include <io.h>
+#include <dma.h>
+#include <asm/mmu.h>
 #include <stmp-device.h>
 #include <linux/clk.h>
 #include <linux/err.h>
@@ -329,8 +331,13 @@ static int stmfb_activate_var(struct fb_info *fb_info)
 			return -ENOMEM;
 		fb_info->screen_base = fbi->fixed_screen;
 		fbi->memory_size = fbi->fixed_screen_size;
+		remap_range(fbi->fixed_screen,
+				fbi->fixed_screen_size,
+				mmu_get_pte_uncached_flags());
 	} else {
-		fb_info->screen_base = xrealloc(fb_info->screen_base, size);
+		fb_info->screen_base = dma_alloc_coherent(size, NULL);
+		if (!fb_info->screen_base)
+			return -ENOMEM;
 		fbi->memory_size = size;
 	}
 
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux