MLK-12142 video: fbdev: mxc_ipuv3_fb: Set non-zero blank to FB_BLANK_POWERDOWN
authorLiu Ying <victor.liu@nxp.com>
Mon, 11 Jan 2016 02:51:21 +0000 (10:51 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:42 +0000 (14:49 -0500)
We have implemented only two states for blank which are FB_BLANK_UNBLANK and
FB_BLANK_POWERDOWN.  Let's map all the other blank states(FB_BLANK_NORMAL,
FB_BLANK_VSYNC_SUSPEND and FB_BLANK_HSYNC_SUSPEND) to FB_BLANK_POWERDOWN,
since all of them make the screen be blanked.  This may avoid blanking a blanked
screen by setting the state to different non-zero values.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/video/fbdev/mxc/mxc_ipuv3_fb.c

index 5535138..e61ef67 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2015 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2016 Freescale Semiconductor, Inc. All Rights Reserved.
  */
 
 /*
@@ -2313,16 +2313,19 @@ static int mxcfb_blank(int blank, struct fb_info *info)
 
        dev_dbg(info->device, "blank = %d\n", blank);
 
+       if (blank)
+               blank = FB_BLANK_POWERDOWN;
+
        if (mxc_fbi->cur_blank == blank)
                return 0;
 
        mxc_fbi->next_blank = blank;
 
-       switch (blank) {
-       case FB_BLANK_POWERDOWN:
-       case FB_BLANK_VSYNC_SUSPEND:
-       case FB_BLANK_HSYNC_SUSPEND:
-       case FB_BLANK_NORMAL:
+       if (blank == FB_BLANK_UNBLANK) {
+               info->var.activate = (info->var.activate & ~FB_ACTIVATE_MASK) |
+                               FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
+               ret = fb_set_var(info, &info->var);
+       } else {
                if (mxc_fbi->dispdrv && mxc_fbi->dispdrv->drv->disable)
                        mxc_fbi->dispdrv->drv->disable(mxc_fbi->dispdrv, info);
                ipu_disable_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch, true);
@@ -2334,12 +2337,6 @@ static int mxcfb_blank(int blank, struct fb_info *info)
                        ipu_pre_disable(mxc_fbi->pre_num);
                        ipu_pre_free(&mxc_fbi->pre_num);
                }
-               break;
-       case FB_BLANK_UNBLANK:
-               info->var.activate = (info->var.activate & ~FB_ACTIVATE_MASK) |
-                               FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
-               ret = fb_set_var(info, &info->var);
-               break;
        }
        if (!ret)
                mxc_fbi->cur_blank = blank;