[PATCH] video: ipufb: Use uncached memory for framebuffer
Sascha Hauer
s.hauer at pengutronix.de
Fri Dec 20 05:33:13 EST 2013
Otherwise funny caching artifacts can occur on the screen.
Signed-off-by: Sascha Hauer <s.hauer at 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
More information about the barebox
mailing list