MLK-13722-3 video: mxsfb: add more sanity check on overlayfb_check_var()
authorFancy Fang <chen.fang@nxp.com>
Thu, 5 Jan 2017 09:00:37 +0000 (17:00 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:58:18 +0000 (14:58 -0500)
The overlay function of LCDIF only support when the bpp of fb0
and fb1 are the same. So add this check on overlayfb_check_var().

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
drivers/video/fbdev/mxsfb.c

index 84a2f15..e76bb31 100644 (file)
@@ -1714,6 +1714,10 @@ static int overlayfb_check_var(struct fb_var_screeninfo *var,
        struct mxsfb_info *fbi  = ofb->fbi;
        const struct fb_bitfield *rgb = NULL;
 
+       /* lcdif doesn't support different bpp of AS and PS */
+       if (var->bits_per_pixel != fbi->fb_info->var.bits_per_pixel)
+               return -EINVAL;
+
        /* overlay width & should be equal to fb0 */
        if ((var->xres != fbi->fb_info->var.xres) ||
            (var->yres != fbi->fb_info->var.yres))