[4/6] ipa: rkisp1: cproc: Report metadata
diff mbox series

Message ID 20251026233048.175689-5-kieran.bingham@ideasonboard.com
State New
Headers show
Series
  • libipa: Introduce a Quantized type
Related show

Commit Message

Kieran Bingham Oct. 26, 2025, 11:30 p.m. UTC
Presently the colour processing component exposes controls for
brightness, saturation, and contrast to the applications which are
handled and processed accordingly on the ISP.

The implementation lacks reporting the values that are set back to the
application.

Utilise the new Quantised types to provide the values that were applied
to the hardware and report them in the completed request metadata.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/cproc.cpp | 12 ++++++++++++
 src/ipa/rkisp1/algorithms/cproc.h   |  4 ++++
 2 files changed, 16 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/cproc.cpp b/src/ipa/rkisp1/algorithms/cproc.cpp
index 44c0fb8425de..d19d808cce4d 100644
--- a/src/ipa/rkisp1/algorithms/cproc.cpp
+++ b/src/ipa/rkisp1/algorithms/cproc.cpp
@@ -184,6 +184,18 @@  void ColorProcessing::prepare([[maybe_unused]] IPAContext &context,
 	config->sat = frameContext.cproc.saturation.quantized();
 }
 
+/**
+ * \copydoc libcamera::ipa::Algorithm::process
+ */
+void ColorProcessing::process([[maybe_unused]] IPAContext &context, [[maybe_unused]] const uint32_t frame,
+			      IPAFrameContext &frameContext, [[maybe_unused]] const rkisp1_stat_buffer *stats,
+			      ControlList &metadata)
+{
+	metadata.set(controls::Brightness, frameContext.cproc.brightness.value());
+	metadata.set(controls::Contrast, frameContext.cproc.contrast.value());
+	metadata.set(controls::Saturation, frameContext.cproc.saturation.value());
+}
+
 REGISTER_IPA_ALGORITHM(ColorProcessing, "ColorProcessing")
 
 } /* namespace ipa::rkisp1::algorithms */
diff --git a/src/ipa/rkisp1/algorithms/cproc.h b/src/ipa/rkisp1/algorithms/cproc.h
index fd38fd17e8bb..9b589ebd4ad7 100644
--- a/src/ipa/rkisp1/algorithms/cproc.h
+++ b/src/ipa/rkisp1/algorithms/cproc.h
@@ -30,6 +30,10 @@  public:
 	void prepare(IPAContext &context, const uint32_t frame,
 		     IPAFrameContext &frameContext,
 		     RkISP1Params *params) override;
+	void process(IPAContext &context, const uint32_t frame,
+		     IPAFrameContext &frameContext,
+		     const rkisp1_stat_buffer *stats,
+		     ControlList &metadata) override;
 };
 
 } /* namespace ipa::rkisp1::algorithms */