]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: drm/exynos: fix leak (regression) in destroy_fb path
authorMandeep Singh Baines <msb@chromium.org>
Tue, 6 Nov 2012 18:53:33 +0000 (10:53 -0800)
committerGerrit <chrome-bot@google.com>
Wed, 5 Dec 2012 08:48:57 +0000 (00:48 -0800)
We need to put the dma_buf. I accidentally removed the put in:

commit 1cc84420cfd8b3e98d23314213282ad70a2b9b55
Author: Mandeep Singh Baines <msb@chromium.org>
Date:   Wed Nov 28 21:18:57 2012 -0800

    CHROMIUM: drm/exynos: remove KDS calls from destroy_fb

BUG=chrome-os-partner:15349,chrome-os-partner:14965
TEST=Verified leak is gone.

Before:

localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
2 objects, 8454144 bytes
localhost ~ # start ui
ui start/running, process 27060
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
4 objects, 16908288 bytes
localhost ~ # start ui
ui start/running, process 29745
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
6 objects, 25362432 bytes

After:

localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
0 objects, 0 bytes
localhost ~ # start ui
ui start/running, process 3642
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
5 objects, 12709888 bytes
localhost ~ # stop ui
ui stop/waiting
localhost ~ # start ui
ui start/running, process 4628
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
5 objects, 12709888 bytes
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
0 objects, 0 bytes
localhost ~ # start ui
ui start/running, process 6797
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/kernel/debug/dri/0/exynos_gem_objects
0 objects, 0 bytes

Change-Id: I75dde125cfc93432a6b2f1bca7166c703c8487cb
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39218
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drivers/gpu/drm/exynos/exynos_drm_fb.c

index 512a6482d9ef8b60fdfa4e14ccfee5658bd59462..796cf1aea383d4a46ec6fd2ee77f7e0aa1ccfd17 100644 (file)
@@ -121,6 +121,11 @@ static void exynos_drm_fb_release_work_fn(struct work_struct *work)
        fb = &exynos_fb->fb;
        dev_priv = fb->dev->dev_private;
 
+#ifdef CONFIG_DMA_SHARED_BUFFER_USES_KDS
+       if (exynos_fb->dma_buf)
+               dma_buf_put(exynos_fb->dma_buf);
+#endif
+
        drm_framebuffer_cleanup(fb);
 
        if (exynos_drm_fb_unmap(fb))