]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: drm/exynos: Fix fb refcounting
authorStéphane Marchesin <marcheu@chromium.org>
Mon, 14 Jan 2013 22:22:21 +0000 (14:22 -0800)
committerChromeBot <chrome-bot@google.com>
Tue, 15 Jan 2013 19:45:24 +0000 (11:45 -0800)
Make sure to always call get before put on the fb. Before this
patch, there is a window where we can put before get if the
callback triggers right away (or if the interrupt triggers quickly
enough). We fix this by taking the reference on the fb before we
setup the async waiting.

BUG=chrome-os-partner:16069
TEST=by hand, compiles and runs (but I was never able to repro the issue)

Change-Id: Iedde277c8f9cfebf6c4f6b0675e4d3bace52f637
Reviewed-on: https://gerrit.chromium.org/gerrit/41238
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>

drivers/gpu/drm/exynos/exynos_drm_crtc.c

index 6532b23947f5d2d333c22fca88a905f6e5d1eafc..fae84d1bb10ecab84b9ff8f1b907c6493006d3c6 100644 (file)
@@ -466,6 +466,8 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 
        mutex_unlock(&dev->struct_mutex);
 
+       exynos_drm_fb_get(exynos_fb);
+
 #ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
        exynos_fb->crtc = crtc;
        if (gem_ob->base.export_dma_buf) {
@@ -509,8 +511,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
        }
 #endif
 
-       exynos_drm_fb_get(exynos_fb);
-
        trace_exynos_flip_request(exynos_crtc->pipe);
 
        return 0;