]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00210918-3 elcdif_fb: change update hardware par method.
authorZhang Jiejing <jiejing.zhang@freescale.com>
Mon, 28 May 2012 11:35:46 +0000 (19:35 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:44 +0000 (08:34 +0200)
update the screen var info compare method, it should:
- should update the hardware parameter when  FB_ACTIVATE_FORCE
- use bool as return type.
- return true if the new and old var are same.

Signed-off-by Zhang Jiejing <jiejing.zhang@freescale.com>

drivers/video/mxc/mxc_elcdif_fb.c

index 50c23e4c934857bb1c247f3fefac2a5eec9cb360..d127ff4ca7d6e66e3db26026e08df4f37cfc4665 100644 (file)
@@ -781,17 +781,21 @@ static int mxc_elcdif_fb_setcolreg(u_int regno, u_int red, u_int green,
    parameter for hardware, if it was different parameter, the hardware
    will reinitialize. All will compared except x/y offset.
  */
-static int mxc_fb_par_equal(struct fb_info *fbi, struct mxc_elcdif_fb_data *data)
+static bool mxc_elcdif_fb_par_equal(struct fb_info *fbi, struct mxc_elcdif_fb_data *data)
 {
        /* Here we set the xoffset, yoffset to zero, and compare two
         * var see have different or not. */
        struct fb_var_screeninfo oldvar = data->var;
        struct fb_var_screeninfo newvar = fbi->var;
 
+       if ((fbi->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW &&
+           fbi->var.activate & FB_ACTIVATE_FORCE)
+               return false;
+
        oldvar.xoffset = newvar.xoffset = 0;
        oldvar.yoffset = newvar.yoffset = 0;
 
-       return memcmp(&oldvar, &newvar, sizeof(struct fb_var_screeninfo));
+       return memcmp(&oldvar, &newvar, sizeof(struct fb_var_screeninfo)) == 0;
 }
 
 /*
@@ -809,7 +813,7 @@ static int mxc_elcdif_fb_set_par(struct fb_info *fbi)
        dev_dbg(fbi->device, "Reconfiguring framebuffer\n");
 
        /* If parameter no change, don't reconfigure. */
-       if (mxc_fb_par_equal(fbi, data))
+       if (mxc_elcdif_fb_par_equal(fbi, data))
            return 0;
 
        sema_init(&data->flip_sem, 1);