lcdc: fix vertical screen machine insert hdmi screen flicker.
authorZHW <zhw@rock-chips.com>
Fri, 23 Aug 2013 03:13:33 +0000 (11:13 +0800)
committerZHW <zhw@rock-chips.com>
Fri, 23 Aug 2013 03:13:33 +0000 (11:13 +0800)
drivers/video/rockchip/lcdc/rk3066b_lcdc.c
drivers/video/rockchip/rk_fb.c

index e4d863396ff8dea59953a79018dadc84fa58fda3..25af8678c63e29f5c02e33b2a0409fcbf42cbd85 100755 (executable)
@@ -33,8 +33,7 @@
 #include <mach/iomux.h>
 
 #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
index 5d509b100fb89072955deb3c28762c5ef0256342..aecca925d42f6fc097f0cd1e8599def8ae20417f 100755 (executable)
@@ -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);