@@ -335,10 +335,19 @@ static void fimd_disable_vblank(struct device *dev)
static void fimd_wait_for_vblank(struct device *dev)
{
struct fimd_context *ctx = get_fimd_context(dev);
+ u32 val;
+ bool vblank_enabled = true;
if (ctx->suspended)
return;
+ val = readl(ctx->regs + VIDINTCON0);
+
+ if (!(val & VIDINTCON0_INT_FRAME)) {
+ vblank_enabled = false;
+ fimd_enable_vblank(dev);
+ }
+
atomic_set(&ctx->wait_vsync_event, 1);
/*
@@ -349,6 +358,9 @@ static void fimd_wait_for_vblank(struct device *dev)
!atomic_read(&ctx->wait_vsync_event),
DRM_HZ/20))
DRM_DEBUG_KMS("vblank wait timed out.\n");
+
+ if (!vblank_enabled)
+ fimd_disable_vblank(dev);
}
static struct exynos_drm_manager_ops fimd_manager_ops = {
This patch checks if vblank is enabled inside wait for vblank. If not enabled, vblank is temporarily enabled before waiting and then disabled afterwards. This ensures that the wait never times out. Signed-off-by: Prathyush K <prathyush.k@samsung.com> --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)