aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index f99e2ee16ce..2bd90ca93d6 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1905,9 +1905,11 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev)
static void size_notify(struct fb_info *fbi, int w, int h)
{
+ struct omapfb_info *ofbi = FB2OFB(fbi);
struct fb_var_screeninfo var = fbi->var;
struct fb_var_screeninfo saved_var = fbi->var;
int orig_flags;
+ int new_size = (w * var.bits_per_pixel >> 3) * h;
DBG("size_notify: %dx%d\n", w, h);
@@ -1919,6 +1921,14 @@ static void size_notify(struct fb_info *fbi, int w, int h)
console_lock();
+ /* Try to increase memory allocated for FB, if needed */
+ if (new_size > ofbi->region->size) {
+ DBG("re-allocating FB - old size: %ld - new size: %d\n", ofbi->region->size, new_size);
+ omapfb_get_mem_region(ofbi->region);
+ omapfb_realloc_fbmem(fbi, new_size, 0);
+ omapfb_put_mem_region(ofbi->region);
+ }
+
/* this ensures fbdev clients, like the console driver, get notified about
* the change:
*/