mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/9] video: stm: use uncached memory
Date: Mon,  6 Jul 2015 12:36:09 +0200	[thread overview]
Message-ID: <1436178974-20064-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1436178974-20064-1-git-send-email-s.hauer@pengutronix.de>

To avoid caching effects on the display use uncached memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-07-06 10:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 10:36 [PATCH 1/9] video: stm: remove unnecessary info function Sascha Hauer
2015-07-06 10:36 ` [PATCH 2/9] video: stm: copy platform_data to driver data Sascha Hauer
2015-07-06 10:36 ` [PATCH 3/9] video: stm: code buswidth in platform data as decimal Sascha Hauer
2015-07-06 10:36 ` Sascha Hauer [this message]
2015-07-06 10:36 ` [PATCH 5/9] video: stm: read interface width from device tree Sascha Hauer
2015-07-06 10:36 ` [PATCH 6/9] video: stm: read bits-per-pixel " Sascha Hauer
2015-07-06 10:36 ` [PATCH 7/9] video: stm: honor display_flags Sascha Hauer
2015-07-06 10:36 ` [PATCH 8/9] video: Add generic fixup handler to reserve fb memory Sascha Hauer
2015-07-06 10:36 ` [PATCH 9/9] video: stm: reserve framebuffer memory for Linux Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436178974-20064-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox