android: ion: make dma_buf_ops of ION global
authorCho KyongHo <pullip.cho@samsung.com>
Mon, 12 Feb 2018 01:34:16 +0000 (10:34 +0900)
committerSangwook Ju <sw.ju@samsung.com>
Mon, 14 May 2018 10:45:23 +0000 (19:45 +0900)
It is the only way to verify if the given dma-buf is exported by ION.

Change-Id: I7925e9f88e34f6ecd123a4178531fd237b807ffa
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion_exynos.h

index dd6ec2648d676374b4e90c890adcd2b537d79cab..1939579677d2eaaff06e8f759253d8de11f0859d 100644 (file)
@@ -384,7 +384,7 @@ static int ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
        return 0;
 }
 
-static const struct dma_buf_ops dma_buf_ops = {
+const struct dma_buf_ops ion_dma_buf_ops = {
        .map_dma_buf = ion_map_dma_buf,
        .unmap_dma_buf = ion_unmap_dma_buf,
        .mmap = ion_mmap,
@@ -440,7 +440,7 @@ struct dma_buf *__ion_alloc(size_t len, unsigned int heap_id_mask,
        if (IS_ERR(buffer))
                return ERR_CAST(buffer);
 
-       exp_info.ops = &dma_buf_ops;
+       exp_info.ops = &ion_dma_buf_ops;
        exp_info.size = buffer->size;
        exp_info.flags = O_RDWR;
        exp_info.priv = buffer;
index 0c1dd2eb23902ac328330204445bf1cecc95afea..ba4d0bb18b6f47edd1c65358aab67e776be484db 100644 (file)
@@ -79,6 +79,8 @@ static inline void *ion_buffer_protect_single(unsigned int protection_id,
 #define ion_buffer_unprotect(priv) do { } while (0)
 #endif
 
+extern const struct dma_buf_ops ion_dma_buf_ops;
+
 struct ion_heap *ion_get_heap_by_name(const char *heap_name);
 struct dma_buf *__ion_alloc(size_t len, unsigned int heap_id_mask,
                            unsigned int flags);