From patchwork Fri Jun 30 12:03:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 18773 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C312FC32AB for ; Fri, 30 Jun 2023 12:03:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0F474628C6; Fri, 30 Jun 2023 14:03:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1688126594; bh=4ChzfexEBo0QACUM7f3MjOT0KuOpKExpyR6ioq9zevU=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XLO/vbDEVjLzOsOga0966OO+Zqd0VjZ9xC8RfjCgfPlmfeEp/e1vAWNUdNvuVmGNX 2e2Dt9/eEoWVPxBSYy4p8atKRhgjuTCrvSJXyVGVd4rY6Nz+JKAc8cI07BqjwNHxNy F++GJTPG5r1QHkYE5NOOZ3nAd4wRxlAjbx5a0w/MQxSbHNtrE9Ij21Na1ULBvfXy/N /C8IrO7lGupm2IO2HjH7b8XyCg264kOgFez6fRKIBPCCn2+//lIJzzzO566qC0KpAP u7DughFghcfg84AMhjPssFwcTvdoIvXklgbf7LN7q21b1cKCDbUY9uI5Yg1xqG0BJW ofBoux1YDxLDQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A45C6628C1 for ; Fri, 30 Jun 2023 14:03:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YCDXXlo+"; dkim-atps=neutral Received: from umang.jainideasonboard.com.praguecc.cz (unknown [193.85.242.128]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DB7832D2; Fri, 30 Jun 2023 14:02:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1688126548; bh=4ChzfexEBo0QACUM7f3MjOT0KuOpKExpyR6ioq9zevU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YCDXXlo+RCTnFzTjHmi2pJ715oeZIUR8jnUFzGMHCzoLAMeIZyXgTczfClO4tj+LZ be82GTpKbdNoXoIdMMB1EKUJv49H6FQXZdb6XA5LyJYnB6ryKMoGg4YIeGgROJ7U6a enKKQ0oaPb0xwC3itAnNSokHtaTgWi9uO1ZI9YeU= To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Jun 2023 14:03:02 +0200 Message-Id: <20230630120303.33023-5-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230630120303.33023-1-umang.jain@ideasonboard.com> References: <20230630120303.33023-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 4/5] ipa: rpi: cam_helper_imx477: Only pass embedded buffer in parseEmbeddedData() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Only the embedded data section should be passed while parsing the embedded data through parseEmbeddedData(). Signed-off-by: Umang Jain --- src/ipa/rpi/cam_helper/cam_helper_imx477.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx477.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx477.cpp index bc769ca7..3753fd0b 100644 --- a/src/ipa/rpi/cam_helper/cam_helper_imx477.cpp +++ b/src/ipa/rpi/cam_helper/cam_helper_imx477.cpp @@ -42,6 +42,9 @@ constexpr std::initializer_list registerList = { expHiReg, expLoReg, gainHiReg, gainLoReg, frameLengthHiReg, frameLengthLoReg, lineLengthHiReg, lineLengthLoReg, temperatureReg }; +/* No. of lines of embedded data on IMX477. */ +constexpr uint32_t embeddedDataLinesImx477 = 2; + class CamHelperImx477 : public CamHelper { public: @@ -95,7 +98,11 @@ void CamHelperImx477::prepare(libcamera::Span buffer, Metadata &m return; } - parseEmbeddedData(buffer, metadata); + size_t bytesPerLine = (mode_.width * mode_.bitdepth) >> 3; + libcamera::Span embeddedData{ buffer.data(), + embeddedDataLinesImx477 * bytesPerLine }; + + parseEmbeddedData(embeddedData, metadata); /* * The DeviceStatus struct is first populated with values obtained from