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 8/9] video: Add generic fixup handler to reserve fb memory
Date: Mon,  6 Jul 2015 12:36:13 +0200	[thread overview]
Message-ID: <1436178974-20064-8-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1436178974-20064-1-git-send-email-s.hauer@pengutronix.de>

When a framebuffer is kept enabled when Linux starts its framebuffer
memory should be reserved. Otherwise Linux may overwrite its contents.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/video/fb.c | 21 +++++++++++++++++++++
 include/fb.h       |  1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index e30ab59..931c99c 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -103,6 +103,27 @@ static int fb_setup_mode(struct fb_info *info)
 	return 0;
 }
 
+static int fb_of_reserve_fixup(struct device_node *root, void *context)
+{
+	struct fb_info *info = context;
+
+	if (!info->enabled)
+		return 0;
+
+	of_add_reserve_entry((unsigned long)info->screen_base,
+			(unsigned long)info->screen_base + info->screen_size);
+
+	return 0;
+}
+
+void fb_of_reserve_add_fixup(struct fb_info *info)
+{
+	if (!IS_ENABLED(CONFIG_OFDEVICE))
+		return;
+
+	of_register_fixup(fb_of_reserve_fixup, info);
+}
+
 static int fb_set_modename(struct param_d *param, void *priv)
 {
 	struct fb_info *info = priv;
diff --git a/include/fb.h b/include/fb.h
index 2db6ad6..a693f4b 100644
--- a/include/fb.h
+++ b/include/fb.h
@@ -159,5 +159,6 @@ int fb_register_simplefb(struct fb_info *info);
 int edid_to_display_timings(struct display_timings *, unsigned char *edid);
 void *edid_read_i2c(struct i2c_adapter *adapter);
 void fb_edid_add_modes(struct fb_info *info);
+void fb_of_reserve_add_fixup(struct fb_info *info);
 
 #endif /* __FB_H */
-- 
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 ` [PATCH 4/9] video: stm: use uncached memory Sascha Hauer
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 ` Sascha Hauer [this message]
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-8-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