From 1e333c9d71d1cd5d17ac532f6984424a64b68d80 Mon Sep 17 00:00:00 2001 From: zwl Date: Wed, 19 Mar 2014 22:20:31 +0800 Subject: [PATCH] 1.rk3188-lcdc: modify set_par and fix some err 2.rk fb: fix primary lcdc id error --- drivers/video/rockchip/lcdc/rk3188_lcdc.c | 11 ++++++++--- drivers/video/rockchip/rk_fb.c | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/video/rockchip/lcdc/rk3188_lcdc.c b/drivers/video/rockchip/lcdc/rk3188_lcdc.c index 9d27f862fc06..1fad6653c484 100755 --- a/drivers/video/rockchip/lcdc/rk3188_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3188_lcdc.c @@ -838,7 +838,8 @@ static int win0_set_par(struct lcdc_device *lcdc_dev, lcdc_writel(lcdc_dev, WIN0_DSP_INFO,v_DSP_WIDTH(win->area[0].xsize) | v_DSP_HEIGHT(win->area[0].ysize)); lcdc_msk_reg(lcdc_dev, WIN_VIR, m_WIN0_VIR, v_WIN0_VIR_VAL(win->area[0].y_vir_stride)); - lcdc_msk_reg(lcdc_dev, SYS_CTRL, m_WIN0_RB_SWAP, v_WIN0_RB_SWAP(win->swap_rb)); + lcdc_msk_reg(lcdc_dev, SYS_CTRL, m_WIN0_EN | m_WIN0_RB_SWAP, + v_WIN0_EN(win->state) | v_WIN0_RB_SWAP(win->swap_rb)); lcdc_msk_reg(lcdc_dev, WIN0_COLOR_KEY, m_COLOR_KEY_EN, v_COLOR_KEY_EN(0)); } spin_unlock(&lcdc_dev->reg_lock); @@ -895,9 +896,10 @@ static int win1_set_par(struct lcdc_device *lcdc_dev, win->fmt_cfg = fmt_cfg; if (likely(lcdc_dev->clk_on)) { lcdc_writel(lcdc_dev, WIN1_DSP_INFO,v_DSP_WIDTH(win->area[0].xsize) | - v_DSP_HEIGHT(win->area[1].ysize)); + v_DSP_HEIGHT(win->area[0].ysize)); lcdc_writel(lcdc_dev, WIN1_DSP_ST,v_DSP_STX(xpos) | v_DSP_STY(ypos)); - lcdc_msk_reg(lcdc_dev, SYS_CTRL,m_WIN1_RB_SWAP, v_WIN1_RB_SWAP(win->swap_rb)); + lcdc_msk_reg(lcdc_dev, SYS_CTRL, m_WIN1_EN | m_WIN1_RB_SWAP, + v_WIN1_EN(win->state) | v_WIN1_RB_SWAP(win->swap_rb)); lcdc_msk_reg(lcdc_dev, SYS_CTRL,m_WIN1_FORMAT, v_WIN1_FORMAT(fmt_cfg)); lcdc_msk_reg(lcdc_dev, WIN_VIR, m_WIN1_VIR, ((win->area[0].y_vir_stride)&0x1fff)<<16); } @@ -929,6 +931,9 @@ static int rk3188_lcdc_set_par(struct rk_lcdc_driver *dev_drv,int win_id) return -EINVAL; } + if (lcdc_dev->clk_on) { + rk3188_lcdc_alpha_cfg(lcdc_dev); + } return 0; } diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index b8c13328e534..8fa5b6362e7f 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -2645,7 +2645,6 @@ static int init_lcdc_device_driver(struct rk_fb *rk_fb, screen->screen_id = 0; screen->lcdc_id = dev_drv->id; - rk_fb_set_prmry_screen(screen); dev_drv->screen0 = screen; dev_drv->cur_screen = screen; /* devie use one lcdc + rk61x scaler for dual display*/ @@ -2669,8 +2668,10 @@ static int init_lcdc_device_driver(struct rk_fb *rk_fb, dev_drv->ops->fb_win_remap(dev_drv, FB_DEFAULT_ORDER); dev_drv->first_frame = 1; rk_disp_pwr_ctr_parse_dt(dev_drv); - if (dev_drv->prop == PRMRY) + if (dev_drv->prop == PRMRY) { + rk_fb_set_prmry_screen(screen); rk_fb_get_prmry_screen(screen); + } dev_drv->trsm_ops = rk_fb_trsm_ops_get(screen->type); return 0; -- 2.34.1