{"id":17849,"url":"https://patchwork.libcamera.org/api/patches/17849/?format=json","web_url":"https://patchwork.libcamera.org/patch/17849/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20221123134346.129807-4-jacopo@jmondi.org>","date":"2022-11-23T13:43:45","name":"[libcamera-devel,v2,3/4] ipa: rkisp1: Fail hard on empty CameraSensorInfo","commit_ref":"13d85e632a507d68d0c04f6329078a40b79c7afd","pull_url":null,"state":"accepted","archived":false,"hash":"0af7a55a57f4a8e98cec19faefab537deca89002","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17849/mbox/","series":[{"id":3633,"url":"https://patchwork.libcamera.org/api/series/3633/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3633","date":"2022-11-23T13:43:42","name":"ipa: Validate controls in CameraSensor","version":2,"mbox":"https://patchwork.libcamera.org/series/3633/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17849/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17849/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C66ECBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 23 Nov 2022 13:44:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9656F63311;\n\tWed, 23 Nov 2022 14:44:02 +0100 (CET)","from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::224])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 51A6563316\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Nov 2022 14:44:00 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 17591E000E;\n\tWed, 23 Nov 2022 13:43:58 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669211042;\n\tbh=seA2FH7NwX/dr7IQJDCWP9W/obDqe3Kekvvt2UTeLy4=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=YlcKO0KGVzVmb9xtr+2xUuN5KWjCOKU+G3LA1xxNAx76d1O5wf6Sh3MVLyiA++YsU\n\tDoXGsMPHhSXx2iUvFsMDuwTPG2x8YF392U1nHU7Ns/VepD9xeL4EFa+oR/B6yedfCR\n\to/YqgNUirJFHbotSaJytri5YibAF2Wl6XS9+l8oYi80SSl+cGzp6o9Fa46wemSyDIx\n\tjN/8zQFWv9wcKZ4ZKXmenVOOo9DUH52cL/h9CBLXsSD3GmVqypdjPk3MtX05D8OYeq\n\tN3v0poxtW1PEf3mt112TnK1wo/9ZR5PA7kJC0PZD8qlCsW2pGFJcZ78h2D02yucxMl\n\tfVYwsXQx2rY0g==","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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 3/4] ipa: rkisp1: Fail hard on empty\n\tCameraSensorInfo","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"Nicholas Roth <nicholas@rothemail.net>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The RkISP1 pipeline and IPA module allows for the CameraSensorInfo to be\nempty, probably to accommodate some sensor used in a test platform that\ndoes not provide the mandatory libcamera requirements.\n\nAs the \\todo item in the IPA reports, there is a possibility that the\nreceived CameraSensorInfo is empty and it should be checked before\naccessing it, but currently such requirement is not enforced in the\ncode.\n\nThis allows to assume all the test platforms in use have now\nsuccessfully moved their sensor driver to comply with the minimum\nrequirements and provide a populated CameraSensorInfo to the IPA.\n\nAs the safety check is not enforced, and as we don't want to allow\nfaulty sensors to send empty CameraSensorInfo to the IPA, remove the\n\\todo item in the IPA and fail hard in the pipeline handler if the\nsensor does not comply with libcamera requirements.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/rkisp1/rkisp1.cpp                | 6 ------\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 ++---\n 2 files changed, 2 insertions(+), 9 deletions(-)","diff":"diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 088d7c74d448..a9e144303072 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -199,12 +199,6 @@ void IPARkISP1::stop()\n \tcontext_.frameContexts.clear();\n }\n \n-/**\n- * \\todo The RkISP1 pipeline currently provides an empty IPACameraSensorInfo\n- * if the connected sensor does not provide enough information to properly\n- * assemble one. Make sure the reported sensor information are relevant\n- * before accessing them.\n- */\n int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n \t\t\t [[maybe_unused]] const std::map<uint32_t, IPAStream> &streamConfig)\n {\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 4f0e1f8b1a35..e946ccc4c930 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -719,9 +719,8 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tret = data->sensor_->sensorInfo(&ipaConfig.sensorInfo);\n \tif (ret) {\n-\t\t/* \\todo Turn this into a hard failure. */\n-\t\tLOG(RkISP1, Warning) << \"Camera sensor information not available\";\n-\t\tipaConfig.sensorInfo = {};\n+\t\tLOG(RkISP1, Error) << \"Camera sensor information not available\";\n+\t\treturn ret;\n \t}\n \n \tipaConfig.sensorControls = data->sensor_->controls();\n","prefixes":["libcamera-devel","v2","3/4"]}