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:
committed by
Kieran Bingham
parent
e3c74bbc89
commit
6b224d91a9
@@ -364,4 +364,17 @@ void Debayer::setParams(DebayerParams ¶ms)
|
||||
gammaLut_ = params.gammaLut;
|
||||
}
|
||||
|
||||
/**
|
||||
* \fn void Debayer::dmaSyncBegin(DebayerParams ¶ms)
|
||||
* \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 */
|
||||
|
||||
@@ -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 ¶ms);
|
||||
void dmaSyncBegin(std::vector<DmaSyncer> &dmaSyncers, FrameBuffer *input, FrameBuffer *output);
|
||||
};
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user