From patchwork Wed Nov 23 13:43:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 17849 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 C66ECBE08B for ; Wed, 23 Nov 2022 13:44:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9656F63311; Wed, 23 Nov 2022 14:44:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669211042; bh=seA2FH7NwX/dr7IQJDCWP9W/obDqe3Kekvvt2UTeLy4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=YlcKO0KGVzVmb9xtr+2xUuN5KWjCOKU+G3LA1xxNAx76d1O5wf6Sh3MVLyiA++YsU DoXGsMPHhSXx2iUvFsMDuwTPG2x8YF392U1nHU7Ns/VepD9xeL4EFa+oR/B6yedfCR o/YqgNUirJFHbotSaJytri5YibAF2Wl6XS9+l8oYi80SSl+cGzp6o9Fa46wemSyDIx jN/8zQFWv9wcKZ4ZKXmenVOOo9DUH52cL/h9CBLXsSD3GmVqypdjPk3MtX05D8OYeq N3v0poxtW1PEf3mt112TnK1wo/9ZR5PA7kJC0PZD8qlCsW2pGFJcZ78h2D02yucxMl fVYwsXQx2rY0g== Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 51A6563316 for ; Wed, 23 Nov 2022 14:44:00 +0100 (CET) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 17591E000E; Wed, 23 Nov 2022 13:43:58 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Wed, 23 Nov 2022 14:43:45 +0100 Message-Id: <20221123134346.129807-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123134346.129807-1-jacopo@jmondi.org> References: <20221123134346.129807-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/4] ipa: rkisp1: Fail hard on empty CameraSensorInfo 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: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Nicholas Roth Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The RkISP1 pipeline and IPA module allows for the CameraSensorInfo to be empty, probably to accommodate some sensor used in a test platform that does not provide the mandatory libcamera requirements. As the \todo item in the IPA reports, there is a possibility that the received CameraSensorInfo is empty and it should be checked before accessing it, but currently such requirement is not enforced in the code. This allows to assume all the test platforms in use have now successfully moved their sensor driver to comply with the minimum requirements and provide a populated CameraSensorInfo to the IPA. As the safety check is not enforced, and as we don't want to allow faulty sensors to send empty CameraSensorInfo to the IPA, remove the \todo item in the IPA and fail hard in the pipeline handler if the sensor does not comply with libcamera requirements. Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/rkisp1/rkisp1.cpp | 6 ------ src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 ++--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 088d7c74d448..a9e144303072 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -199,12 +199,6 @@ void IPARkISP1::stop() context_.frameContexts.clear(); } -/** - * \todo The RkISP1 pipeline currently provides an empty IPACameraSensorInfo - * if the connected sensor does not provide enough information to properly - * assemble one. Make sure the reported sensor information are relevant - * before accessing them. - */ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, [[maybe_unused]] const std::map &streamConfig) { diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 4f0e1f8b1a35..e946ccc4c930 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -719,9 +719,8 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c) ret = data->sensor_->sensorInfo(&ipaConfig.sensorInfo); if (ret) { - /* \todo Turn this into a hard failure. */ - LOG(RkISP1, Warning) << "Camera sensor information not available"; - ipaConfig.sensorInfo = {}; + LOG(RkISP1, Error) << "Camera sensor information not available"; + return ret; } ipaConfig.sensorControls = data->sensor_->controls();