Skip to content

Commit a14cd83

Browse files
yuanxiaopsiff
authored andcommitted
heap: dma-buf: Add the dma-buf for Phytium NPU driver
This patch adds a new DMA-buf function since it has new private date for the Phytium NPU. Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn> Signed-off-by: Cheng Quan <chengquan@phytium.com.cn> Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
1 parent 728cd7d commit a14cd83

10 files changed

Lines changed: 447 additions & 9 deletions

File tree

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6170,9 +6170,11 @@ S: Maintained
61706170
T: git git://anongit.freedesktop.org/drm/drm-misc
61716171
F: Documentation/driver-api/dma-buf.rst
61726172
F: drivers/dma-buf/
6173+
F: drivers/dma-buf/heaps/phytium_npu_heap.c
61736174
F: include/linux/*fence.h
61746175
F: include/linux/dma-buf.h
61756176
F: include/linux/dma-resv.h
6177+
F: include/linux/phytium_npu_dma_buf_heap.h
61766178
K: \bdma_(?:buf|fence|resv)\b
61776179

61786180
DMA GENERIC OFFLOAD ENGINE SUBSYSTEM

drivers/dma-buf/heaps/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ config DMABUF_HEAPS_CMA
1212
Choose this option to enable dma-buf CMA heap. This heap is backed
1313
by the Contiguous Memory Allocator (CMA). If your system has these
1414
regions, you should say Y here.
15+
16+
config DMABUF_HEAPS_NPU_SYSTEM
17+
bool "DMA-BUF for Phytium NPU system Heap"
18+
depends on DMABUF_HEAPS && ARCH_PHYTIUM
19+
help
20+
Choose this option to enable a new dma-buf system heap for the
21+
Phytium's NPU. The npu system heap is backed by pages from the buddy
22+
allocator. If your system has NPU driver, you should say Y here.

drivers/dma-buf/heaps/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_DMABUF_HEAPS_SYSTEM) += system_heap.o
33
obj-$(CONFIG_DMABUF_HEAPS_CMA) += cma_heap.o
4+
obj-$(CONFIG_DMABUF_HEAPS_NPU_SYSTEM) += phytium_npu_heap.o

0 commit comments

Comments
 (0)