Commit c5614ae3 authored by Inki Dae's avatar Inki Dae Committed by Dave Airlie

drm/exynos: fixed page flip issue.

with vblank_refcount = 1, there was the case that drm_vblank_put
is called by specific page flip function so this patch fixes the
issue.
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d081f566
...@@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, ...@@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
*/ */
event->pipe = exynos_crtc->pipe; event->pipe = exynos_crtc->pipe;
list_add_tail(&event->base.link,
&dev_priv->pageflip_event_list);
ret = drm_vblank_get(dev, exynos_crtc->pipe); ret = drm_vblank_get(dev, exynos_crtc->pipe);
if (ret) { if (ret) {
DRM_DEBUG("failed to acquire vblank counter\n"); DRM_DEBUG("failed to acquire vblank counter\n");
...@@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, ...@@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
goto out; goto out;
} }
list_add_tail(&event->base.link,
&dev_priv->pageflip_event_list);
crtc->fb = fb; crtc->fb = fb;
ret = exynos_drm_crtc_update(crtc); ret = exynos_drm_crtc_update(crtc);
if (ret) { if (ret) {
......
...@@ -604,7 +604,12 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) ...@@ -604,7 +604,12 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
} }
if (is_checked) { if (is_checked) {
drm_vblank_put(drm_dev, crtc); /*
* call drm_vblank_put only in case that drm_vblank_get was
* called.
*/
if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
drm_vblank_put(drm_dev, crtc);
/* /*
* don't off vblank if vblank_disable_allowed is 1, * don't off vblank if vblank_disable_allowed is 1,
......
...@@ -712,7 +712,12 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc) ...@@ -712,7 +712,12 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)
} }
if (is_checked) if (is_checked)
drm_vblank_put(drm_dev, crtc); /*
* call drm_vblank_put only in case that drm_vblank_get was
* called.
*/
if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
drm_vblank_put(drm_dev, crtc);
spin_unlock_irqrestore(&drm_dev->event_lock, flags); spin_unlock_irqrestore(&drm_dev->event_lock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment