1.rk3188-lcdc: modify set_par and fix some err 2.rk fb: fix primary lcdc id error
authorzwl <zwl@rockchips.com>
Wed, 19 Mar 2014 14:20:31 +0000 (22:20 +0800)
committerzwl <zwl@rockchips.com>
Wed, 19 Mar 2014 14:20:43 +0000 (22:20 +0800)
drivers/video/rockchip/lcdc/rk3188_lcdc.c
drivers/video/rockchip/rk_fb.c

index 9d27f862fc0653d463f3e3ffe75da2804b552db9..1fad6653c484a8cb6d0c308a6d05d583c3cf91d0 100755 (executable)
@@ -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;
 }
index b8c13328e53493f43dab43d6a8f5d6dd5852ac2f..8fa5b6362e7fdee372fc984bc6f5eb8cb8024d66 100755 (executable)
@@ -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;