From patchwork Mon Nov 2 12:11:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 28761 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 9989AC324C for ; Mon, 2 Nov 2026 12:11:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BF6C169202; Mon, 2 Nov 2026 13:11:43 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vGa6Dfyc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AD09B691EF for ; Mon, 2 Nov 2026 13:11:41 +0100 (CET) Received: from ping.linuxembedded.co.uk (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DBAF524; Mon, 2 Nov 2026 13:09:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1793621365; bh=QL+Q3uAVHHWIpFxAO0OjeXPC0/Kcw8UYDftvPOwM0so=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vGa6Dfycr4Tjj73GzqSdbt1wafG2S5KoQYAuEignXh0FC4j6OuR4H81lpFvGpAdDb krRA3F/CXr4bevS2kDvuFNEhxBtCsNLcxsPCosC7Wxwxy4jPEqE44GnU25diwc2MZE 12tOSACOLwICwp7q7T2TpM4m9TCe5rl52u5IUl5k= From: Kieran Bingham Date: Mon, 02 Nov 2026 12:11:33 +0000 Subject: [PATCH v2 1/3] libcamera: pipeline: rkisp1: Detect invalid sensor configurations MIME-Version: 1.0 Message-Id: <20261102-kbingham-orientation-v2-1-21b1cdd0d167@ideasonboard.com> References: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> In-Reply-To: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1793621500; l=1434; i=kieran.bingham@ideasonboard.com; s=20260207; h=from:subject:message-id; bh=QL+Q3uAVHHWIpFxAO0OjeXPC0/Kcw8UYDftvPOwM0so=; b=ZGngR73Q81lRcHqoVSu/X0IL04yasVXmOfEh5i7vgEobIgMgBj5I/5UFY4zUvwKb/SKGs5X0k b6HRjlmg3qeBnGDgEEcQgbLqa9xKamacxUAoVjn0mdBO57brmy7TpBg X-Developer-Key: i=kieran.bingham@ideasonboard.com; a=ed25519; pk=FVXKN7YuwHc6UtbRUeTMAmranfsQomA+vnilfglWdaY= 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" If we select a Sensor Format that is larger than the ISP capabilities the pipeline will not be able to successfully start. Detect this during validate - and report accordingly, returning an 'Invalid' state to reflect that we were not able to reconfigure to adjust to a working state in this instance. Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 39fe0f0964d7..3086ddbeef76 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -772,9 +772,21 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate() sensorFormat_ = sensor->getFormat(mbusCodes, accumulatedSensorSize, mainPath->maxResolution()); + + /* + * TODO: There doesn't seem to be a valid occasion to set the size to + * the native resolution if there was not a supported size found above. + */ if (sensorFormat_.size.isNull()) sensorFormat_.size = sensor->resolution(); + if (sensorFormat_.size > mainPath->maxResolution()) { + LOG(RkISP1, Error) + << "Sensor format size " << sensorFormat_.size + << " exceeds maximum possible size " << mainPath->maxResolution(); + return Invalid; + } + return status; } From patchwork Mon Nov 2 12:11:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 28762 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 D5654C335A for ; Mon, 2 Nov 2026 12:11:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5B2586920A; Mon, 2 Nov 2026 13:11:44 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="avsCZjTa"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D508D691F2 for ; Mon, 2 Nov 2026 13:11:41 +0100 (CET) Received: from ping.linuxembedded.co.uk (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 502731F36; Mon, 2 Nov 2026 13:09:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1793621365; bh=mjXEHVtv+ImZTQMFalbW88ygF+/S4O42Bla9w2/04cw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=avsCZjTaGLb5a3tRxXold6CJpNESmQeruVflM7glmvMHqUo0wUG5SXHNxOgxB0Scz aMOsfJYPRKwInVCwibxQUQ2M5KJYdS5ztbFYgvAtE1C265cd/FjTlFGR5yHEGkZrlX 7tUsrP+FHWi528cTy5fF449MbfkCHO8EkU/IzSuA= From: Kieran Bingham Date: Mon, 02 Nov 2026 12:11:34 +0000 Subject: [PATCH v2 2/3] libcamera: camera_sensor: Extend reporting in getFormat() MIME-Version: 1.0 Message-Id: <20261102-kbingham-orientation-v2-2-21b1cdd0d167@ideasonboard.com> References: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> In-Reply-To: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1793621500; l=2079; i=kieran.bingham@ideasonboard.com; s=20260207; h=from:subject:message-id; bh=mjXEHVtv+ImZTQMFalbW88ygF+/S4O42Bla9w2/04cw=; b=ivNYtAkc9spdEoFRJ8wxfXROO4QPU8B8Aw56Y+dxBrcwYg2ZBNhgSyPllcSw6dGkTsHgqgn85 Cy8go//CU2uD12XiIgtFvXh2UNEIUQoEy0TNbSzsJmZdlRgYowAhzJ2 X-Developer-Key: i=kieran.bingham@ideasonboard.com; a=ed25519; pk=FVXKN7YuwHc6UtbRUeTMAmranfsQomA+vnilfglWdaY= 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" When a pipeline handler asks the CameraSensor for a format, which is not achievable, it can be very helpful to the user to identify what size was requested and why it could not be provided within any constrained maximum size. This can make otherwise difficult to diagnose user errors visible and quickly correctable. Both of the CameraSensorRaw and CameraSensorLegacy are updated accordingly but that likely means these two classes could soon benefit from a more common base class to share otherwise identical code. Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- v2: - Keep log level as Debug --- src/libcamera/sensor/camera_sensor_legacy.cpp | 4 +++- src/libcamera/sensor/camera_sensor_raw.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp index 792e4b09d4fa..0e2085d91345 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -759,7 +759,9 @@ CameraSensorLegacy::getFormat(std::span mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Debug) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; } diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index 55b386cef3f3..14ab15b05ab3 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -821,7 +821,9 @@ CameraSensorRaw::getFormat(std::span mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Warning) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; } From patchwork Mon Nov 2 12:11:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 28763 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 B5BD5C324C for ; Mon, 2 Nov 2026 12:11:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6081269211; Mon, 2 Nov 2026 13:11:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="sC3fahqx"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E8F99691F3 for ; Mon, 2 Nov 2026 13:11:41 +0100 (CET) Received: from ping.linuxembedded.co.uk (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 89D492022; Mon, 2 Nov 2026 13:09:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1793621365; bh=PhVjTeqOkuP0+xFtpKqTFEW6FI4+xjj56T9zFZmL9Ew=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sC3fahqxMo0A7+cfHXXHtALbNr2Sl7AE1QNqCy8MSBJ6txgyPTrLwyUrbXJfkJutN tlk24CIU84hdfndjB/5oefaQEm1dtGcuHSgdFmbnzmjl0Uy47Zyaa0ysSiToyyJ2WJ xaaWOpX5IG2PCjGnxHmDXd501BfQosD7UQG74gyA= From: Kieran Bingham Date: Mon, 02 Nov 2026 12:11:35 +0000 Subject: [PATCH v2 3/3] apps: cam: Support full orientation options MIME-Version: 1.0 Message-Id: <20261102-kbingham-orientation-v2-3-21b1cdd0d167@ideasonboard.com> References: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> In-Reply-To: <20261102-kbingham-orientation-v2-0-21b1cdd0d167@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Jacopo Mondi , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1793621500; l=2689; i=kieran.bingham@ideasonboard.com; s=20260207; h=from:subject:message-id; bh=PhVjTeqOkuP0+xFtpKqTFEW6FI4+xjj56T9zFZmL9Ew=; b=h63ZcA2512wxKv5Hb05G67QK/d1XeaIADysDtHeRl6060lANyXmCswOs1/hpU1EhuBJI2JdWm 0vD1zeNIjVxCcIoCeNP2G8DmHxQhUh18B6AA/7V3BvR80CJMD2Lc+Y/ X-Developer-Key: i=kieran.bingham@ideasonboard.com; a=ed25519; pk=FVXKN7YuwHc6UtbRUeTMAmranfsQomA+vnilfglWdaY= 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 Orientation control was implemented in commit 7e5f1e1cedf5 ("apps: cam: Add option to set stream orientation") but did not fully add all of the supported Orientation types. The upcoming dewarp support on RkISP1 will provide full rotation implementation options, including previously difficult '90' degree rotations. Extend the cam application to support setting any of the valid options. The existing 'mirror' and 'flip' options are not consistent with the rest of the option definitions, but maintain them as useful aliases to their corresponding type. Reviewed-by: Jacopo Mondi Reviewed-by: Barnabás Pőcze Signed-off-by: Kieran Bingham --- v2: - drop fixes tag --- src/apps/cam/camera_session.cpp | 9 +++++++++ src/apps/cam/main.cpp | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index 17444a217bec..5f66eca22ad5 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -97,7 +97,16 @@ CameraSession::CameraSession(CameraManager *cm, std::string orientOpt = options_[OptOrientation].toString(); static const std::map orientations{ { "rot0", libcamera::Orientation::Rotate0 }, + { "rot90", libcamera::Orientation::Rotate90 }, { "rot180", libcamera::Orientation::Rotate180 }, + { "rot270", libcamera::Orientation::Rotate270 }, + + { "rot0mirror", libcamera::Orientation::Rotate0Mirror }, + { "rot90mirror", libcamera::Orientation::Rotate90Mirror }, + { "rot180mirror", libcamera::Orientation::Rotate180Mirror }, + { "rot270mirror", libcamera::Orientation::Rotate270Mirror }, + + /* Helpful aliases */ { "mirror", libcamera::Orientation::Rotate0Mirror }, { "flip", libcamera::Orientation::Rotate180Mirror }, }; diff --git a/src/apps/cam/main.cpp b/src/apps/cam/main.cpp index 17b30fa0e061..54d166884f4d 100644 --- a/src/apps/cam/main.cpp +++ b/src/apps/cam/main.cpp @@ -146,7 +146,10 @@ int CamApp::parseOptions(int argc, char *argv[]) OptCamera); parser.addOption(OptOrientation, OptionString, - "Desired image orientation (rot0, rot180, mirror, flip)", + "Desired image orientation. Supported values:\n" + "- rot0, rot90, rot180, rot270,\n" + "- rot0mirror, rot90mirror, rot180mirror, rot270mirror,\n" + "- mirror (alias for rot0mirror), flip (alias for rot180mirror)", "orientation", ArgumentRequired, "orientation", false, OptCamera); #ifdef HAVE_KMS