Merge tag 'dwc3-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / exynos / exynos_drm_fimd.c
index b6a737d196ae556c6b038ad8243540a76f2271af..0dbb32bb18a359075f3421afea2f8ef856261dc9 100644 (file)
@@ -604,7 +604,12 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
        }
 
        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,