From patchwork Thu May 1 14:16:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 23330 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 78683C327D for ; Thu, 1 May 2025 14:16:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4FEC768ADC; Thu, 1 May 2025 16:16:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RlymVgtk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B45DD68AD0 for ; Thu, 1 May 2025 16:16:13 +0200 (CEST) Received: from Monstersaurus.lgs-net.com (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 70BE1741; Thu, 1 May 2025 16:16:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1746108966; bh=XfdBFOWRyFd2f/VcVPkeON4gYAZDif2ht/YNZJEnZ6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RlymVgtkNyNJSmF/n6KqHCrcbz4BnMk+DXkr4yg/pAcDC8v75C6KFQX3YvLLF32A4 VGfOo8gFEZIq6fVczVhKysqiSF2C/w22YhAA0JLsLEOsXV0GYayP/fffD8/rUQp32Z TWxZpjXiyoQ8t0n/SSDjkYkaWeosRLjhRoEWGCmo= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH 1/3] libcamera: pipeline: rkisp1: Detect invalid sensor configurations Date: Thu, 1 May 2025 15:16:07 +0100 Message-ID: <20250501141609.717148-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250501141609.717148-1-kieran.bingham@ideasonboard.com> References: <20250501141609.717148-1-kieran.bingham@ideasonboard.com> 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" 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 675f0a7490a6..d8c6100946bc 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -673,9 +673,21 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate() sensorFormat_ = sensor->getFormat(mbusCodes, maxSize, 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; }