From patchwork Wed Jun 7 10:00:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18716 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 CE732C328F for ; Wed, 7 Jun 2023 10:01:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B361362894; Wed, 7 Jun 2023 12:01:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686132067; bh=MRgLHUxFO8buWPu4AEhUvy/IRKXu8f7unVxNVXBNShg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qnvX/P919xCVNssI0SCn966A/v13o7JwW05kVSrxpE5GAIvyBykWwrgL51aVNnww6 /QFFqihLZZmWgv5hdOtpH0N6NPMvWKQaT8v1KUB2ICOqTXRBunQTkkmRUD7yjlzO7Z Ima4fCQJ/Cdoohz3A41wH7h8AdOEDSTMUk3g4zu+OGdPzDPBAZUaM3MPf2NVqdE4Yy 8sx+CaOXRB1poDkA94sNnAXU5e5JzR5xWqpANm6c9WPutvXYAsM0Y0u82/oc5YRU7U wY89cSE75NMqQxHUUpMP4dA/aDqymvEJgrNGfPi/W2NcxEB93d9eWGHFp2sJ+crHgz 2CeHNeHioQYsQ== 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 48CEA60579 for ; Wed, 7 Jun 2023 12:01:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="oeaD4RO2"; dkim-atps=neutral Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f6da07ff00so71992405e9.3 for ; Wed, 07 Jun 2023 03:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1686132065; x=1688724065; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7tnM6woDwDZQwegs4k3OcD6JK0jSuXKj5pk0MqLrt1E=; b=oeaD4RO2Ps314ULDDtR7vJpwbiNXk+HOKj0ZkjjTicw6p84ANE88x7VgAKXY3k9SKM 4U+ijFhjnKEspuaVn/+ew5ONb91rReGdi26geElaA6kkjW8yGxv+HgYP3x/m0mr7N/JX 1mOTZhM1YSay8TN2OXbKAn+fOLY56bIlUKVpQZS4q114GG05iwXWYM1FH49M+pVcvY6d j15v0U2fEFwV1EEE+E7BNXvsPo7SblxOywi0i3pIHVRz5D+yzdaBhxbXk/ksmQxI5oBl TWrSReG/G1jwDAuuA25zPka7wKqc/yY6a7O2K/NcJHt8f+FB3LU22mzgs4GvjXJk1ohC /YyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686132065; x=1688724065; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7tnM6woDwDZQwegs4k3OcD6JK0jSuXKj5pk0MqLrt1E=; b=RIG4q77k+wMa+TSWYeS5AMHjqK13oe5OE7G1pj57tx4aAcOyp57EmHTlRVwnKofSBz QT+QgP60n9T319CJXQfwxT3d2CDxQG3vWGTNpansEBlATYlMf7gfheD2czua1MiIk7co GWlayl6+79G2tdB/PrcORLxT6BI+P0prgdPCLALcRJCXUUV6PxJ8XplloLG8tdewIs/N d86A2l5jEw9M0+vOtJRiUJmQW2Ze2yp0BuTKRj3sHHIZ/RdC08QFDm1Pzk1pS+FzxeKa 16FVA5x2IpEkDudseBZZxAiGtmydXOVSSx8qBOMUPxH5wtBugZ6qpedfTy+KZvf/3Xjj FEqg== X-Gm-Message-State: AC+VfDzkYB4HJrQa/lKk9LGDV0EYuWjU3RrIUak/JDO1x2yeYsm1ECwm 4AduK37i0zglMpxl9i/DzVujmHtb4zv5rIyw0NfxzA== X-Google-Smtp-Source: ACHHUZ4Na2qQmMix6Fez+YOT9Hvkf6k6IunEfGB6yIomE9i1+arX8KgGdvGAYkPQOoUSDKnY/ik6hQ== X-Received: by 2002:a05:600c:2252:b0:3f6:962d:405c with SMTP id a18-20020a05600c225200b003f6962d405cmr5018992wmm.41.1686132065627; Wed, 07 Jun 2023 03:01:05 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id t7-20020a1c7707000000b003f6cf9afc25sm1556889wmi.40.2023.06.07.03.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 03:01:04 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Jun 2023 11:00:52 +0100 Message-Id: <20230607100054.4576-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607100054.4576-1-naush@raspberrypi.com> References: <20230607100054.4576-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 1/3] ipa: rpi: tunings: Add missing short and long exposure profiles 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some sensor tuning files were missing the short and/or long exposure mode profiles. Add the missing items to the relevant files. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham --- src/ipa/rpi/vc4/data/imx290.json | 5 +++++ src/ipa/rpi/vc4/data/imx296.json | 5 +++++ src/ipa/rpi/vc4/data/imx296_mono.json | 5 +++++ src/ipa/rpi/vc4/data/imx378.json | 5 +++++ src/ipa/rpi/vc4/data/imx519.json | 5 +++++ src/ipa/rpi/vc4/data/imx708.json | 5 +++++ src/ipa/rpi/vc4/data/imx708_noir.json | 5 +++++ src/ipa/rpi/vc4/data/imx708_wide.json | 5 +++++ src/ipa/rpi/vc4/data/imx708_wide_noir.json | 5 +++++ src/ipa/rpi/vc4/data/ov9281_mono.json | 10 ++++++++++ src/ipa/rpi/vc4/data/se327m12.json | 5 +++++ src/ipa/rpi/vc4/data/uncalibrated.json | 10 ++++++++++ 12 files changed, 70 insertions(+) diff --git a/src/ipa/rpi/vc4/data/imx290.json b/src/ipa/rpi/vc4/data/imx290.json index ace68d0ebf1c..bcf9189b0008 100644 --- a/src/ipa/rpi/vc4/data/imx290.json +++ b/src/ipa/rpi/vc4/data/imx290.json @@ -74,6 +74,11 @@ { "shutter": [ 10, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx296.json b/src/ipa/rpi/vc4/data/imx296.json index ae8722c46a85..9330d0a9c81f 100644 --- a/src/ipa/rpi/vc4/data/imx296.json +++ b/src/ipa/rpi/vc4/data/imx296.json @@ -157,6 +157,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 30000 ], "gain": [ 1.0, 2.0, 4.0, 8.0, 16.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx296_mono.json b/src/ipa/rpi/vc4/data/imx296_mono.json index db020550d70e..955af43cccff 100644 --- a/src/ipa/rpi/vc4/data/imx296_mono.json +++ b/src/ipa/rpi/vc4/data/imx296_mono.json @@ -60,6 +60,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx378.json b/src/ipa/rpi/vc4/data/imx378.json index 8b4ed22504b5..f7b68011b634 100644 --- a/src/ipa/rpi/vc4/data/imx378.json +++ b/src/ipa/rpi/vc4/data/imx378.json @@ -155,6 +155,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx519.json b/src/ipa/rpi/vc4/data/imx519.json index 8ccfd3a631ff..1b0a77476aab 100644 --- a/src/ipa/rpi/vc4/data/imx519.json +++ b/src/ipa/rpi/vc4/data/imx519.json @@ -155,6 +155,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx708.json b/src/ipa/rpi/vc4/data/imx708.json index b9830a3bf692..6b26d0a19609 100644 --- a/src/ipa/rpi/vc4/data/imx708.json +++ b/src/ipa/rpi/vc4/data/imx708.json @@ -165,6 +165,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx708_noir.json b/src/ipa/rpi/vc4/data/imx708_noir.json index 075f70355cec..8d498153833b 100644 --- a/src/ipa/rpi/vc4/data/imx708_noir.json +++ b/src/ipa/rpi/vc4/data/imx708_noir.json @@ -165,6 +165,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx708_wide.json b/src/ipa/rpi/vc4/data/imx708_wide.json index b772efee3b96..14bc918e7823 100644 --- a/src/ipa/rpi/vc4/data/imx708_wide.json +++ b/src/ipa/rpi/vc4/data/imx708_wide.json @@ -155,6 +155,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/imx708_wide_noir.json b/src/ipa/rpi/vc4/data/imx708_wide_noir.json index c5f6b53dca7a..49442c0f9d81 100644 --- a/src/ipa/rpi/vc4/data/imx708_wide_noir.json +++ b/src/ipa/rpi/vc4/data/imx708_wide_noir.json @@ -155,6 +155,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 6.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/ov9281_mono.json b/src/ipa/rpi/vc4/data/ov9281_mono.json index 37944c63ad92..2b7292ec7e20 100644 --- a/src/ipa/rpi/vc4/data/ov9281_mono.json +++ b/src/ipa/rpi/vc4/data/ov9281_mono.json @@ -44,6 +44,16 @@ { "shutter": [ 100, 15000, 30000, 60000, 120000 ], "gain": [ 1.0, 2.0, 3.0, 4.0, 8.0 ] + }, + "short": + { + "shutter": [ 100, 5000, 10000, 20000, 30000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/se327m12.json b/src/ipa/rpi/vc4/data/se327m12.json index ee69caea50c0..8552ed92bce6 100644 --- a/src/ipa/rpi/vc4/data/se327m12.json +++ b/src/ipa/rpi/vc4/data/se327m12.json @@ -155,6 +155,11 @@ { "shutter": [ 100, 5000, 10000, 20000, 120000 ], "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": diff --git a/src/ipa/rpi/vc4/data/uncalibrated.json b/src/ipa/rpi/vc4/data/uncalibrated.json index 13eb3f177302..7654defa6dfe 100644 --- a/src/ipa/rpi/vc4/data/uncalibrated.json +++ b/src/ipa/rpi/vc4/data/uncalibrated.json @@ -31,6 +31,16 @@ { "shutter": [ 100, 15000, 30000, 60000, 120000 ], "gain": [ 1.0, 2.0, 3.0, 4.0, 6.0 ] + }, + "short": + { + "shutter": [ 100, 5000, 10000, 20000, 30000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 8.0 ] + }, + "long": + { + "shutter": [ 1000, 30000, 60000, 90000, 120000 ], + "gain": [ 1.0, 2.0, 4.0, 6.0, 12.0 ] } }, "constraint_modes": From patchwork Wed Jun 7 10:00:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18717 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 95DF9C31E9 for ; Wed, 7 Jun 2023 10:01:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4A7B0628A0; Wed, 7 Jun 2023 12:01:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686132070; bh=tu4bRmcEaQqNlcxtWPbaL9tphuQr8mmI66go/+RstpY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xWkYSvxTu3xG4/6aIsXkYDdaBkKDRZhnxcremSEytEPvNxs9q7g5sIX5pgpQ0GLBd EqgxAjZQ7mX68ZZaygx3SpY49tKtqv5JQFCefxy80DYBjxHNCh3rbhKNQ5imzsKh+E 4OwJDisujyK3LrmaxJ7EQZpqIKYVSA3Ultfi4CLCqXv9gyRdraSPpEr11JZPCMUK+z ScGi7gZqpg1a1NLdJNPG7vcRxTbkix95gAN0VV6quDrCG6Y0fo2tQe7rqYpQCniKj+ 9HhZZ3S3s2aHqZTngmQg8SXSTKX4rvJOsRuvQCOyNYgL1lTwWcj+UwRpzRkA5VAoid 8QHRMvNdva9pg== Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2374562899 for ; Wed, 7 Jun 2023 12:01:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="QoQM82zy"; dkim-atps=neutral Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f735bfcbbbso31572725e9.2 for ; Wed, 07 Jun 2023 03:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1686132066; x=1688724066; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fdSQojxheQYTuQ2xidXZl7R5UCmxPlHXljHGiv5RCeY=; b=QoQM82zyHkok+d0UzA9QhxSLkIinN8ILmRbne1nOFe8AWimVl5bSNpBqbAMa601bNL N/V7qTnOL/kycDQfo+tCcVwEcF4CXwLOjjqyFVftvE0X/P7cDSeMldrDVjqYKhV3vu9a +dkdrlY/sGrgGweq7u813d6zNmgJ0tMLzOPQ1+t0CNrhx28Wi9mktDuuNXBgq0H1H7m8 OU4BhLr8z1kPGqFpkGKOnmzsg51OwecMLem4JpEzSa9tqDB95KK82sRvzNyw8e+gHx4Q vJnu1O6N5tiQqfBkRt6rSnwFcm1yoL4H8o1yRx00yajUZc99D1o55yD4xwXoxNcsWvrO zD6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686132066; x=1688724066; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fdSQojxheQYTuQ2xidXZl7R5UCmxPlHXljHGiv5RCeY=; b=l+xxvfNMKNLilIWWKq4qPU5Ygqq+t3xDXC9eAvtuGMSDx/9sBcvP70ZcAZfMhZlMbh LqbeO6OG5u1tqBtpJqu23JyxLZCZVb1dzLTT/8Sx9KDyi8lhc7d29us76H0lPqh81PSh tp/N44MRILcz3t7Hx93u62gULps7i+vnLoaUnneLI2u03uG28EfiYUqJTyCmnNtNa4gW qdQHvMyifRN7nAukwRMoI2Zp7XHnuHzPjLXapeR8DO9ul2LTbh1n0Y3nc4WlD0TjcxcH KxM0crA/thzMAtm6vES0hshvLROm5mMBQGEODJXn7cYS+LxAQcB+cil/WdD+HKql5VG6 MCwA== X-Gm-Message-State: AC+VfDzw5FrJTmbqc8NK9wuEl9Bk6R36Azl5Cya1YWnEXvx/7F9G3WdP X3fr6/dT9SZZG+E35dOqqiwBHnDWUFDEyeUN7MaDrQ== X-Google-Smtp-Source: ACHHUZ67CqYgA93SCMdYrFfjcYqW/HhxFRjfefAYtvpb0+WCZ5MOR3op5tP7OMdacJw1+WFY4T/k5g== X-Received: by 2002:a05:600c:2257:b0:3f6:f152:1183 with SMTP id a23-20020a05600c225700b003f6f1521183mr4197229wmm.37.1686132066444; Wed, 07 Jun 2023 03:01:06 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id t7-20020a1c7707000000b003f6cf9afc25sm1556889wmi.40.2023.06.07.03.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 03:01:05 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Jun 2023 11:00:53 +0100 Message-Id: <20230607100054.4576-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607100054.4576-1-naush@raspberrypi.com> References: <20230607100054.4576-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 2/3] ipa: rpi: agc: Use std::string instead of char arrays 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Replace the char array strings in struct AgcStatus with std::string objects. This simplifies the string handling in the source code. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/rpi/controller/agc_status.h | 8 +++++--- src/ipa/rpi/controller/rpi/agc.cpp | 23 +++++++---------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/ipa/rpi/controller/agc_status.h b/src/ipa/rpi/controller/agc_status.h index 6abf09d9df57..6c112e76aa12 100644 --- a/src/ipa/rpi/controller/agc_status.h +++ b/src/ipa/rpi/controller/agc_status.h @@ -6,6 +6,8 @@ */ #pragma once +#include + #include /* @@ -24,9 +26,9 @@ struct AgcStatus { libcamera::utils::Duration targetExposureValue; /* (unfiltered) target total exposure AGC is aiming for */ libcamera::utils::Duration shutterTime; double analogueGain; - char exposureMode[32]; - char constraintMode[32]; - char meteringMode[32]; + std::string exposureMode; + std::string constraintMode; + std::string meteringMode; double ev; libcamera::utils::Duration flickerPeriod; int floatingRegionEnable; diff --git a/src/ipa/rpi/controller/rpi/agc.cpp b/src/ipa/rpi/controller/rpi/agc.cpp index e79c82e2e65b..b611157af1f0 100644 --- a/src/ipa/rpi/controller/rpi/agc.cpp +++ b/src/ipa/rpi/controller/rpi/agc.cpp @@ -226,7 +226,7 @@ Agc::Agc(Controller *controller) * Setting status_.totalExposureValue_ to zero initially tells us * it's not been calculated yet (i.e. Process hasn't yet run). */ - memset(&status_, 0, sizeof(status_)); + status_ = {}; status_.ev = ev_; } @@ -524,12 +524,6 @@ void Agc::updateLockStatus(DeviceStatus const &deviceStatus) status_.locked = lockCount_ == maxLockCount; } -static void copyString(std::string const &s, char *d, size_t size) -{ - size_t length = s.copy(d, size - 1); - d[length] = '\0'; -} - void Agc::housekeepConfig() { /* First fetch all the up-to-date settings, so no one else has to do it. */ @@ -544,30 +538,27 @@ void Agc::housekeepConfig() * Make sure the "mode" pointers point to the up-to-date things, if * they've changed. */ - if (strcmp(meteringModeName_.c_str(), status_.meteringMode)) { + if (meteringModeName_ != status_.meteringMode) { auto it = config_.meteringModes.find(meteringModeName_); if (it == config_.meteringModes.end()) LOG(RPiAgc, Fatal) << "No metering mode " << meteringModeName_; meteringMode_ = &it->second; - copyString(meteringModeName_, status_.meteringMode, - sizeof(status_.meteringMode)); + status_.meteringMode = meteringModeName_; } - if (strcmp(exposureModeName_.c_str(), status_.exposureMode)) { + if (exposureModeName_ != status_.exposureMode) { auto it = config_.exposureModes.find(exposureModeName_); if (it == config_.exposureModes.end()) LOG(RPiAgc, Fatal) << "No exposure profile " << exposureModeName_; exposureMode_ = &it->second; - copyString(exposureModeName_, status_.exposureMode, - sizeof(status_.exposureMode)); + status_.exposureMode = exposureModeName_; } - if (strcmp(constraintModeName_.c_str(), status_.constraintMode)) { + if (constraintModeName_ != status_.constraintMode) { auto it = config_.constraintModes.find(constraintModeName_); if (it == config_.constraintModes.end()) LOG(RPiAgc, Fatal) << "No constraint list " << constraintModeName_; constraintMode_ = &it->second; - copyString(constraintModeName_, status_.constraintMode, - sizeof(status_.constraintMode)); + status_.constraintMode = constraintModeName_; } LOG(RPiAgc, Debug) << "exposureMode " << exposureModeName_ << " constraintMode " From patchwork Wed Jun 7 10:00:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18718 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 7931AC328F for ; Wed, 7 Jun 2023 10:01:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2724E6289E; Wed, 7 Jun 2023 12:01:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686132071; bh=1QHR3dWY/MwiYLi2cYyB4VKJ3Gu++TAPUEAXFfnn3l8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ak7CATQuMkpXW4tfHGixy5vYEz+fgbU8ohgQ8KuCbOhqGoLapKPUCN7adaVfGK+lq zQB2shGr0qDKxkjWPvLg+pOOJFDjnKdpC5cpeL/ZbhM2WXlU+WzSdFzDaPZqEk8qE1 2knThWNSjENDM9l/iRE1fIQW/av4tV90KP/bbflqAQywxvCTOs0yqvHv3JPoqa8SF+ lqnYc4k1wjArw4daty33YpKcgLqs3ES/SYbQLNSDhMlMuMLg1nx8s84MvlnSu1rnjg 7dgYubCs/Vli9bM71evALvk/tLlO/HRMIRtzcHKnxBdf7RTlvs8tLRuEF+ZTGjTskS EfkH/FKdKFDiA== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 209BD6289C for ; Wed, 7 Jun 2023 12:01:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ABNyOlI6"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f6d7abe934so59962075e9.2 for ; Wed, 07 Jun 2023 03:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1686132067; x=1688724067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sxn5Q6k3mqIDixUudApfDx57EnlB3OjVXlUEML5ains=; b=ABNyOlI6AGeI4niZ5A1xoBR4JBcc+Tj65xGe+rl7AQbmygdtAunGkyqEFIbKbLBYRu QJ2PgOcZqPWdSVgPw7BqquMhggFLdQe3+mFnMvlZIu+5iBywVn3WQiucSGGSeXW6FW24 P6m9qTdYHgr4ZbuER27vYltsZVWrxm4KQIaj6TSSOWBQ+IFwR+6JILEXVRCUWAqAowNi tsQ4MlKg3SpSPYY2By/enmtw/snzcjaT6oMD7aeASMIWCieHhu4naKzXuJ/5F5cqm1ox YyXYPPUJPIqhNIdvwP+BZxlVLJ9VtZv9+oFL/Tr0R9W0vOz0ha669V8NIPp+KNyN7QiB vh8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686132067; x=1688724067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sxn5Q6k3mqIDixUudApfDx57EnlB3OjVXlUEML5ains=; b=i7qcshU+zWghWM6nGaNrGbQ4MjEdjiuIVPZa19bxYeImCI/8RJFiYBiCb8YFh/Z8E6 6XUshEpW6BQDmEMo3K9tAeKj5hSv2efotUY5T+vcCPZ5zK9ulPOB+fQzQD1sut1PDEKm 0ni00w+dck4rFdPplGZcw4gwpSyEtmKmc3oy0izJLPi+FYBnVhTWnUR79t4BJxEMujZV nzFjuBTATB8rAuFRJicksedgeO+1kyRsYAr3wiizhedVcyJaHBJfra6M9f5Qi0ZsnCOd g7DnMr+LRzUsnSplotwcNR5Q6zyPFuCqckFJ/f7Oo+MaQqJroHHadJbWDONIbO/f3PGS LApg== X-Gm-Message-State: AC+VfDz3XVHHbAtDS4a9NkyNMbNCDTp4YOWXy5inUAB1h7Z/KKXij6Uv wmWuNMz60EhLnOhEwkIGKVsiOHDlmqBd7mP7uYshhg== X-Google-Smtp-Source: ACHHUZ45j/LjvOFNfWHViyN7f6mWDHT3TguLblhbNviU7tE3YDLIogQLr/jDuohSlyZJc2J+e9vitA== X-Received: by 2002:a05:600c:2258:b0:3f4:298f:4d01 with SMTP id a24-20020a05600c225800b003f4298f4d01mr4219532wmm.26.1686132067295; Wed, 07 Jun 2023 03:01:07 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id t7-20020a1c7707000000b003f6cf9afc25sm1556889wmi.40.2023.06.07.03.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 03:01:06 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Jun 2023 11:00:54 +0100 Message-Id: <20230607100054.4576-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607100054.4576-1-naush@raspberrypi.com> References: <20230607100054.4576-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 3/3] ipa: rpi: agc: Gracefully handle missing agc modes 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If a metering/exposure/constraint mode is not listed in the sensor tuning file, and a control for the missing mode is set on the agc, we terminate the application with a fatal log message. Instead of this fatal termination, log a warning message and switch to the appropriate default mode so that the application continues running. Reported-on: https://github.com/raspberrypi/libcamera/issues/59 Reported-on: https://github.com/ayufan/camera-streamer/issues/67 Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/rpi/controller/rpi/agc.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/ipa/rpi/controller/rpi/agc.cpp b/src/ipa/rpi/controller/rpi/agc.cpp index b611157af1f0..1b05d478818e 100644 --- a/src/ipa/rpi/controller/rpi/agc.cpp +++ b/src/ipa/rpi/controller/rpi/agc.cpp @@ -540,24 +540,36 @@ void Agc::housekeepConfig() */ if (meteringModeName_ != status_.meteringMode) { auto it = config_.meteringModes.find(meteringModeName_); - if (it == config_.meteringModes.end()) - LOG(RPiAgc, Fatal) << "No metering mode " << meteringModeName_; - meteringMode_ = &it->second; + if (it == config_.meteringModes.end()) { + LOG(RPiAgc, Warning) << "No metering mode " << meteringModeName_ + << ", defaulting to " << config_.defaultMeteringMode; + meteringModeName_ = config_.defaultMeteringMode; + meteringMode_ = &config_.meteringModes[meteringModeName_]; + } else + meteringMode_ = &it->second; status_.meteringMode = meteringModeName_; } if (exposureModeName_ != status_.exposureMode) { auto it = config_.exposureModes.find(exposureModeName_); - if (it == config_.exposureModes.end()) - LOG(RPiAgc, Fatal) << "No exposure profile " << exposureModeName_; - exposureMode_ = &it->second; + if (it == config_.exposureModes.end()) { + LOG(RPiAgc, Warning) << "No exposure profile " << exposureModeName_ + << ", defaulting to " << config_.defaultExposureMode; + exposureModeName_ = config_.defaultExposureMode; + exposureMode_ = &config_.exposureModes[exposureModeName_]; + } else + exposureMode_ = &it->second; status_.exposureMode = exposureModeName_; } if (constraintModeName_ != status_.constraintMode) { auto it = config_.constraintModes.find(constraintModeName_); - if (it == config_.constraintModes.end()) - LOG(RPiAgc, Fatal) << "No constraint list " << constraintModeName_; - constraintMode_ = &it->second; + if (it == config_.constraintModes.end()) { + LOG(RPiAgc, Warning) << "No constraint list " << constraintModeName_ + << ", defaulting to " << config_.defaultConstraintMode; + constraintModeName_ = config_.defaultConstraintMode; + constraintMode_ = &config_.constraintModes[constraintModeName_]; + } else + constraintMode_ = &it->second; status_.constraintMode = constraintModeName_; } LOG(RPiAgc, Debug) << "exposureMode "