drm/omap: fix WBDELAYCOUNT with interlace

Vertical blanking needs to be halved on interlace modes. WBDELAYCOUNT
was calculated without such halving, resulting in WBUNCOMPLETE errors.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
This commit is contained in:
Tomi Valkeinen 2017-10-26 14:40:12 +03:00
parent 46a9304185
commit b994e53c2c
1 changed files with 9 additions and 5 deletions

View File

@ -2814,14 +2814,18 @@ int dispc_wb_setup(struct dispc_device *dispc,
/* WBDELAYCOUNT */
REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), 0, 7, 0);
} else {
int wbdelay;
u32 wbdelay;
if (channel_in == DSS_WB_TV_MGR)
wbdelay = min(vm->vsync_len + vm->vback_porch,
(u32)255);
wbdelay = vm->vsync_len + vm->vback_porch;
else
wbdelay = min(vm->vfront_porch +
vm->vsync_len + vm->vback_porch, (u32)255);
wbdelay = vm->vfront_porch + vm->vsync_len +
vm->vback_porch;
if (vm->flags & DISPLAY_FLAGS_INTERLACED)
wbdelay /= 2;
wbdelay = min(wbdelay, 255u);
/* WBDELAYCOUNT */
REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), wbdelay, 7, 0);