From: Cho KyongHo Date: Mon, 12 Feb 2018 01:34:16 +0000 (+0900) Subject: android: ion: make dma_buf_ops of ION global X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea2ed74a9f70938d54de0f4fa415799497e6e669;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git android: ion: make dma_buf_ops of ION global It is the only way to verify if the given dma-buf is exported by ION. Change-Id: I7925e9f88e34f6ecd123a4178531fd237b807ffa Signed-off-by: Cho KyongHo --- diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index dd6ec2648d67..1939579677d2 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -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; diff --git a/drivers/staging/android/ion/ion_exynos.h b/drivers/staging/android/ion/ion_exynos.h index 0c1dd2eb2390..ba4d0bb18b6f 100644 --- a/drivers/staging/android/ion/ion_exynos.h +++ b/drivers/staging/android/ion/ion_exynos.h @@ -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);