libcamera: software_isp: Move DMA Sync code to Debayer base class

We can reuse the DMA Sync code in the GPUISP. Move the code we need to
the base class.

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Bryan O'Donoghue
2025-12-11 23:22:37 +00:00
committed by Kieran Bingham
parent e3c74bbc89
commit 6b224d91a9
3 changed files with 16 additions and 5 deletions

View File

@@ -364,4 +364,17 @@ void Debayer::setParams(DebayerParams &params)
gammaLut_ = params.gammaLut;
}
/**
* \fn void Debayer::dmaSyncBegin(DebayerParams &params)
* \brief Common CPU/GPU Dma Sync Buffer begin
*/
void Debayer::dmaSyncBegin(std::vector<DmaSyncer> &dmaSyncers, FrameBuffer *input, FrameBuffer *output)
{
for (const FrameBuffer::Plane &plane : input->planes())
dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Read);
for (const FrameBuffer::Plane &plane : output->planes())
dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write);
}
} /* namespace libcamera */

View File

@@ -20,6 +20,7 @@
#include <libcamera/geometry.h>
#include <libcamera/stream.h>
#include "libcamera/internal/dma_buf_allocator.h"
#include "libcamera/internal/global_configuration.h"
#include "libcamera/internal/software_isp/benchmark.h"
#include "libcamera/internal/software_isp/debayer_params.h"
@@ -86,6 +87,7 @@ private:
protected:
void setParams(DebayerParams &params);
void dmaSyncBegin(std::vector<DmaSyncer> &dmaSyncers, FrameBuffer *input, FrameBuffer *output);
};
} /* namespace libcamera */

View File

@@ -22,7 +22,6 @@
#include <libcamera/formats.h>
#include "libcamera/internal/bayer_format.h"
#include "libcamera/internal/dma_buf_allocator.h"
#include "libcamera/internal/framebuffer.h"
#include "libcamera/internal/global_configuration.h"
#include "libcamera/internal/mapped_framebuffer.h"
@@ -752,11 +751,8 @@ void DebayerCpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output
bench_.startFrame();
std::vector<DmaSyncer> dmaSyncers;
for (const FrameBuffer::Plane &plane : input->planes())
dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Read);
for (const FrameBuffer::Plane &plane : output->planes())
dmaSyncers.emplace_back(plane.fd, DmaSyncer::SyncType::Write);
dmaSyncBegin(dmaSyncers, input, output);
setParams(params);