[libcamera-devel,v4,0/3] Add HeapAllocator
mbox series

Message ID 20230328095534.3584-1-harveyycyang@gmail.com
Headers show
Series
  • Add HeapAllocator
Related show

Message

Harvey Yang March 28, 2023, 9:55 a.m. UTC
Hi all,

The series of patches added HeapAllocator, which uses DmaHeap (moved
from Raspberry Pi pipeline handler) and UdmaHeap to allocate heap
buffers.

I've updated and tested it on my virtual pipeline handler.
HeapAllocator creates buffer as a direct multiple of the page size,
and create planes according to the stream configuration.

I think the patch is ready to be reviewed. Please take a look, thanks!

BR,
Harvey

Cheng-Hao Yang (3):
  libcamera: Move DmaHeap to HeapAllocator as a base class
  libcamera: Add UdmaHeap if DmaHeap is not valid
  libcamera: Add exportFrameBuffers in HeapAllocator

 include/libcamera/dma_heap.h                  |  20 +++
 include/libcamera/heap.h                      |  27 ++++
 include/libcamera/heap_allocator.h            |  41 ++++++
 include/libcamera/meson.build                 |   4 +
 include/libcamera/udma_heap.h                 |  20 +++
 .../dma_heaps.cpp => dma_heap.cpp}            |  35 +++---
 src/libcamera/heap_allocator.cpp              | 102 +++++++++++++++
 src/libcamera/meson.build                     |   3 +
 .../pipeline/raspberrypi/dma_heaps.h          |  32 -----
 .../pipeline/raspberrypi/meson.build          |   1 -
 .../pipeline/raspberrypi/raspberrypi.cpp      |  10 +-
 src/libcamera/udma_heap.cpp                   | 117 ++++++++++++++++++
 12 files changed, 355 insertions(+), 57 deletions(-)
 create mode 100644 include/libcamera/dma_heap.h
 create mode 100644 include/libcamera/heap.h
 create mode 100644 include/libcamera/heap_allocator.h
 create mode 100644 include/libcamera/udma_heap.h
 rename src/libcamera/{pipeline/raspberrypi/dma_heaps.cpp => dma_heap.cpp} (69%)
 create mode 100644 src/libcamera/heap_allocator.cpp
 delete mode 100644 src/libcamera/pipeline/raspberrypi/dma_heaps.h
 create mode 100644 src/libcamera/udma_heap.cpp