From 98773c222f1ff3a1cc06bbbffa5a82622f6ccd96 Mon Sep 17 00:00:00 2001 From: ZHW Date: Fri, 23 Aug 2013 11:13:33 +0800 Subject: [PATCH] lcdc: fix vertical screen machine insert hdmi screen flicker. --- drivers/video/rockchip/lcdc/rk3066b_lcdc.c | 46 +++++++++++++++++++++- drivers/video/rockchip/rk_fb.c | 3 +- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/drivers/video/rockchip/lcdc/rk3066b_lcdc.c b/drivers/video/rockchip/lcdc/rk3066b_lcdc.c index e4d863396ff8..25af8678c63e 100755 --- a/drivers/video/rockchip/lcdc/rk3066b_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3066b_lcdc.c @@ -33,8 +33,7 @@ #include #include "rk3066b_lcdc.h" - - +#include "../hdmi/rk_hdmi.h" @@ -1138,6 +1137,42 @@ int rk3066b_lcdc_early_resume(struct rk_lcdc_device_driver *dev_drv) return 0; } + +static int no_report(struct rk3066b_lcdc_device *lcdc_dev) +{ + struct rk_lcdc_device_driver *dev = &(lcdc_dev->driver); + static u32 lcdc0_old_addr = 0,cur_addr = 0; + static u32 mode = 0,num = 0; + static u32 cur_state = 0,old_state = 0; + + if(dev->screen_ctr_info->prop == PRMRY){ + cur_addr = LcdRdReg(lcdc_dev,WIN0_YRGB_MST); + if(lcdc0_old_addr != cur_addr){ + if(cur_state++ > 10000) + cur_state = 0; + + lcdc0_old_addr = cur_addr; + } + } + + if(old_state == cur_state){ + if(num++>10 && mode != 0) + mode = 0; + } + else{ + mode = 1; + num = 0; + } + + if(mode == 1 && old_state == cur_state){ + return -1; + } + + old_state = cur_state; + + return 0; +} + static irqreturn_t rk3066b_lcdc_isr(int irq, void *dev_id) { struct rk3066b_lcdc_device *lcdc_dev = (struct rk3066b_lcdc_device *)dev_id; @@ -1148,6 +1183,13 @@ static irqreturn_t rk3066b_lcdc_isr(int irq, void *dev_id) LcdMskReg(lcdc_dev, INT_STATUS, m_FRM_STARTCLEAR, v_FRM_STARTCLEAR(1)); +#if defined(CONFIG_FB_ROTATE) || !defined(CONFIG_THREE_FB_BUFFER) + if(hdmi_get_hotplug() == HDMI_HPD_ACTIVED){ + if(no_report(lcdc_dev)){ + return IRQ_HANDLED; + } + } +#endif //LcdMskReg(lcdc_dev, INT_STATUS, m_LINE_FLAG_INT_CLEAR, v_LINE_FLAG_INT_CLEAR(1)); #if 0 diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 5d509b100fb8..aecca925d42f 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -403,6 +403,7 @@ static int rk_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) return -EINVAL; } + dev_drv->pan_display(dev_drv,layer_id); #if defined(CONFIG_RK_HDMI) #if defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL) if(hdmi_get_hotplug() == HDMI_HPD_ACTIVED) @@ -424,7 +425,7 @@ static int rk_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) } #endif #endif - dev_drv->pan_display(dev_drv,layer_id); + #ifdef CONFIG_FB_MIRRORING if(video_data_to_mirroring!=NULL) video_data_to_mirroring(info,NULL); -- 2.34.1