diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-14 20:01:14 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-19 09:31:31 +0100 |
commit | cd735df72c962450e67189482eb8c19c21db5f6f (patch) | |
tree | 020f5935530e42cf9dbde47cf8f156df31742a7b /drivers/video | |
parent | 7b2e36e199846ee7e72f47a921cfa8f1a8dc2546 (diff) | |
download | barebox-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>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/stm.c | 11 |
1 files changed, 9 insertions, 2 deletions
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! */ |