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; }