when display the image by direct fb, there is screen tearing, could i eliminate it by open the vsync, open it will call the code below code in kernel ?
int tegra_dc_wait_for_vsync(struct tegra_dc dc)
{
unsigned long timeout_ms;
unsigned long refresh; / in 1000th Hz */
int ret;
mutex_lock(&dc->lp_lock);
mutex_lock(&dc->lock);
if (!dc->enabled) {
ret = -ENOTTY;
goto out;
}
refresh = tegra_dc_calc_refresh(&dc->mode);
/* time out if waiting took more than 2 frames */
timeout_ms = DIV_ROUND_UP(2 * 1000000, refresh);
_tegra_dc_user_vsync_enable(dc, true);
mutex_unlock(&dc->lock);
ret = wait_for_completion_interruptible_timeout(
&dc->out->user_vblank_comp, msecs_to_jiffies(timeout_ms));
mutex_lock(&dc->lock);
_tegra_dc_user_vsync_enable(dc, false);
out:
mutex_unlock(&dc->lock);
mutex_unlock(&dc->lp_lock);
return ret;
}