From patchwork Thu Oct 6 13:17:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17549 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 A8A7FBD16B for ; Thu, 6 Oct 2022 13:18:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 619E362D17; Thu, 6 Oct 2022 15:18:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665062283; bh=xNTg8MgDbCgc7QoFbf3h9gdIw6XzNr2e/f8yNDHlKGY=; 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=cDedvTxq2jtnO6+49Pay0Fir1W4/W7yDVCmMBy0MgnqxhLrw/LZeUtSS2CcqNPvi0 lPNQrgz2Z90Ek4ceBWC8IuiS9x6YDXKlqUAt2QPOvLGMCr8T8zHu4DzLbXn2z+g93r iVSDArY2jgjFcZouGf18u0LWFS5PchYwAbPlyY96qazIr82Xd3+SJr6vneYGODLcEo iZjjxeikkdWqzv1o043tk7YlIUeWdXvhpPYtlY5bRfi226sR7rMyfeOYBf/Y7fX/hr 75J3eN4lm4d+Yya/mEbzDGnCkp1DGP0gaPeGDBfs32kioL2BxlosXYJ5sCuse9ERKV Ct4UxvoUzuhuw== Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7525A62D0E for ; Thu, 6 Oct 2022 15:18:00 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="NdoEIFPy"; dkim-atps=neutral Received: by mail-wr1-x431.google.com with SMTP id bk15so2645600wrb.13 for ; Thu, 06 Oct 2022 06:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=EYXhUS5A+XqtUQmt61JKtz8Dby+AR9H2er9xdgsAi7Y=; b=NdoEIFPyLUZXHL9ZUGBg0SLLDunCZtHB1i3C1vRGincHYKNaNTXMI2QN+eBURFiDWX VLgcXmQQsU69Vc70cdZlpMoQGK9NDSR6uNkQQbVJd79ZJa7ddX4drXFB2lKOjJ29/VYO CW2lCib7RDUDv5as/xd1oBZZYcJfTb7sejHWc2hSzvhSLjdCzZHiirGxuXjOeMtFP0qT BZIh6GWzqdut82mHj2NKco3UkHv6g+gWevjWzvMqdDU8Knw+QfddPBt+X2nauPFbX1VV kZ4Kozq7y7exM5haCu+r9LI1Chy1ox245ErK+ll4yTxPyk41GQcmsiBp3h8LIyhfxcR7 2RNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=EYXhUS5A+XqtUQmt61JKtz8Dby+AR9H2er9xdgsAi7Y=; b=YcZwjcJsqrlUbWKDPK3eQUsMCPP+vm6X2n4L+ZqeiwKXh1eIV6QlDkRThBymsxT9O5 0PlewRdG/HDKgHzFV0BCbRllnQewkNdGAXHXxfxIAKplcMhJJbW6Md/Fb5u3wA3lmoD5 HTgo5hcKZQT+Q4ENrPWQ+WQeAdbwjTF9O9HEpMzHLv6gjHOE/qRoCXLexsW7lyjW58ns ucOTzJyh40wlFDE6r+/vEwZWrl2Q8hu2V7Rws0dWURveinY7Ht2jSakE2ooVK7sYvG6E 2xOwMfDYPOoXW6GTrtsvqKvfATf/jdZ5VqmnAxUhhKLBpEI5/y1Oyj08twtpzB0HkZM/ j6fw== X-Gm-Message-State: ACrzQf3gKcbv/GY1aN/jMrl4uuChIunuOcvsiy7izPFqH3ZT9ylpUMru cfAXf2/cSFCUp007tFK7ME8gPxL7puALyw== X-Google-Smtp-Source: AMsMyM4qxrv9oyeyPFk05yg59KneACuA8rpS6HGZzt89m3ROiQ8EGwcx946CgZ/dpzWaua6Osyxt/Q== X-Received: by 2002:a05:6000:10cc:b0:22e:39a:efe4 with SMTP id b12-20020a05600010cc00b0022e039aefe4mr3287997wrx.256.1665062279903; Thu, 06 Oct 2022 06:17:59 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id q18-20020a056000137200b0022cc7c32309sm17986049wrz.115.2022.10.06.06.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 06:17:59 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 6 Oct 2022 14:17:42 +0100 Message-Id: <20221006131744.5179-9-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221006131744.5179-1-naush@raspberrypi.com> References: <20221006131744.5179-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 08/10] ipa: raspberrypi: Add line length to DeviceStatus 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a lineLength field to the DeviceStatus structure to store the line length used for a particular frame. Signed-off-by: Naushir Patuck Tested-by: Dave Stevenson Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/device_status.cpp | 1 + src/ipa/raspberrypi/controller/device_status.h | 4 +++- src/ipa/raspberrypi/raspberrypi.cpp | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp index 2360a77bf1ea..c907efdd7511 100644 --- a/src/ipa/raspberrypi/controller/device_status.cpp +++ b/src/ipa/raspberrypi/controller/device_status.cpp @@ -12,6 +12,7 @@ std::ostream &operator<<(std::ostream &out, const DeviceStatus &d) { out << "Exposure: " << d.shutterSpeed << " Frame length: " << d.frameLength + << " Line length: " << d.lineLength << " Gain: " << d.analogueGain; if (d.aperture) diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h index 8f74e21b0c6e..4384c2149589 100644 --- a/src/ipa/raspberrypi/controller/device_status.h +++ b/src/ipa/raspberrypi/controller/device_status.h @@ -19,7 +19,7 @@ struct DeviceStatus { DeviceStatus() : shutterSpeed(std::chrono::seconds(0)), frameLength(0), - analogueGain(0.0) + lineLength(std::chrono::seconds(0)), analogueGain(0.0) { } @@ -29,6 +29,8 @@ struct DeviceStatus { libcamera::utils::Duration shutterSpeed; /* frame length given in number of lines */ uint32_t frameLength; + /* line length for the current frame */ + libcamera::utils::Duration lineLength; double analogueGain; /* 1.0/distance-in-metres, or 0 if unknown */ std::optional lensPosition; diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index b6289f151677..c8e15f2b04d1 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -1108,7 +1108,9 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls) int32_t exposureLines = sensorControls.get(V4L2_CID_EXPOSURE).get(); int32_t gainCode = sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get(); int32_t vblank = sensorControls.get(V4L2_CID_VBLANK).get(); + int32_t hblank = sensorControls.get(V4L2_CID_HBLANK).get(); + deviceStatus.lineLength = helper_->hblankToLineLength(hblank); deviceStatus.shutterSpeed = helper_->exposure(exposureLines, mode_.minLineLength); deviceStatus.analogueGain = helper_->gain(gainCode); deviceStatus.frameLength = mode_.height + vblank;