From f25987ec712b019fea4af4a2aae62f5855c9866a Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Wed, 6 Jan 2016 15:33:26 +0800 Subject: [PATCH] video: rockchip_fb: synchronous win state We enable win0 for uboot display, but win last_state is 0, when we update win config from config_done ioctl, the state judge is wrong. Change-Id: I9955bed1683586254a908cb9395d27585e234b10 Signed-off-by: Mark Yao --- drivers/video/rockchip/lcdc/rk312x_lcdc.c | 3 +++ drivers/video/rockchip/lcdc/rk3288_lcdc.c | 3 +++ drivers/video/rockchip/lcdc/rk3368_lcdc.c | 3 +++ drivers/video/rockchip/rk_fb.c | 2 ++ 4 files changed, 11 insertions(+) diff --git a/drivers/video/rockchip/lcdc/rk312x_lcdc.c b/drivers/video/rockchip/lcdc/rk312x_lcdc.c index f8cb796a2a4e..c1721b3c4817 100755 --- a/drivers/video/rockchip/lcdc/rk312x_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk312x_lcdc.c @@ -1157,6 +1157,7 @@ static int rk312x_post_dspbuf(struct rk_lcdc_driver *dev_drv, u32 rgb_mst, { struct lcdc_device *lcdc_dev = container_of(dev_drv, struct lcdc_device, driver); + struct rk_lcdc_win *win = dev_drv->win[0]; u32 val, mask; mask = m_WIN0_FORMAT; @@ -1171,6 +1172,8 @@ static int rk312x_post_dspbuf(struct rk_lcdc_driver *dev_drv, u32 rgb_mst, lcdc_writel(lcdc_dev, WIN0_YRGB_MST, rgb_mst); lcdc_cfg_done(lcdc_dev); + win->state = 1; + win->last_state = 1; return 0; } diff --git a/drivers/video/rockchip/lcdc/rk3288_lcdc.c b/drivers/video/rockchip/lcdc/rk3288_lcdc.c index 8cd84a4d984a..a90c8cb00416 100755 --- a/drivers/video/rockchip/lcdc/rk3288_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3288_lcdc.c @@ -1187,6 +1187,7 @@ static int rk3288_post_dspbuf(struct rk_lcdc_driver *dev_drv, u32 rgb_mst, struct lcdc_device *lcdc_dev = container_of(dev_drv, struct lcdc_device, driver); u32 val, mask; + struct rk_lcdc_win *win = dev_drv->win[0]; int swap = (format == RGB888) ? 1 : 0; mask = m_WIN0_DATA_FMT | m_WIN0_RB_SWAP; @@ -1201,6 +1202,8 @@ static int rk3288_post_dspbuf(struct rk_lcdc_driver *dev_drv, u32 rgb_mst, lcdc_writel(lcdc_dev, WIN0_YRGB_MST, rgb_mst); lcdc_cfg_done(lcdc_dev); + win->state = 1; + win->last_state = 1; return 0; } diff --git a/drivers/video/rockchip/lcdc/rk3368_lcdc.c b/drivers/video/rockchip/lcdc/rk3368_lcdc.c index 307c1599abb5..8c47829ba5ef 100644 --- a/drivers/video/rockchip/lcdc/rk3368_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3368_lcdc.c @@ -1835,6 +1835,7 @@ static int rk3368_post_dspbuf(struct rk_lcdc_driver *dev_drv, u32 rgb_mst, struct lcdc_device *lcdc_dev = container_of(dev_drv, struct lcdc_device, driver); u32 val, mask; + struct rk_lcdc_win *win = dev_drv->win[0]; int swap = (format == RGB888) ? 1 : 0; mask = m_WIN0_DATA_FMT | m_WIN0_RB_SWAP | m_WIN0_Y_MIRROR; @@ -1850,6 +1851,8 @@ static int rk3368_post_dspbuf(struct rk_lcdc_driver *dev_drv, u32 rgb_mst, lcdc_writel(lcdc_dev, WIN0_YRGB_MST, rgb_mst); lcdc_cfg_done(lcdc_dev); + win->state = 1; + win->last_state = 1; return 0; } diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 82fa78426fd6..bc1a178160f7 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -3157,6 +3157,8 @@ static int rk_fb_set_par(struct fb_info *info) win->area[0].yvir = var->yres_virtual; win->area[0].xoff = xoffset; win->area[0].yoff = yoffset; + win->state = 1; + win->last_state = 1; win->area_num = 1; win->alpha_mode = 4; /* AB_SRC_OVER; */ -- 2.34.1