drm/tilcdc: Precalculate total frametime in tilcdc_crtc_set_mode()
authorJyri Sarha <jsarha@ti.com>
Thu, 12 Oct 2017 09:19:46 +0000 (12:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2017 10:26:36 +0000 (11:26 +0100)
commite3c5870862d95ff198a1902c3d7bd2a548b89ea7
tree15b65bde15f52f0bf1cddd395b74259e2203f041
parenta5851fdb17dda5f0854417f15a0c9c833a92dcc6
drm/tilcdc: Precalculate total frametime in tilcdc_crtc_set_mode()

commit ce99f7206c9105851d97202ed08c058af6f11ac4 upstream.

We need the total frame refresh time to check if we are too close to
vertical sync when updating the two framebuffer DMA registers and risk
a collision. This new method is more accurate that the previous that
based on mode's vrefresh value, which itself is inaccurate or may not
even be initialized.

Reported-by: Kevin Hao <kexin.hao@windriver.com>
Fixes: 11abbc9f39e0 ("drm/tilcdc: Set framebuffer DMA address to HW only if CRTC is enabled")
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/tilcdc/tilcdc_crtc.c