From patchwork Fri Apr 26 11:18:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19960 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 CE7C3C3220 for ; Fri, 26 Apr 2024 11:18:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9F23161A9B; Fri, 26 Apr 2024 13:18:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="UbK5C7fB"; dkim-atps=neutral Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 12B1A61A94 for ; Fri, 26 Apr 2024 13:18:18 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41ba1ba5591so1909125e9.1 for ; Fri, 26 Apr 2024 04:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1714130298; x=1714735098; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CKGn4xzWxKwyv9CxdgoXw6UX34fFBuMprm8x1M8OE3s=; b=UbK5C7fBLq7mMhRweJPcpUsTiM5vqxnGN32UztJgPNSUZbjO5U2Cn+BcuVn9aAbN5v tLpJG6al5ORv7Rvf3snSq7VS8WIR5Vl2nJGnvANTVtTCx3ruLYma2vda7svysugJ5n0B KeusmclAVPcn9koyYkWuUdEw6FCAj+NkGQXi8NoBTrSTEtA4IuAyL50cU33wQiMgcQ6g lzAEsVImI2lzmLDT7IvlURexKgGoVfkzqw086Yaapc81EUdLvULM9Aa/dt80sSq4kMjo 3+6+nZPMgQl0tngJUfsns+5UWpfY0mnAcwHL3Y79o6ShPN8jFiw8hAPRoQNkM/3Bl6kA vfVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714130298; x=1714735098; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CKGn4xzWxKwyv9CxdgoXw6UX34fFBuMprm8x1M8OE3s=; b=p0/W8ALfO5g/Op8q3tjOzSCsE8+XCrhzaA4ZwgBU26vPDrdunK6+tKpBn58VhB9Vql CSgEov1+Z30LQKepK1ngHNSwg9fNwiJsSnQte9+QVwJjwXaWky3bnPg/mPJYRJizJhhK uUkGVCoJHzqcbSmruJSGdZx7I1DPwEnYLo671Q/6RxOM8nrTA1wc28EKShetPXSz774F Z4U6eKOePqeynbOIftzlf2z/0PPCqKYL7WYil22UbKWasDSObTfUIWEYHZLhK8yAqD6Q 77AO8/RtpPTJ85RlX16ATI7dd7VkPO09wsx9k4NdJJNDL8EuNZHWH7qG8l+9eDPsP/F3 tgBA== X-Gm-Message-State: AOJu0Yxp1xD4GSBfDhEJqngwy/DFPWM9quJuRBKCeRgj9slR62s6q9/J 1QFaP+TpjOC4ex0TDUG0OwgBmbf4+6XbpcuKYOD7eC5RgveJy9SNPn9hOCBqn7/J5WxCBSPNp53 s X-Google-Smtp-Source: AGHT+IGljUc+d8p0TX7jXexYNvn/KqjdkWrWeoVg7k93IqOUJE6on9k2bywCpxYbqeDAl8fwSJQ8qA== X-Received: by 2002:a05:600c:a54:b0:41a:aad8:e393 with SMTP id c20-20020a05600c0a5400b0041aaad8e393mr1780400wmq.30.1714130297889; Fri, 26 Apr 2024 04:18:17 -0700 (PDT) Received: from localhost.localdomain ([188.39.149.98]) by smtp.gmail.com with ESMTPSA id r18-20020a05600c35d200b00418d434ae4esm30603601wmq.10.2024.04.26.04.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 04:18:17 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: david.plowman@raspberrypi.com, Naushir Patuck Subject: [PATCH] ipa: rpi: Fix for incorrectly reported max shutter speed Date: Fri, 26 Apr 2024 12:18:15 +0100 Message-Id: <20240426111815.10763-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 maximum shutter speed calculation in the cam-helper relied on the frame duration limits being correctly set in the cam-helper's mode structure. This was not the case on first startup, so the maximum shutter speed reported back via the ControlInfo was incorrect. Fix this by setting up the camera mode in the cam-helper before querying for the max shutter value. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Acked-by: Kieran Bingham --- src/ipa/rpi/common/ipa_base.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index 149a133ab662..1d12262bda01 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -592,6 +592,12 @@ void IpaBase::setMode(const IPACameraSensorInfo &sensorInfo) mode_.minAnalogueGain = helper_->gain(gainCtrl.min().get()); mode_.maxAnalogueGain = helper_->gain(gainCtrl.max().get()); + /* + * We need to give the helper the min/max frame durations so it can calculate + * the correct exposure limits below. + */ + helper_->setCameraMode(mode_); + /* Shutter speed is calculated based on the limits of the frame durations. */ mode_.minShutter = helper_->exposure(shutterCtrl.min().get(), mode_.minLineLength); mode_.maxShutter = Duration::max();