From 8fb2012aaa86faa23318f5d87481bea87eb50792 Mon Sep 17 00:00:00 2001 From: hjc Date: Tue, 25 Nov 2014 11:44:25 +0800 Subject: [PATCH] rk312x lcdc: fix fb_par->state error. --- drivers/video/rockchip/lcdc/rk312x_lcdc.c | 6 +++--- drivers/video/rockchip/rk_fb.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) 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: -- 2.34.1