From patchwork Mon Oct 3 08:39:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17493 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 2BBC1C3286 for ; Mon, 3 Oct 2022 08:40:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 933D462CF6; Mon, 3 Oct 2022 10:40:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664786407; bh=yp1Ca44TUrCliyF0MFAjwGlo++S33jpIAjzO0B6VpRU=; 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=OjFe1t2XF2rJZAQXdhpMzikCr7355kcMVz17Z5RHcD39zXaujl2GuFjt9bAkWr6Ty Q+L+CoEzy24RXtYGSqJb06gKHMwITCZg26o2HXtobQtuiU2sFQrFEp/FYMM406OP3i PtdvSIMygufxjg8uUr3vBSOm2R+VhK8CvsTs/NJQElFqR3/Eq2VNhfjiL0DL/rucS3 x7wbacXWZ0ajv3AXtPtcPSsmeONHDkwFtD/tsrGcpxXKWebSRvitADZ7OrpsyOD8Lm 4HRptnEqggl/CqWhMS/2UD8E/k9t87FFHSt9mu9pWxydFZk7MoVzzKUhaHoxX60eSW 8v5Zt+ZaM9xYA== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EB3E562CE2 for ; Mon, 3 Oct 2022 10:40:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Uj+qw7RB"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id iv17so6536009wmb.4 for ; Mon, 03 Oct 2022 01:40:01 -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=rXNz/fXg9imuWnncnruQtP1N4L91amcYsLTGIkaMrUg=; b=Uj+qw7RB0sVlK86rryO5wmhFIQnbKA2oGDEwhQj0OSxwtZ2njfHuhFfqUfnJerPPaS VsmVKoDyPpdJxcB/idHF0H7H0TmZb6wJNeZFSK8dhGCQYqB13H88U58qgQ83RjaJDG7F XpWTG0SL5uplo5+/1dyG2E1tNxL16tYMTvL+rePiFkLhDM+0Dl4VPMXFEODmQCqWX08h e/6mMXHvUFGGFDTZrpq3BNnJHwzcWojfLwE7yEY5iAnRGD0i8BuPzFERahn05pa/3D/I Xsh6rZDdEmAI7lXbc4Y+rdkz6DAxKz/KmPirrUwk/+dqp4MSLud7nLiUHFwfUrQx3NXu aWzQ== 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=rXNz/fXg9imuWnncnruQtP1N4L91amcYsLTGIkaMrUg=; b=mjmGUavMRoT4df1KM96XdAsXPzSo+bD+M/K+lelJEP8rPxULpsZ/iGiGciohWdxBj9 sVzCR9M9BBS71kaV1rEC8gO7quK3266WKBpW8tNJI4eBKV8jXJY5td03pYQuGOCd+tyD N+S0SPDBVGsLd0fdCXTT+PwlNhA641kqmXA8CR0URByHDdZRYKteWA8KxORWJQc6GPwm QUrZSlTG08oPxxn+w1zCCjUTEbyggeURwb3ofbCyWszlJh56XDaZpgnPIZOMVhNuyKyl WEOhC4HIOYu/xWV3NYptH8WRdYc69t3OKY3/xHJ5mDPv3yAgmHWvLQ3CNmXZj872Ar27 sqcA== X-Gm-Message-State: ACrzQf3ZT0ic3LqFgwJLCR/d4Sb6DAmhfbrl4XTpLHAjizPFTyARgW/2 RAh7iStUH2h1jmEt5eopYB83REV4YbfkHw== X-Google-Smtp-Source: AMsMyM5VCPjYUWZ+dqtSzAvrPxyEk6ZQA+VduFzSRA9ldl4r/h2BnFKOBFcqohGn+WQlCrGqTf0QNA== X-Received: by 2002:a7b:ca46:0:b0:3b4:7ff2:1ca8 with SMTP id m6-20020a7bca46000000b003b47ff21ca8mr6113957wml.11.1664786401468; Mon, 03 Oct 2022 01:40:01 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id i13-20020a5d55cd000000b0022ae59d472esm8922787wrw.112.2022.10.03.01.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 01:40:00 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 3 Oct 2022 09:39:32 +0100 Message-Id: <20221003083934.31629-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003083934.31629-1-naush@raspberrypi.com> References: <20221003083934.31629-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 6/9] 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 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..5d6b22ef6813 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 = (mode_.width + hblank) * (1.0s / mode_.pixelRate); deviceStatus.shutterSpeed = helper_->exposure(exposureLines, mode_.minLineLength); deviceStatus.analogueGain = helper_->gain(gainCode); deviceStatus.frameLength = mode_.height + vblank;