From f3e3ad8414effd8c09c6d6595c9980bc2ccff644 Mon Sep 17 00:00:00 2001 From: Adrian Salido-Moreno Date: Mon, 27 Jul 2015 17:22:23 -0700 Subject: [PATCH] msm: mdss: fb: remove check for allocated during resolution switch While switching resolution the fb memory requirement may increase and the current memory may not be able to support the new resolution. However since we can still go through overlay path, this requirement shouldn't be mandatory. Allow it to go through, there are enough checks during mmap to fail if trying to use this memory. Change-Id: I76aafecd568763c456ea75234582b8a7aa9f83f4 Signed-off-by: Adrian Salido-Moreno --- drivers/video/fbdev/msm/mdss_fb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c index 3d5383b70eae..9d673f3637f9 100644 --- a/drivers/video/fbdev/msm/mdss_fb.c +++ b/drivers/video/fbdev/msm/mdss_fb.c @@ -3354,13 +3354,6 @@ static int mdss_fb_check_var(struct fb_var_screeninfo *var, if ((var->xres_virtual <= 0) || (var->yres_virtual <= 0)) return -EINVAL; - if (info->fix.smem_start) { - u32 len = var->xres_virtual * var->yres_virtual * - (var->bits_per_pixel / 8); - if (len > info->fix.smem_len) - return -EINVAL; - } - if ((var->xres == 0) || (var->yres == 0)) return -EINVAL; @@ -3450,8 +3443,10 @@ static int mdss_fb_set_par(struct fb_info *info) else mfd->fbi->fix.line_length = var->xres * var->bits_per_pixel / 8; - mfd->fbi->fix.smem_len = PAGE_ALIGN(mfd->fbi->fix.line_length * - mfd->fbi->var.yres) * mfd->fb_page; + /* if memory is not allocated yet, change memory size for fb */ + if (!info->fix.smem_start) + mfd->fbi->fix.smem_len = PAGE_ALIGN(mfd->fbi->fix.line_length * + mfd->fbi->var.yres) * mfd->fb_page; if (mfd->panel_reconfig || (mfd->fb_imgType != old_imgType)) { mdss_fb_blank_sub(FB_BLANK_POWERDOWN, info, mfd->op_enable);