From patchwork Fri Jun 30 12:03:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 18772 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 18451C32AA 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 82407628CC; Fri, 30 Jun 2023 14:03:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1688126593; bh=kt9qEOgLDzU0HrWp4M2ICglT7zLFIrNI6z7PVRwL/64=; 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=MRiBE9LG0EjEKzKgj2RsznCoLkFX0Ht9SYwQP7Q+ocK0aKu0NdmJehFL3NLscQ0I9 qg3PbiAr3hqsropyk4Rb6A2LITqPRPClX1ObA4Gc+MYuUVfIZm+Wt+n3DcUDpY9nXt TJa9T0XEDetvaj+bgCfFNS3tM3wJ4shShHvFSz8Vh8BMesXkNaQQeSFbmhG4VvWzMt QGdusc+3PnZyN4l64kFE3ZBASIWxqyD/DhA3eWMstBc8gBUfZxastf5SiX7MF6vEzx f2fdCsXj0D9DjjjjPG+resffdm94ojc7JoyRWrW0aTPCVElzMsKO2H3UPTZSANIZnI NSq6QKrEKQvGw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 503DC628C1 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="NXXiKEOv"; dkim-atps=neutral Received: from umang.jainideasonboard.com.praguecc.cz (unknown [193.85.242.128]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CD54931FA; Fri, 30 Jun 2023 14:02:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1688126548; bh=kt9qEOgLDzU0HrWp4M2ICglT7zLFIrNI6z7PVRwL/64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NXXiKEOv601tP9ADy+oGDnuaVBFRyYG5NaFdYQ4Ks0df80B0dXEvXxxYY52nOsZVY UtXhloRthDtHLJpp0iAB72K3Yg7bjS2OJ08sJQg/DF62zkKbOEwT5UJ7W+zXBmsJ4x 7jQIUYej3sKcAp9+5tVS7U4KZLZazf4vJEqGgIRQ= To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Jun 2023 14:03:01 +0200 Message-Id: <20230630120303.33023-4-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 3/5] ipa: rpi: cam_helper_imx708: 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_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 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 buffer, Metadata &m return; } - parseEmbeddedData(buffer, metadata); + size_t bytesPerLine = (mode_.width * mode_.bitdepth) >> 3; + + libcamera::Span 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) {