drm/exynos: fix imported dma-buf to be mapped 11/55111/1 accepted/tizen/mobile/20151222.085824 accepted/tizen/tv/20151222.085848 accepted/tizen/wearable/20151222.085907 submit/tizen/20151222.042943 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718
authorJoonyoung Shim <jy0922.shim@samsung.com>
Tue, 22 Dec 2015 00:54:31 +0000 (09:54 +0900)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Tue, 22 Dec 2015 04:01:14 +0000 (13:01 +0900)
The imported dma-buf should be mapped by sub-system exporting it.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[jy0922.shim: Be backported from upstream but not posted]

Change-Id: I59984d8111f058decf83afbda4d2df2e1edf305e

drivers/gpu/drm/exynos/exynos_drm_gem.c

index a1c573990294db41a5d3abf401add7f9224f5ea4..74f66904b39d3e76499fe767643c180653a98801 100644 (file)
@@ -12,6 +12,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_vma_manager.h>
 
+#include <linux/dma-buf.h>
 #include <linux/shmem_fs.h>
 #include <drm/exynos_drm.h>
 
@@ -662,5 +663,8 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
 
        obj = vma->vm_private_data;
 
+       if (obj->import_attach)
+               return dma_buf_mmap(obj->dma_buf, vma, 0);
+
        return exynos_drm_gem_mmap_obj(obj, vma);
 }