From f7681daed30676ee1d60bda60697472c67448673 Mon Sep 17 00:00:00 2001 From: yxj Date: Fri, 22 Feb 2013 15:15:06 +0800 Subject: [PATCH] rk fb:add config done in rk_fb_switch_screen --- drivers/video/rockchip/lcdc/rk3188_lcdc.c | 24 ++++++++++++----------- drivers/video/rockchip/rk_fb.c | 4 ++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/video/rockchip/lcdc/rk3188_lcdc.c b/drivers/video/rockchip/lcdc/rk3188_lcdc.c index 9250cf13fbb2..c6b6aa667a2f 100644 --- a/drivers/video/rockchip/lcdc/rk3188_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3188_lcdc.c @@ -891,20 +891,22 @@ static int rk3188_lcdc_ioctl(struct rk_lcdc_device_driver *dev_drv, unsigned int return -EFAULT; break; case RK_FBIOSET_CONFIG_DONE: - if (copy_from_user(&(dev_drv->wait_fs),argp,sizeof(dev_drv->wait_fs))) - return -EFAULT; rk3188_lcdc_alpha_cfg(lcdc_dev); lcdc_cfg_done(lcdc_dev); - if(dev_drv->wait_fs) - { - spin_lock_irqsave(&dev_drv->cpl_lock,flags); - init_completion(&dev_drv->frame_done); - spin_unlock_irqrestore(&dev_drv->cpl_lock,flags); - timeout = wait_for_completion_timeout(&dev_drv->frame_done,msecs_to_jiffies(dev_drv->cur_screen->ft+5)); - if(!timeout&&(!dev_drv->frame_done.done)) + + if (!copy_from_user(&(dev_drv->wait_fs),argp,sizeof(dev_drv->wait_fs))) + { + if(dev_drv->wait_fs) { - printk(KERN_ERR "wait for new frame start time out!\n"); - return -ETIMEDOUT; + spin_lock_irqsave(&dev_drv->cpl_lock,flags); + init_completion(&dev_drv->frame_done); + spin_unlock_irqrestore(&dev_drv->cpl_lock,flags); + timeout = wait_for_completion_timeout(&dev_drv->frame_done,msecs_to_jiffies(dev_drv->cur_screen->ft+5)); + if(!timeout&&(!dev_drv->frame_done.done)) + { + printk(KERN_ERR "wait for new frame start time out!\n"); + return -ETIMEDOUT; + } } } break; diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index cba24a488c53..328e632ce679 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -745,7 +745,7 @@ int rk_fb_switch_screen(rk_screen *screen ,int enable ,int lcdc_id) } #endif - printk("hdmi connect to lcdc%d\n",dev_drv->id); + printk("hdmi %s lcdc%d\n",enable?"connect to":"remove from",dev_drv->id); if(inf->num_lcdc == 1) { @@ -858,7 +858,7 @@ int rk_fb_switch_screen(rk_screen *screen ,int enable ,int lcdc_id) #elif defined(CONFIG_ONE_LCDC_DUAL_OUTPUT_INF) info->fbops->fb_pan_display(hdmi_var,info); #endif - + info->fbops->fb_ioctl(info,RK_FBIOSET_CONFIG_DONE,NULL); #if defined(CONFIG_NO_DUAL_DISP) //close backlight for device whic do not support dual display if(!enable) rk29_backlight_set(1); -- 2.34.1