From: Mark Yao Date: Mon, 17 Nov 2014 01:18:42 +0000 (+0800) Subject: rk_fb: wait extend lcdc vsync before release fence X-Git-Tag: firefly_0821_release~4470 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=374968b424420234c93ddd8a86d67077f8af3444;p=firefly-linux-kernel-4.4.55.git rk_fb: wait extend lcdc vsync before release fence 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 --- diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 74b870c80beb..78ccdba29fff 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -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++) {