[v5,0/5] software_isp: Implement DMABuf import for input buffers
mbox series

Message ID 20260527081534.20245-1-robert.mader@collabora.com
Headers show
Series
  • software_isp: Implement DMABuf import for input buffers
Related show

Message

Robert Mader May 27, 2026, 8:15 a.m. UTC
From the main commit:
In many cases we can import the GPU-ISP input buffer, a dmabuf from v4l2,
directly into EGL instead of mapping and uploading - i.e. copying - it.
This reduces memory bandwidth and CPU usage and can slightly improve
latency.

Notes: Previous iterations of these patches have already been tested on
various platforms, without known regressions and showing significant
improvements.

Changes in v5:
- Added R-B tags
- Made MappedFrameBuffer parameter of SwStatsCpu::processFrame() non-optional,
  using finishFrame() directly instead where appropriate.
- Minor code changes in the last patch to address review feedback and improve
  readability. No functional changes.

Changes in v4:
- Split out commit "debayer_egl: Sync output buffer after processing stats"
  into its own series and rebased this series on top:
  https://patchwork.libcamera.org/cover/26788/
- Added performance benchmarks
- Move dmabuf_import_failed_ variable to eGLImage, ensuring it gets reset.
- Added commit to ensure input buffer doesn't get mapped twice.

Changes in v3:
- Split up changes to createTexture2D() and eGLImage constructor
  into two commits.
- Added field to remember dmabuf import fails - and promote the relevant
  log to Info.
- Reordered and slightly extended commit message for "egl: Demote an
  error log to debug"
- Fixed some CI / linter errors

Changes in v2:
- Instead of adding parameters to createInputDMABufTexture2D(), remove
  them from createTexture2D instead.
- Use std::optional<DmaSyncer> to make the code easier to understand.
- Move error log level change into its own commit.

Robert Mader (5):
  egl: Add GL format parameter to eGLImage constructor
  egl: Remove some parameters from createTexture2D()
  egl: eGLImage: Add flag to remember dmabuf import fails
  libcamera: swstats_cpu: Take MappedFrameBuffer in processFrame()
  debayer_egl: Implement dmabuf import for input buffers

 include/libcamera/internal/egl.h              |  9 ++-
 .../internal/software_isp/swstats_cpu.h       |  2 +-
 src/libcamera/egl.cpp                         | 32 +++++++--
 src/libcamera/software_isp/debayer_egl.cpp    | 68 +++++++++++++------
 src/libcamera/software_isp/debayer_egl.h      |  2 +-
 src/libcamera/software_isp/swstats_cpu.cpp    | 11 +--
 6 files changed, 82 insertions(+), 42 deletions(-)