From: hjc Date: Tue, 25 Nov 2014 03:44:25 +0000 (+0800) Subject: rk312x lcdc: fix fb_par->state error. X-Git-Tag: firefly_0821_release~4448 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8fb2012aaa86faa23318f5d87481bea87eb50792;p=firefly-linux-kernel-4.4.55.git rk312x lcdc: fix fb_par->state error. --- diff --git a/drivers/video/rockchip/lcdc/rk312x_lcdc.c b/drivers/video/rockchip/lcdc/rk312x_lcdc.c index a7076a3d86cf..66795a6e36b6 100755 --- a/drivers/video/rockchip/lcdc/rk312x_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk312x_lcdc.c @@ -531,9 +531,9 @@ static void lcdc_layer_enable(struct lcdc_device *lcdc_dev, unsigned int win_id, "wakeup from standby!\n"); lcdc_dev->standby = 0; } - lcdc_dev->atv_layer_cnt++; - } else if ((lcdc_dev->atv_layer_cnt > 0) && (!open)) { - lcdc_dev->atv_layer_cnt--; + lcdc_dev->atv_layer_cnt |= (1 << win_id); + } else if ((lcdc_dev->atv_layer_cnt & (1 << win_id)) && (!open)) { + lcdc_dev->atv_layer_cnt &= ~(1 << win_id); } lcdc_dev->driver.win[win_id]->state = open; if (!open) { diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 78ccdba29fff..e707198ea448 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -2707,6 +2707,10 @@ static int rk_fb_ioctl(struct fb_info *info, unsigned int cmd, case RK_FBIOSET_ENABLE: if (copy_from_user(&enable, argp, sizeof(enable))) return -EFAULT; + if (enable) + fb_par->state++; + else + fb_par->state--; dev_drv->ops->open(dev_drv, win_id, enable); break; case RK_FBIOGET_ENABLE: