^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) menuconfig DMABUF_HEAPS_ROCKCHIP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) bool "DMA-BUF Userland Memory Heaps for RockChip"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) select DMA_SHARED_BUFFER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Choose this option to enable the RockChip DMA-BUF userland memory heaps.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) This options creates per heap chardevs in /dev/rk_dma_heap/ which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) allows userspace to allocate dma-bufs that can be shared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) between drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) config DMABUF_HEAPS_ROCKCHIP_CMA_HEAP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) tristate "DMA-BUF RockChip CMA Heap"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) depends on DMABUF_HEAPS_ROCKCHIP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Choose this option to enable dma-buf RockChip CMA heap. This heap is backed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) by the Contiguous Memory Allocator (CMA). If your system has these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) regions, you should say Y here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) config DMABUF_HEAPS_ROCKCHIP_CMA_ALIGNMENT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) int "Maximum PAGE_SIZE order of alignment for RockChip CMA Heap"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) range 0 12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) depends on DMABUF_HEAPS_ROCKCHIP_CMA_HEAP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) default 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) DMA mapping framework by default aligns all buffers to the smallest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) PAGE_SIZE order which is greater than or equal to the requested buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) size. This works well for buffers up to a few hundreds kilobytes, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) for larger buffers it just a memory waste. With this parameter you can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) specify the maximum PAGE_SIZE order for contiguous buffers. Larger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) buffers will be aligned only to this specified order. The order is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) expressed as a power of two multiplied by the PAGE_SIZE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) For example, if your system defaults to 4KiB pages, the order value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) of 8 means that the buffers will be aligned up to 1MiB only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) If unsure, leave the default value "8".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) config DMABUF_RK_HEAPS_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) bool "DMA-BUF RockChip Heap Debug"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) depends on DMABUF_HEAPS_ROCKCHIP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Choose this option to enable dma-buf RockChip heap debug.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) config DMABUF_RK_HEAPS_DEBUG_PRINT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) bool "DMA-BUF RockChip Heap Debug print log enable"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) depends on DMABUF_HEAPS_ROCKCHIP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) Choose this option to enable dma-buf RockChip heap debug.