From patchwork Thu Feb 6 09:24:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22740 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 70149C0F2A for ; Thu, 6 Feb 2025 09:24:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 90D36685D8; Thu, 6 Feb 2025 10:24:52 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="V2ff6r3G"; dkim-atps=neutral Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F9356858E for ; Thu, 6 Feb 2025 10:24:51 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-38dc33a4426so12926f8f.1 for ; Thu, 06 Feb 2025 01:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1738833890; x=1739438690; 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=eDgxzKuvgqGWG2k8IhVaUFFuUSKlaWtvR3gM1OeIgIg=; b=V2ff6r3Gq0IV+5YbeLICvSCzLkQ/E315buOC/fnTbpWyNZ3HXGXC+Hxspczvt8vxZS pOeSGWyz9Hnw1AOSgvDoQbXlHPFXq1hM2PY/M9wLHf30kZESRjt7g6pTbmfK1Na2HUhp 9RswgOl9QoYe+3PrzpYpy7wOF2OyAZSkziPXXoZryY05WbpNQwC8HKCbP6SVlMTM+oLr UGY1heigHuegz9IPD1xDROtbPRkg0QMvHm/WnAKwOcBr+ncZjrQFvqI+HS9tKQx007WD sp/5hxSbWfruYu8G8pDXxoQHCIek0jraZK6mXfNBLWjk2Yv9iEG2YUvGNLqp4ea96BrV REmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738833890; x=1739438690; 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=eDgxzKuvgqGWG2k8IhVaUFFuUSKlaWtvR3gM1OeIgIg=; b=O1d+UUwmpYXivuXEA8VdtkukFGV6HCFBF0LxWCoUPHCqDPcRhS2d7sKt3PojXJk3A9 a1U3gBnDMICXVZrr4WTDVVgBtxfkuqaDLoz1ZiPGVRgnXbvQwBLMzW9qqOpSdrupfOwG jWFAcQtGk3MpD6xz6vjIGbqt4hFVKp59sQsFrq8ZIRZ9oCQkXLku3EaoXpWVL8MZ88Ua 4KiQVJ+tr1DgrjEgu3dWK7CDiQtwEiS/W3wrXUWgZWuMqpFA/2fkFiQ5x+JmqNSY901N QeBdA1hp6SmCXLybSw/6FZyNVdpCLNaJdfwSsGeCKtFP990exT1Se7sWUsgV4J0ddXkO HhFA== X-Gm-Message-State: AOJu0YyFXkJkQt80JaNR2Vn5mmzALTvQspUKjRbvqbAycnAfEVhWF8XN JLHvNA1ZHRL5whDibVPVqos7eB81DHtBGnb41YPqUSZY9aEn4ngaGeBOM2arKRxf3GfYo62J+NI HUWY= X-Gm-Gg: ASbGncuL7LO0eBhsMzKaaZon+KnfCivfWuQofvaIss55p/+C8UYEVDJfLneYo/Xumky 40IQ8njNzFBjjFgIPmib1Zi1RHwsP7x6OqfXeyDTaO8HhrYu/0JSWKFRbProRoinYMq213SIZ0w DD8SQZa5ftX1DDjl2HBUsKviXaHe9zmiVczGPGcAJKeBxU9ZZlF8mo1EP1ITY/6eAHOPXH6JbNz Y94KFcgITEZhIQG8S2e7ZtmIMWEASLyoXF62r4J5n+nXS4r7NVLvso1pGZGEk73BByQKxJmzQHg IQ+oDUsd3LJVgUmkVmyMUG9wVZD+hp94kH8= X-Google-Smtp-Source: AGHT+IFoFszNhyDSSKtIAM2mW0l5crkZ0rMiIBoYI4aiKa+s/mLumqNgFZGGNtEAorPZ6zCsqj1mUQ== X-Received: by 2002:a05:600c:1910:b0:42c:c0d8:bf49 with SMTP id 5b1f17b1804b1-4390d34c649mr19196575e9.0.1738833890146; Thu, 06 Feb 2025 01:24:50 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4390d933523sm49742755e9.1.2025.02.06.01.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:24:49 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v2] ipa: rpi: Apply default ControlInfo values for sensor controls Date: Thu, 6 Feb 2025 09:24:36 +0000 Message-ID: <20250206092446.36237-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 defaults defined in the IPA set during initialisation. Bug: https://bugs.libcamera.org/show_bug.cgi?id=253 Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: David Plowman --- 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..3c77665e6ab4 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(defaultMinFrameDuration.get())); ctrlMap[&controls::AnalogueGain] = ControlInfo(static_cast(mode_.minAnalogueGain), - static_cast(mode_.maxAnalogueGain)); + static_cast(mode_.maxAnalogueGain), + static_cast(defaultAnalogueGain)); ctrlMap[&controls::ExposureTime] = ControlInfo(static_cast(mode_.minExposureTime.get()), - static_cast(mode_.maxExposureTime.get())); + static_cast(mode_.maxExposureTime.get()), + static_cast(defaultExposureTime.get())); /* Declare colour processing related controls for non-mono sensors. */ if (!monoSensor_)