[PATCH v2 0/5] libcamera: dma_buffer_allocator: Add support for using udmabuf to alloc dma-buffers

Hans de Goede hdegoede at redhat.com
Thu May 30 19:15:55 CEST 2024


Hi All,

Here is v2 of my patch-series to add /dev/udmabuf dma-buffer allocation
support. This is based on:
https://patchwork.libcamera.org/patch/18922/

Changes in v2:
- New patch: Add linux/udmabuf.h to libcamera's local kernel headers
- New patch: Rename DmaHeap class to DmaBufAllocator
- libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf :
  - Reword the commit message
  - Add a new DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf type for udmabuf
  - Drop unnecessary size != size check
  - Reword log messages to be more like the DMA heap alloc path
  - Move UniqueFD(ret) up so as to not leak the fd on errors
-New patch: software_isp: Allow using dma-buffers from /dev/udmabuf

I have also pushed these patches to:
https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/udmabuf-v2

for CI, CI is happy with it except for the lint task which does not like
the kernel headers sync, which seems to be a false positive.

Regards,

Hans


Hans de Goede (5):
  update-kernel-headers: Add linux/udmabuf.h to headers to sync
  include: linux: Update kernel headers to version v6.10-rc1
  libcamera: Rename DmaHeap class to DmaBufAllocator
  libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf
  libcamera: software_isp: Allow using dma-buffers from /dev/udmabuf

 .../libcamera/internal/dma_buf_allocator.h    |  42 +++
 include/libcamera/internal/dma_heaps.h        |  38 ---
 include/libcamera/internal/meson.build        |   2 +-
 .../internal/software_isp/software_isp.h      |   4 +-
 include/linux/README                          |   2 +-
 include/linux/drm_fourcc.h                    |  10 +-
 include/linux/media-bus-format.h              |   9 +
 include/linux/rkisp1-config.h                 |  56 ++--
 include/linux/udmabuf.h                       |  33 +++
 include/linux/v4l2-controls.h                 |   6 +
 include/linux/v4l2-mediabus.h                 |  18 +-
 include/linux/v4l2-subdev.h                   |  29 ++-
 include/linux/videodev2.h                     |  72 ++++--
 src/libcamera/dma_buf_allocator.cpp           | 240 ++++++++++++++++++
 src/libcamera/dma_heaps.cpp                   | 165 ------------
 src/libcamera/meson.build                     |   2 +-
 src/libcamera/pipeline/rpi/vc4/vc4.cpp        |   4 +-
 src/libcamera/software_isp/software_isp.cpp   |   6 +-
 utils/update-kernel-headers.sh                |   1 +
 19 files changed, 465 insertions(+), 274 deletions(-)
 create mode 100644 include/libcamera/internal/dma_buf_allocator.h
 delete mode 100644 include/libcamera/internal/dma_heaps.h
 create mode 100644 include/linux/udmabuf.h
 create mode 100644 src/libcamera/dma_buf_allocator.cpp
 delete mode 100644 src/libcamera/dma_heaps.cpp

-- 
2.45.1



More information about the libcamera-devel mailing list