From patchwork Thu Nov 25 05:42:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 14764 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 3AC17BF415 for ; Thu, 25 Nov 2021 05:43:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 92D4660394; Thu, 25 Nov 2021 06:43:11 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DyLEn4KP"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7548C60233 for ; Thu, 25 Nov 2021 06:43:04 +0100 (CET) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:d9a5:5e40:3323:d95]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 30C9A90E; Thu, 25 Nov 2021 06:43:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637818984; bh=6pybVIYFXVd1SgQSEoyDZDyd/ijoQp2Fy/E09A9+tuw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DyLEn4KPAw+EKuZGxzLiMQXlsRktXdtRP/nLk7y7bh6YpMYWazXFNgvOA/86H2a4r i+J53CVxcP/e7ApYsCIsrHBlY+6yOm/Gt3u4i9my6pEmj5FVfM5mdKjkBQm78d8IcF mK28ufWKNrmhseGSmDzJS1w4FTa9LaHvxzEqMcNU= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 25 Nov 2021 06:42:51 +0100 Message-Id: <20211125054259.24792-4-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211125054259.24792-1-jeanmichel.hautbois@ideasonboard.com> References: <20211125054259.24792-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 03/11] ipa: Do not modify the sensor limits 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The driver is responsible for setting the proper limits for its controls. The IMX219 has an analogue gain of 1.0 when the gain code is set to 0, therefore we can not clamp to a minimum gain code of 1. Rework this for both IPU3 and RkISP1, for both Exposure and Gain controls. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/ipa/ipu3/ipu3.cpp | 4 ++-- src/ipa/rkisp1/rkisp1.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index a8d54a5d..b0c75541 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -444,11 +444,11 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo, return -EINVAL; } - minExposure_ = std::max(itExp->second.min().get(), 1); + minExposure_ = itExp->second.min().get(); maxExposure_ = itExp->second.max().get(); exposure_ = minExposure_; - minGain_ = std::max(itGain->second.min().get(), 1); + minGain_ = itGain->second.min().get(); maxGain_ = itGain->second.max().get(); gain_ = minGain_; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 7ecbf8ae..910ad952 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -139,11 +139,11 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info, autoExposure_ = true; - minExposure_ = std::max(itExp->second.min().get(), 1); + minExposure_ = itExp->second.min().get(); maxExposure_ = itExp->second.max().get(); exposure_ = minExposure_; - minGain_ = std::max(itGain->second.min().get(), 1); + minGain_ = itGain->second.min().get(); maxGain_ = itGain->second.max().get(); gain_ = minGain_;