dma-buf: include dma-buf container to kernel build
authorCho KyongHo <pullip.cho@samsung.com>
Fri, 13 Apr 2018 05:09:01 +0000 (14:09 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:20 +0000 (20:22 +0300)
This commit follows commut bdaed72c4 ("dma-buf: introduce dma-buf
container"). dma-buf container has been excluded from the kernel build
until the dmabuf container support by ION is removed by commit
e4af6c288 ("android: ion: remove linux/dmabuf_container.h") not to
cause kernel build break.

Change-Id: Id0d3e7f82ace28622efbbbd4e5fa263076059109
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/dma-buf/Kconfig
drivers/dma-buf/Makefile
include/linux/dma-buf.h

index ed3b785bae37e1cd589697f04d1b868dc2fccd9b..8f069e4d0a4afada9d064efcde4e4dc3bf67731d 100644 (file)
@@ -30,4 +30,13 @@ config SW_SYNC
          WARNING: improper use of this can result in deadlocking kernel
          drivers from userspace. Intended for test and debug only.
 
+config DMA_BUF_CONTAINER
+       bool "dma-buf container support"
+       default y
+       depends on DMA_SHARED_BUFFER
+       ---help---
+         dma-buf container is a dma-buf that can contain multiple different
+         dma-buf objects. It is useful when delivering a lot of dma-buf objects
+         between processes or user and kernel to reduce communication overhead.
+
 endmenu
index c33bf88631479411549ab38cb96d748784e3f74c..e741999ae1c8b25b523db6983069da970f3221e6 100644 (file)
@@ -1,3 +1,4 @@
 obj-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o
 obj-$(CONFIG_SYNC_FILE)                += sync_file.o
 obj-$(CONFIG_SW_SYNC)          += sw_sync.o sync_debug.o
+obj-$(CONFIG_DMA_BUF_CONTAINER)        += dma-buf-container.o
index 8b1dda7a2d3c690549e1d1751484168ba8983ff9..59d3d00b42af55639b08fb42b14f86892bd72266 100644 (file)
@@ -408,6 +408,11 @@ void dma_buf_vunmap(struct dma_buf *, void *vaddr);
 
 #ifdef CONFIG_DMA_BUF_CONTAINER
 struct dma_buf *dma_buf_get_any(int fd);
+#else
+static inline struct dma_buf *dma_buf_get_any(int fd)
+{
+       return dma_buf_get(fd);
+}
 #endif