From patchwork Tue Feb 4 15:09:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22727 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 3AB9DC326B for ; Tue, 4 Feb 2025 15:09:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 06819685B6; Tue, 4 Feb 2025 16:09:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="PnbOFAl7"; dkim-atps=neutral Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6ED67685A7 for ; Tue, 4 Feb 2025 16:09:14 +0100 (CET) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4390935a14fso311315e9.1 for ; Tue, 04 Feb 2025 07:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1738681753; x=1739286553; 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=CRes6BlvjHxbdxCNIfDYpFLn6juH2nvOBsh8UpvKg3M=; b=PnbOFAl7LOp+NPa84sWvp2hdZC3yPOJCxNacXr4JtsOaqsOUemBIvT2Z4Vcu7jrSSE sClOsw1etGkGcha5b48//Q/LczI5NWKq0nUa9w+QooAQfgCWYwp2SntpFIgsdPKegC4N gMgAHGFfPGitvjQQDwLAnmqFCVgC/t6ulgB14v45IS0WmRwMv44cnmN1nfWRziHfmyqh uqG7lN+LiemZaPwFAmww1wIoAUYQfXv467m8QGPRNC4KTmWJhASuWc9hwPCPNE2KesX0 RS4wdiB0jg9a3O7KrFQlMVkGjvVvXyYvCOEwcUvW+nh4G12erukyaRIMh1DsS8frXjn8 y4mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738681753; x=1739286553; 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=CRes6BlvjHxbdxCNIfDYpFLn6juH2nvOBsh8UpvKg3M=; b=RG7SDr0ylPpr/y8orLA5QNnSGejiC0MtMR16hkcTaQtsKKCZ2h6jW5JtQSalWczenN VpYR0hf8XJdBzcKOs7GvKBFv44ZT23NI4uOXHNHwap5wxOdSYBUZ0mZSzbA0sKXsaPdu 3wC6MBSP+5hr98rZkT6ifsEUOO8C7dj62YlOf13R1v8/jr3HfwZyAZVv49SPes1lQHZv 4teeevMISxiJw1ZDcUf64tZEGaeCFAR2SUaXrsafR/E7PMFdsQzQgyCpXxFOVFtYGz0F Yt/BUvArHdlb1BQZ8lWd1XlmELxJQLs122lr3lqbR6KQQl/Dspqflwu1QBCRuwWeCp6r 94Ug== X-Gm-Message-State: AOJu0Yyogt7m7eqwoBcy8O5NzwKOgQAZIuCCDa08wHmfr0yDgO7LnISw coXtrHCm6++0DAd/A6RX4Q9LB0tUQIKB6euZA0qIdJxysGpjbhGusVwC3uBs45fw2OJJePbXOff dtVw= X-Gm-Gg: ASbGncuA/LXVFV7VU5uGj8biDphk7QSWy6RAQZUK7Hd+2f7Mar6T1jCoULx/bkbhYB6 zriBRoOfSsBdrJdYi/WsIDzeVOTws1uUjn/83qx2WiOnGs1hqmZJHIA8p9F2agk4stKYrflmQjP GOdrQLoUB5o7Z9StT75w8xDUz9x8CqUXrw+ha90D3jklIZli8usBwmn0h4VO1S2N8eNTWKZT6nC tA8AWBN5/9xPXiceQdJdAHPYLXy9rNPAlCsBlHoeVbOelrtUFbqtukTl3L81xh2KYVo/ENRmSR0 l3D4TKto/4wcrxbHPAxojUTjRkAo4MYU+VA= X-Google-Smtp-Source: AGHT+IGDbZ2IQdvE93yUmwB7+UW8pGUBNABWQpWwww4upMrmSRvolSqJRyrETnxoWJC+iPzhjjJlLw== X-Received: by 2002:a05:600c:3501:b0:434:f7f0:189c with SMTP id 5b1f17b1804b1-43905fe625bmr12159945e9.7.1738681753508; Tue, 04 Feb 2025 07:09:13 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438dcc12f88sm228213575e9.2.2025.02.04.07.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2025 07:09:13 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v1] ipa: rpi: Apply default ControlInfo values for sensor controls Date: Tue, 4 Feb 2025 15:09:02 +0000 Message-ID: <20250204150912.962121-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 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 existing IPA initialisation code did not set default values for some sensor related controls. This caused a crash using libcamerify when the it was trying to access the default value for controls::FrameDurationLimits as part of a recent change. Ensure controls::FrameDurationLimits, controls::AnalogueGain and controls::ExposureTime advertise default values along with the existing min/max values. The default is set to the min value. Bug: https://bugs.libcamera.org/show_bug.cgi?id=253 Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham --- src/ipa/rpi/common/ipa_base.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index bd3c22000df5..5924df4c1125 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -259,15 +259,18 @@ int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa ControlInfoMap::Map ctrlMap = ipaControls; ctrlMap[&controls::FrameDurationLimits] = ControlInfo(static_cast(mode_.minFrameDuration.get()), - static_cast(mode_.maxFrameDuration.get())); + static_cast(mode_.maxFrameDuration.get()), + static_cast(mode_.minFrameDuration.get())); ctrlMap[&controls::AnalogueGain] = ControlInfo(static_cast(mode_.minAnalogueGain), - static_cast(mode_.maxAnalogueGain)); + static_cast(mode_.maxAnalogueGain), + static_cast(mode_.minAnalogueGain)); ctrlMap[&controls::ExposureTime] = ControlInfo(static_cast(mode_.minExposureTime.get()), - static_cast(mode_.maxExposureTime.get())); + static_cast(mode_.maxExposureTime.get()), + static_cast(mode_.minExposureTime.get())); /* Declare colour processing related controls for non-mono sensors. */ if (!monoSensor_)