From 1163463d6e3970e3ec0f6dacf08c3d3c979c6b83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Marchesin?= Date: Mon, 14 Jan 2013 14:22:21 -0800 Subject: [PATCH] CHROMIUM: drm/exynos: Fix fb refcounting MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Sean Paul Commit-Queue: Stéphane Marchesin --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 6532b23947f5d..fae84d1bb10ec 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -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; -- 2.39.5