From patchwork Tue Jan 6 09:37:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 25629 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 5197BBDCBF for ; Tue, 6 Jan 2026 09:37:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 097E361FB9; Tue, 6 Jan 2026 10:37:39 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="faED5HZI"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A0FF4615B2 for ; Tue, 6 Jan 2026 10:37:37 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-47798089d30so724315e9.1 for ; Tue, 06 Jan 2026 01:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1767692257; x=1768297057; 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=fS2yWk1y4TLClGY36yr3ereJK+cjH7d/ALIQwrBXlQw=; b=faED5HZIie1yMTZ6jVNj3LlTfNII4im0jM69Z8CK1ga4cums3Sh54j9xQcjucvKo0Z 1LyU6sPJTfitzceTa5JrCahbqY/049rNiAsc5RWxX2fsIyd+Yffs76oX/0RysAjPvFll r0dvCHWxEeOiPNmWEPCa2seNYjXpBcWv7Mf9FppVVj9R76/f2G1l3a7KBMrO619cKVgJ GrINoWZRfIWYTUOl8RJlU0H37ub86qFzrYiZh/SdRxonywdevE7LrHT0aZ6pEcotrMXM c9pLzchOVwuBEBtRiuvm46fQwUktgUO0fwpk2eq66ER+EnoqRhZRV2iLd8gMtSKgEB9O cM3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767692257; x=1768297057; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fS2yWk1y4TLClGY36yr3ereJK+cjH7d/ALIQwrBXlQw=; b=gs+6pf4bLEIRpnK2NTz93Y8IXNEoPLa9WVyYYAQfUvypYYc/36bR/J9j5KsMCtchY1 G7AyYWmUW1JarzueiZ5/ZhDlzNQ1NQnwyDWgg3imblFSM2q31GhLKvVlUTK53JrYWUuz ME2g98H2/LNa60YOlN0NU43hrSkjsFC8H98zZCmhnZiCSt09XqMGBYoXws82jwtOu2no VvD8Bn1m2AmSE2Ci5vAExiTY7HGygodfd9Gx0zFip+QUNSHkwRFDMspGe/aDTQFMjTwv 31ubI6tjSk/EqkFGwycmQpn0VxelWwciQnARpjGQSs/n/K0yhPllYOloIvSbB0HQ2CCL zIGg== X-Gm-Message-State: AOJu0YzNetQjpk6EsiugKr4+eca6mhR8YK2/YJDG7jlx5B60Iuo6h+Fg 2tgzbNYgiQewsuBfnGK9h1PsTR15OAzVPI/CVUGGMNs+HgNFmEnUIM+6Cs/pxMNBv4nuhVXnySz jJ5Xz X-Gm-Gg: AY/fxX5GwujQuS8/MqgeYo2aKd+XqXZbb0cWfBm5YuPkk8sWaZDbjkeKAG4V/XMruRJ XGJjiO+4uqZEAydSEa7ao6LQ0G58CtyKe4Emvqj4E9PgXST+rbRw8y6i/8Qtfjd3BIuA8Ns6fIo HbLIL/ts4ZpVxAzsMjhzsSILJZ4o5bkkoCApef1p0indPDOBe8dwUz6fKSkFhHlmGEb4MwbeXOk U/vwwf6N6uAeGWDdByC8b87ZG84QJxLsAaQYuxICBF/H3RhRZTQyd/hkTAiD3pKEIBpn57ttaqr abz82FqBEO2EOtqf8eo52J50UDaXSosNeAFMfpIDdPVNWQ2G61H4dYWMobQxP+XTWw3N+YBaxYB nKJSab+A/9tihZsmkKg7R/vEOCGQr9xBM7wn6GE03xEOZ8rOOJHAY2/adykJEGC1s3/EKcOwlaj EotPwCDHh0Z9Qo1v9A7M6g0w2dx6VYhUc= X-Google-Smtp-Source: AGHT+IEU4+f6+Mrvy0//kSCcPjexh86rJofWxDYkWBo4MPDvt4a5yIOSXXcd7nwClBPp972LGRrX/w== X-Received: by 2002:a05:6000:1842:b0:431:1d4:3a6b with SMTP id ffacd0b85a97d-432bca43c7dmr1847823f8f.8.1767692256423; Tue, 06 Jan 2026 01:37:36 -0800 (PST) Received: from naush-dell.pitowers.org ([2a00:1098:3142:1f:fd0c:68a3:4cb5:ec32]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd0e16f4sm3407899f8f.11.2026.01.06.01.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 01:37:36 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , =?utf-8?b?QmFybmFiw6FzIFDFkWN6?= =?utf-8?q?e?= Subject: [PATCH v3] v4l2: v4l2_camera_proxy: Fix for getting default FrameDurationLimits Date: Tue, 6 Jan 2026 09:37:30 +0000 Message-ID: <20260106093733.161460-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.51.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 default values for controls::FrameDurationLimits is now an array but the v4l2 proxy is fetching it as a scalar value, causing a runtime error. Fix this by templating the getter with the correct Span type. This fix also requires the RPi initial default value for FrameDurationLimits to be specified as a Span. As a drive-by, remove the hard-coded 33ms min and 120ms max frame duration values in the initial defaults, and use the defaultMinFrameDuration and defaultMaxFrameDuration const values. This change is inconsequential to runtime operation as these always get overridden on the first camera configure call. Fixes: 4e9be7d11b9df ("ipa: ipu3, mali-c55, rkisp1, rpi: Fix reporting non-scalar controls") Closes: https://github.com/raspberrypi/libcamera/issues/321 Signed-off-by: Naushir Patuck Reviewed-by: Barnabás Pőcze Reviewed-by: Paul Elder Reviewed-by: David Plowman --- src/ipa/rpi/common/ipa_base.cpp | 6 ++++-- src/v4l2/v4l2_camera_proxy.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index 14aba4500ae4..322694985e72 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -84,8 +84,10 @@ const ControlInfoMap::Map ipaControls{ { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) }, { &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) }, { &controls::FrameDurationLimits, - ControlInfo(INT64_C(33333), INT64_C(120000), - static_cast(defaultMinFrameDuration.get())) }, + ControlInfo(static_cast(defaultMinFrameDuration.get()), + static_cast(defaultMaxFrameDuration.get()), + Span{ { static_cast(defaultMinFrameDuration.get()), + static_cast(defaultMinFrameDuration.get()) } }) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, { &controls::rpi::StatsOutputEnable, ControlInfo(false, true, false) }, }; diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 559ffc6170b1..03cd4810cc05 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -200,9 +200,9 @@ void V4L2CameraProxy::setFmtFromConfig(const StreamConfiguration &streamConfig) const auto &it = controls.find(&controls::FrameDurationLimits); if (it != controls.end()) { - const int64_t duration = it->second.def().get(); + Span duration = it->second.def().get>(); - v4l2TimePerFrame_.numerator = duration; + v4l2TimePerFrame_.numerator = duration[0]; v4l2TimePerFrame_.denominator = 1000000; } else { /*