rk fb: fix fb open fail when sometimes hdmi insert
authorzwl <zwl@rock-chips.com>
Thu, 8 May 2014 07:49:36 +0000 (15:49 +0800)
committerzwl <zwl@rock-chips.com>
Thu, 8 May 2014 07:50:47 +0000 (15:50 +0800)
drivers/video/rockchip/hdmi/rk_hdmi_task.c
drivers/video/rockchip/rk_fb.c

index 9d5c585f15005f08ab427501cbfc96437e118193..135688f8ecbfaf2211b9b6dbe937cebdd5194944 100755 (executable)
@@ -192,8 +192,8 @@ void hdmi_work(struct work_struct *work)
                        hdmi->state = READ_PARSE_EDID;
                }
                else if(hdmi->hotplug == HDMI_HPD_ACTIVED) {
-                       hdmi_sys_remove(hdmi);
                        hdmi->hotplug = hotplug;
+                       hdmi_sys_remove(hdmi);
                        if(hotplug == HDMI_HPD_REMOVED)
                                hdmi_sys_sleep(hdmi);
                        else {
index e22684a7e822f71b2b4e53703ef25931c6abbfbd..272543bfa89b5a768e4a54af5029c92253af6fda 100755 (executable)
@@ -928,7 +928,6 @@ static int rk_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info
 
        win->area[0].smem_start = fix->smem_start;
        win->area[0].cbr_start = fix->mmio_start;//fix->smem_start + xvir * yvir;
-       win->state=1;
        win->area[0].state=1;
        win->area_num = 1;
        
@@ -1151,7 +1150,8 @@ static void rk_fb_update_reg(struct rk_lcdc_driver * dev_drv,struct rk_fb_reg_da
        }
        dev_drv->ops->ovl_mgr(dev_drv, 0, 1);
 
-       if (rk_fb->disp_mode == DUAL && hdmi_switch_complete) {
+       if ((rk_fb->disp_mode == DUAL) && (hdmi_get_hotplug() == HDMI_HPD_ACTIVED)
+                                                       && hdmi_switch_complete) {
                for (i = 0; i < rk_fb->num_lcdc; i++) {
                        if(rk_fb->lcdc_dev_drv[i]->prop == EXTEND) {
                                ext_dev_drv = rk_fb->lcdc_dev_drv[i];
@@ -2221,7 +2221,6 @@ if (rk_fb->disp_mode != DUAL) {
        win->area[0].yact = var->yres;
        win->area[0].xvir =  var->xres_virtual;    /*virtual resolution  stride --->LCDC_WINx_VIR*/
        win->area[0].yvir =  var->yres_virtual;
-       win->state=1;
        win->area[0].state=1;
        win->area_num = 1;
        win->alpha_mode = 4;//AB_SRC_OVER;
@@ -2267,7 +2266,6 @@ if (rk_fb->disp_mode != DUAL) {
                                extend_win->area[0].smem_start = win->area[0].smem_start;
                                extend_win->area[0].cbr_start = win->area[0].cbr_start;
                        #endif
-                               extend_win->state = 1;
                                extend_win->area[0].state = 1;
                                extend_win->area_num = 1;
                                extend_win->alpha_en = 0;