summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-01-14 20:01:14 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-19 09:31:31 +0100
commitcd735df72c962450e67189482eb8c19c21db5f6f (patch)
tree020f5935530e42cf9dbde47cf8f156df31742a7b
parent7b2e36e199846ee7e72f47a921cfa8f1a8dc2546 (diff)
downloadbarebox-cd735df72c962450e67189482eb8c19c21db5f6f.tar.gz
barebox-cd735df72c962450e67189482eb8c19c21db5f6f.tar.xz
video stm/mx2x: allow to pass in fb memory from platform data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-stm/include/mach/fb.h3
-rw-r--r--drivers/video/stm.c11
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/mach-stm/include/mach/fb.h b/arch/arm/mach-stm/include/mach/fb.h
index 65e3be226b..2eade76eb2 100644
--- a/arch/arm/mach-stm/include/mach/fb.h
+++ b/arch/arm/mach-stm/include/mach/fb.h
@@ -37,6 +37,9 @@ struct imx_fb_videomode {
unsigned dotclk_delay; /**< refer manual HW_LCDIF_VDCTRL4 register */
unsigned ld_intf_width; /**< refer STMLCDIF_* macros */
+
+ void *fixed_screen; /**< if != NULL use this as framebuffer memory */
+ unsigned fixed_screen_size; /**< framebuffer memory size for fixed_screen */
};
#endif /* __MACH_FB_H */
diff --git a/drivers/video/stm.c b/drivers/video/stm.c
index d2add4183b..fc90b6a912 100644
--- a/drivers/video/stm.c
+++ b/drivers/video/stm.c
@@ -298,8 +298,15 @@ static int stmfb_activate_var(struct fb_info *fb_info)
size = calc_line_length(mode->xres, fb_info->bits_per_pixel) *
mode->yres;
- fb_info->screen_base = xrealloc(fb_info->screen_base, size);
- fbi->memory_size = size;
+ if (pdata->fixed_screen) {
+ if (pdata->fixed_screen_size < size)
+ return -ENOMEM;
+ fb_info->screen_base = pdata->fixed_screen;
+ fbi->memory_size = pdata->fixed_screen_size;
+ } else {
+ fb_info->screen_base = xrealloc(fb_info->screen_base, size);
+ fbi->memory_size = size;
+ }
/** @todo ensure HCLK is active at this point of time! */