rk_fb: wait extend lcdc vsync before release fence
authorMark Yao <mark.yao@rock-chips.com>
Mon, 17 Nov 2014 01:18:42 +0000 (09:18 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Mon, 17 Nov 2014 01:41:54 +0000 (09:41 +0800)
before release fence, we should make sure extend lcdc config take
effect. if not, maybe GPU would access the buffer which hdmi using,
and cause tearing.

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/video/rockchip/rk_fb.c

index 74b870c80bebe510b148a1519f2fc5b4d7703372..78ccdba29fffb7a50b451315740bb6b7af5ed6b3 100755 (executable)
@@ -1998,6 +1998,19 @@ ext_win_exit:
                timeout = wait_event_interruptible_timeout(dev_drv->vsync_info.wait,
                                ktime_compare(dev_drv->vsync_info.timestamp, timestamp) > 0,
                                msecs_to_jiffies(25));
+               if ((rk_fb->disp_mode == DUAL) &&
+                   (hdmi_get_hotplug() == HDMI_HPD_ACTIVED) &&
+                   hdmi_switch_complete) {
+                       /*
+                        * If dual output, we need make sure the extend display
+                        * cfg take effect before release fence.
+                        */
+                       ext_dev_drv = rk_get_extend_lcdc_drv();
+                       timeout = wait_event_interruptible_timeout(ext_dev_drv->vsync_info.wait,
+                                       ktime_compare(ext_dev_drv->vsync_info.timestamp, timestamp) > 0,
+                                       msecs_to_jiffies(25));
+               }
+
                dev_drv->ops->get_dsp_addr(dev_drv, dsp_addr);
                wait_for_vsync = false;
                for (i = 0; i < dev_drv->lcdc_win_num; i++) {