diff --git a/techpack/display/msm/sde/sde_hw_intf.c b/techpack/display/msm/sde/sde_hw_intf.c index 925db925364a..83b3971427d8 100644 --- a/techpack/display/msm/sde/sde_hw_intf.c +++ b/techpack/display/msm/sde/sde_hw_intf.c @@ -565,8 +565,6 @@ static int sde_hw_intf_setup_te_config(struct sde_hw_intf *intf, * less than 2^16 vsync clk cycles. */ spin_lock(&tearcheck_spinlock); - SDE_REG_WRITE(c, INTF_TEAR_SYNC_WRCOUNT, - (te->start_pos + te->sync_threshold_start + 1)); SDE_REG_WRITE(c, INTF_TEAR_SYNC_CONFIG_VSYNC, cfg); wmb(); /* disable vsync counter before updating single buffer registers */ SDE_REG_WRITE(c, INTF_TEAR_SYNC_CONFIG_HEIGHT, te->sync_cfg_height); @@ -579,6 +577,10 @@ static int sde_hw_intf_setup_te_config(struct sde_hw_intf *intf, te->sync_threshold_start)); cfg |= BIT(19); /* VSYNC_COUNTER_EN */ SDE_REG_WRITE(c, INTF_TEAR_SYNC_CONFIG_VSYNC, cfg); + wmb(); /* ensure vsync_counter_en is written */ + + SDE_REG_WRITE(c, INTF_TEAR_SYNC_WRCOUNT, + (te->start_pos + te->sync_threshold_start + 1)); spin_unlock(&tearcheck_spinlock); return 0;