From: zwl Date: Thu, 8 May 2014 07:49:36 +0000 (+0800) Subject: rk fb: fix fb open fail when sometimes hdmi insert X-Git-Tag: firefly_0821_release~5330 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=50f1ce8f66a5f97359c4a840b8f48b277410c011;p=firefly-linux-kernel-4.4.55.git rk fb: fix fb open fail when sometimes hdmi insert --- diff --git a/drivers/video/rockchip/hdmi/rk_hdmi_task.c b/drivers/video/rockchip/hdmi/rk_hdmi_task.c index 9d5c585f1500..135688f8ecbf 100755 --- a/drivers/video/rockchip/hdmi/rk_hdmi_task.c +++ b/drivers/video/rockchip/hdmi/rk_hdmi_task.c @@ -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 { diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index e22684a7e822..272543bfa89b 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -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;