rk30 lcdc:support ioctl RK_FBIOPUT_COLOR_KEY_CFG
authoryxj <yxj@rock-chips.com>
Fri, 15 Mar 2013 03:53:08 +0000 (11:53 +0800)
committeryxj <yxj@rock-chips.com>
Fri, 15 Mar 2013 03:53:22 +0000 (11:53 +0800)
drivers/video/rockchip/lcdc/rk30_lcdc.c

index 0c30fb026d57b9b6bfe523f25bb21352dad9593e..f9c4ce8f3bc3d436333e8f8bc961a5905a8f06a5 100644 (file)
@@ -552,8 +552,8 @@ static  int win0_set_par(struct rk30_lcdc_device *lcdc_dev,rk_screen *screen,
                lcdc_writel(lcdc_dev, WIN0_ACT_INFO,v_ACT_WIDTH(xact) | v_ACT_HEIGHT(yact));
                lcdc_writel(lcdc_dev, WIN0_DSP_ST, v_DSP_STX(xpos) | v_DSP_STY(ypos));
                lcdc_writel(lcdc_dev, WIN0_DSP_INFO, v_DSP_WIDTH(par->xsize)| v_DSP_HEIGHT(par->ysize));
-               lcdc_msk_reg(lcdc_dev, WIN0_COLOR_KEY_CTRL, m_COLORKEY_EN | m_KEYCOLOR,
-                       v_COLORKEY_EN(1) | v_KEYCOLOR(0));
+               //lcdc_msk_reg(lcdc_dev, WIN0_COLOR_KEY_CTRL, m_COLORKEY_EN | m_KEYCOLOR,
+               //      v_COLORKEY_EN(1) | v_KEYCOLOR(0));
                switch(par->format) 
                {
                        case XBGR888:
@@ -660,7 +660,7 @@ static int win1_set_par(struct rk30_lcdc_device *lcdc_dev,rk_screen *screen,
                lcdc_writel(lcdc_dev, WIN1_DSP_ST,v_DSP_STX(xpos) | v_DSP_STY(ypos));
                lcdc_writel(lcdc_dev, WIN1_DSP_INFO,v_DSP_WIDTH(par->xsize) | v_DSP_HEIGHT(par->ysize));
                // enable win1 color key and set the color to black(rgb=0)
-               lcdc_msk_reg(lcdc_dev, WIN1_COLOR_KEY_CTRL, m_COLORKEY_EN | m_KEYCOLOR,v_COLORKEY_EN(1) | v_KEYCOLOR(0));
+               //lcdc_msk_reg(lcdc_dev, WIN1_COLOR_KEY_CTRL, m_COLORKEY_EN | m_KEYCOLOR,v_COLORKEY_EN(1) | v_KEYCOLOR(0));
                switch(par->format)
                {
                        case XBGR888:
@@ -726,7 +726,7 @@ static int win2_set_par(struct rk30_lcdc_device *lcdc_dev,rk_screen *screen,
                lcdc_writel(lcdc_dev, WIN2_DSP_ST,v_DSP_STX(xpos) | v_DSP_STY(ypos));
                lcdc_writel(lcdc_dev, WIN2_DSP_INFO,v_DSP_WIDTH(par->xsize) | v_DSP_HEIGHT(par->ysize));
                // enable win1 color key and set the color to black(rgb=0)
-               lcdc_msk_reg(lcdc_dev, WIN2_COLOR_KEY_CTRL, m_COLORKEY_EN | m_KEYCOLOR,v_COLORKEY_EN(1) | v_KEYCOLOR(0));
+               //lcdc_msk_reg(lcdc_dev, WIN2_COLOR_KEY_CTRL, m_COLORKEY_EN | m_KEYCOLOR,v_COLORKEY_EN(1) | v_KEYCOLOR(0));
                switch(par->format)
                {
                        case XBGR888:
@@ -910,6 +910,7 @@ int rk30_lcdc_ioctl(struct rk_lcdc_device_driver * dev_drv,unsigned int cmd, uns
        void __user *argp = (void __user *)arg;
        int ret = 0;
        int enable;
+       struct color_key_cfg clr_key_cfg;
        switch(cmd)
        {
                case RK_FBIOGET_PANEL_SIZE:    //get panel size
@@ -918,6 +919,13 @@ int rk30_lcdc_ioctl(struct rk_lcdc_device_driver * dev_drv,unsigned int cmd, uns
                        if(copy_to_user(argp, panel_size, 8)) 
                                return -EFAULT;
                        break;
+               case RK_FBIOPUT_COLOR_KEY_CFG:
+                       if(copy_from_user(&clr_key_cfg,argp,sizeof(struct color_key_cfg ))) 
+                               return -EFAULT;
+                       lcdc_writel(lcdc_dev,WIN0_COLOR_KEY_CTRL,clr_key_cfg.win0_color_key_cfg);
+                       lcdc_writel(lcdc_dev,WIN1_COLOR_KEY_CTRL,clr_key_cfg.win1_color_key_cfg);
+                       lcdc_writel(lcdc_dev,WIN2_COLOR_KEY_CTRL,clr_key_cfg.win2_color_key_cfg);
+                       break;
                default:
                        break;
        }