[libcamera-devel] [RFC PATCH 3/5] ipa: rpi: cam_helper_imx708: Only pass embedded buffer in parseEmbeddedData()

Umang Jain umang.jain at ideasonboard.com
Fri Jun 30 14:03:01 CEST 2023


Only the embedded data section should be passed while parsing the
embedded data through parseEmbeddedData().

Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
 src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp
index d0382d63..6c3b54ed 100644
--- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp
+++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp
@@ -40,6 +40,8 @@ constexpr std::initializer_list<uint32_t> registerList =
 	{ expHiReg, expLoReg, gainHiReg, gainLoReg, lineLengthHiReg,
 	  lineLengthLoReg, frameLengthHiReg, frameLengthLoReg, temperatureReg };
 
+/* No. of lines of embedded data on IMX708. */
+constexpr uint32_t embeddedDataLinesImx708 = 2;
 /* PDAF data is expect to occupy the third scanline of embedded data. */
 constexpr uint32_t pdafLineOffsetImx708 = 2;
 
@@ -109,10 +111,13 @@ void CamHelperImx708::prepare(libcamera::Span<const uint8_t> buffer, Metadata &m
 		return;
 	}
 
-	parseEmbeddedData(buffer, metadata);
+	size_t bytesPerLine = (mode_.width * mode_.bitdepth) >> 3;
+
+	libcamera::Span<const uint8_t> embeddedData{ buffer.data(),
+						     embeddedDataLinesImx708 * bytesPerLine };
+	parseEmbeddedData(embeddedData, metadata);
 
 	/* Parse sensor-specific PDAF data. */
-	size_t bytesPerLine = (mode_.width * mode_.bitdepth) >> 3;
 	size_t pdafDataOffset = pdafLineOffsetImx708 * bytesPerLine;
 
 	if (buffer.size() > pdafDataOffset) {
-- 
2.39.1



More information about the libcamera-devel mailing list