From patchwork Tue Oct 18 23:13:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 17624 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 F2DC1BD16B for ; Tue, 18 Oct 2022 23:13:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2CB7660C15; Wed, 19 Oct 2022 01:13:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666134801; bh=zbuFwqz2tRAl/0Xzb1SXDQnPkkIZ4trQ+aqRS6kzZtE=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=khJynRo0Si8D3b7todnPP8RGkP9adDZWWpCvPjgryVLwyMmp2vNMsGNdzwjDZ+XvA M7UmRPmrPX0vd1nPX95gAAPF6M4djNyg7ryDM61fbdInyByRLT/7Yp41VwxAIBma+W 5R7j0pgI3J99mwbtGXhLTRpdpxgvxA0/7SN4xPh8jqdxvAUxhmrvw6mQgj2+ghjVgp vxPXlXtKXbNK4E34cGDONJLPE95/fVJpoN/2amBsMJZEyXUWjHBf+Yp3c1iLAJf4un k7elSCjXdYiZnS6ERC971SmDKSkpiN3UYK9PPb/57z4WlX30m6zGSpgXXYTzaHJtM5 yaaXv4zOugx1A== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E5E5F604DC for ; Wed, 19 Oct 2022 01:13:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="M7QyRKxB"; dkim-atps=neutral Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 52AFA5A4; Wed, 19 Oct 2022 01:13:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1666134798; bh=zbuFwqz2tRAl/0Xzb1SXDQnPkkIZ4trQ+aqRS6kzZtE=; h=From:To:Cc:Subject:Date:From; b=M7QyRKxBpib9U0jH7+iF7bY9lD4V5/v2rgCjAH3C2xIZ8XLAJGFuUeMg1IsMAfAzL rpWhdCIMrcDNzXsepQ/sQnM3JKKtYJz+haJxPbIWyIfsfYCMC+10aokeG9lWrbtY9M BU9L078aPsefluB7yjH9aB3IWamtsiQPhyt7m3ak= To: libcamera devel Date: Wed, 19 Oct 2022 00:13:13 +0100 Message-Id: <20221018231313.2242268-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [IPU3-IPA PATCH] ipu3: ipa: Update to latest IPACameraSensorInfo 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: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" In libcamera commit e5fc0132f80d ("camera_sensor: Add minimum and maximum line length to IPACameraSensorInfo"), the IPU3 IPA interface is updated to provide both minimum and maximum line lengths, replacing the existing lineLenght field. Update the ipu3-ipa to use IPACameraSensorInfo::minLineLength instead of IPACameraSensorInfo::lineLength, as logically we will always want to use the fastest sensor readout by default. Signed-off-by: Kieran Bingham Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- aiq/aiq_input_parameters.cpp | 2 +- ipu3.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aiq/aiq_input_parameters.cpp b/aiq/aiq_input_parameters.cpp index 7a6a1fac8a37..1639b61b1831 100644 --- a/aiq/aiq_input_parameters.cpp +++ b/aiq/aiq_input_parameters.cpp @@ -79,7 +79,7 @@ void AiqInputParameters::reset() int AiqInputParameters::configure(const IPAConfigInfo &configInfo) { sensorDescriptor.pixel_clock_freq_mhz = configInfo.sensorInfo.pixelRate / 1000000; - sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.lineLength; + sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.minLineLength; sensorDescriptor.line_periods_per_field = configInfo.sensorInfo.minFrameLength; sensorDescriptor.line_periods_vertical_blanking = 106; /* default */ //INFO: fine integration is not supported by v4l2 diff --git a/ipu3.cpp b/ipu3.cpp index 7ecd377346f0..f3c65c7c142d 100644 --- a/ipu3.cpp +++ b/ipu3.cpp @@ -118,7 +118,7 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo, * exposure min, max and default and convert it from lines to * microseconds. */ - double lineDuration = sensorInfo.lineLength / (sensorInfo.pixelRate / 1e6); + double lineDuration = sensorInfo.minLineLength / (sensorInfo.pixelRate / 1e6); const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second; int32_t minExposure = v4l2Exposure.min().get() * lineDuration; int32_t maxExposure = v4l2Exposure.max().get() * lineDuration;