mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] video: ipufb: Use uncached memory for framebuffer
@ 2013-12-20 10:33 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2013-12-20 10:33 UTC (permalink / raw)
  To: barebox

Otherwise funny caching artifacts can occur on the screen.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/video/imx-ipu-fb.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index 18a7052..7276647 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -26,6 +26,7 @@
 #include <malloc.h>
 #include <errno.h>
 #include <asm-generic/div64.h>
+#include <asm/mmu.h>
 #include <mach/imx-ipu-fb.h>
 #include <linux/clk.h>
 #include <linux/err.h>
@@ -1022,8 +1023,12 @@ static int imxfb_probe(struct device_d *dev)
 	 * memory for screen usage
 	 */
 	fbi->info.screen_base = pdata->framebuffer;
-	if (fbi->info.screen_base == NULL) {
-		fbi->info.screen_base = malloc(fbi->info.screen_size);
+	if (fbi->info.screen_base) {
+		remap_range(fbi->info.screen_base,
+			fbi->info.screen_size,
+			mmu_get_pte_uncached_flags());
+	} else {
+		fbi->info.screen_base = dma_alloc_coherent(fbi->info.screen_size);
 		if (!fbi->info.screen_base)
 			return -ENOMEM;
 	}
-- 
1.8.5.1


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-20 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-20 10:33 [PATCH] video: ipufb: Use uncached memory for framebuffer Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox