@@ -55,6 +55,7 @@ file structure:
- CAMERA-ID:
tuning-file: # full path
simple:
+ copy_input_buffer: # true/false
supported_devices:
- driver: # driver name, e.g. `mxc-isi`
software_isp: # true/false
@@ -93,6 +94,7 @@ Configuration file example
rpi:
config_file: /usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml
simple:
+ copy_input_buffer: false
supported_devices:
- driver: mxc-isi
software_isp: true
@@ -71,17 +71,6 @@ per-frame buffers like we do for hardware ISPs.
---
-6. Input buffer copying configuration
-
-> DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats)
-> : stats_(std::move(stats)), gammaCorrection_(1.0)
-> {
-> enableInputMemcpy_ = true;
-
-Set this appropriately and/or make it configurable.
-
----
-
7. Performance measurement configuration
> void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams params)
@@ -22,6 +22,7 @@
#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"
namespace libcamera {
@@ -48,7 +49,9 @@ DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats)
* always set it to true as the safer choice but this should be changed in
* future.
*/
- enableInputMemcpy_ = true;
+ enableInputMemcpy_ = GlobalConfiguration::option<bool>(
+ "pipelines.simple.copy_input_buffer")
+ .value_or(true);
/* Initialize color lookup tables */
for (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++)
On some platforms, working directly on the input buffer is very slow due to disabled caching. This is why we copy the input buffer into standard (cached) memory. This is an unnecessary overhead on platforms with cached buffers. Let's make input buffer copying configurable. The default is still copying, as it's overhead is much lower than contingent operations on non-cached memory. Ideally, we should improve this in future to set the default to non-copying if we can be sure under observable circumstances that we are working with cached buffers. Completes software ISP TODO #6. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> --- Documentation/runtime_configuration.rst | 2 ++ src/libcamera/software_isp/TODO | 11 ----------- src/libcamera/software_isp/debayer_cpu.cpp | 5 ++++- 3 files changed, 6 insertions(+), 12 deletions(-)