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

Message ID 20230208095922.1471175-1-chenghaoyang@google.com
Headers show
Series
  • Add HeapAllocator
Related show

Message

Harvey Yang Feb. 8, 2023, 9:59 a.m. UTC
Hi Kieran and all,

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

I've only build-test it, and I'll need to test it on my virtual pipeline
handler patches, but please take a look and let me know if it makes
sense. Thanks!

BR,
Harvey

Harvey 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            |  40 ++++++
 include/libcamera/meson.build                 |   4 +
 include/libcamera/udma_heap.h                 |  20 +++
 .../dma_heaps.cpp => dma_heap.cpp}            |  54 +++++---
 src/libcamera/heap_allocator.cpp              |  90 ++++++++++++++
 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, 360 insertions(+), 58 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} (56%)
 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