diff mbox

[5/5] drm/exynos: enable vsync interrupt while waiting for vblank

Message ID 1403091293-15058-6-git-send-email-rahul.sharma@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rahul Sharma June 18, 2014, 11:34 a.m. UTC
mixer_wait_for_vblank function expects that the upcoming
vsync interrupt handler routine will clear the
wait_vsync_event atomic variable.

For this to happen, interrupts should be enabled and
disabled properly.

Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_mixer.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Rahul Sharma June 20, 2014, 2:51 p.m. UTC | #1
Hi All,

On 18 June 2014 17:04, Rahul Sharma <rahul.sharma@samsung.com> wrote:
> mixer_wait_for_vblank function expects that the upcoming
> vsync interrupt handler routine will clear the
> wait_vsync_event atomic variable.
>
> For this to happen, interrupts should be enabled and
> disabled properly.
>
> Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 6f18581..7927f2e 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -1019,6 +1019,8 @@ static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr)
>         }
>         mutex_unlock(&mixer_ctx->mixer_mutex);
>
> +       mixer_enable_vblank(mgr);
> +
>         atomic_set(&mixer_ctx->wait_vsync_event, 1);
>
>         /*
> @@ -1029,6 +1031,8 @@ static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr)
>                                 !atomic_read(&mixer_ctx->wait_vsync_event),
>                                 HZ/20))
>                 DRM_DEBUG_KMS("vblank wait timed out.\n");
> +
> +       mixer_disable_vblank(mgr);
>  }

I found issue with this patch. It is causing deadlock by bypassing
vblank refcounting
and manually disabling the Interrupt.

I switched to following and it is back on track.

drm_vblank_get(mgr->crtc->dev, mixer_ctx->pipe);
drm_vblank_put(mgr->crtc->dev, mixer_ctx->pipe);

I will include this change in next version.

Regards,
Rahul Sharma.

>
>  static void mixer_window_suspend(struct exynos_drm_manager *mgr)
> --
> 1.7.9.5
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 6f18581..7927f2e 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1019,6 +1019,8 @@  static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr)
 	}
 	mutex_unlock(&mixer_ctx->mixer_mutex);
 
+	mixer_enable_vblank(mgr);
+
 	atomic_set(&mixer_ctx->wait_vsync_event, 1);
 
 	/*
@@ -1029,6 +1031,8 @@  static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr)
 				!atomic_read(&mixer_ctx->wait_vsync_event),
 				HZ/20))
 		DRM_DEBUG_KMS("vblank wait timed out.\n");
+
+	mixer_disable_vblank(mgr);
 }
 
 static void mixer_window_suspend(struct exynos_drm_manager *mgr)