{"id":18410,"url":"https://patchwork.libcamera.org/api/patches/18410/?format=json","web_url":"https://patchwork.libcamera.org/patch/18410/","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":"<20230318234014.29506-2-dan.scally@ideasonboard.com>","date":"2023-03-18T23:40:04","name":"[libcamera-devel,01/11] pipeline: ipu3: Check if sensor supports test pattern control","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"ff956d8f57f1446b990760d213b3992cd9294b5c","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/?format=json","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18410/mbox/","series":[{"id":3807,"url":"https://patchwork.libcamera.org/api/series/3807/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3807","date":"2023-03-18T23:40:03","name":"Support OV7251 in IPU3 pipeline and qcam","version":1,"mbox":"https://patchwork.libcamera.org/series/3807/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18410/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18410/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 E2F8FC3264\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 18 Mar 2023 23:40:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D98D8626F5;\n\tSun, 19 Mar 2023 00:40:34 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45008626DB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 19 Mar 2023 00:40:32 +0100 (CET)","from mail.ideasonboard.com\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B2DC7DF7;\n\tSun, 19 Mar 2023 00:40:31 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679182834;\n\tbh=Pi26qg3X2ZaTtBbo5MzbKdHCyNv/oEf2/r1dRWGGZIg=;\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:\n\tFrom;\n\tb=pCTNwWWz/DQcQZAI+DHA2xOcy/DxE4LduedMkEoT7JiI3FDZIv3iFi75dhAxvAgSW\n\t8owFXlK2nBjIIsGkzl5ea1hQKo0lplsQwF5NhXLLsXD8N1aSW1WjzQT3L88N1ARPYW\n\taJd5DX+jYluLp2KxCa8P+c6gS1ACjfaf9Cn3kkPrvVmrH8MlFWJB1hKHvasseElHoc\n\tB9lS4Zu1IgG2fjn2nYZSlkUQorZcEAsFKHCpcYv/o0jhqkWHkd/MzU03wjBk/0zu+i\n\tsfPub8Bk4CrQKiQL1ZjFa4536m1X+/uHLOPiKYXWQdhsq3EurqQOoqVR11qav0vav0\n\tyEk88ERYaa/yw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679182831;\n\tbh=Pi26qg3X2ZaTtBbo5MzbKdHCyNv/oEf2/r1dRWGGZIg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=dRA3lQCr7Yy/s34+Ry77JygBA3PwnLmExEA3MOGfLDAh7ttLBaB5ml4GYLiNi+7hJ\n\txYqk51L/WEFh4qRn7V/OMwbFqqJDmKYp+C9ZyURCa771oDeQvIkJD21Dod44mQIn+c\n\tAbJ7SYTAybCcPZtQcZ+4Balzhy9D7xwfUx65vpXE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"dRA3lQCr\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 18 Mar 2023 23:40:04 +0000","Message-Id":"<20230318234014.29506-2-dan.scally@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20230318234014.29506-1-dan.scally@ideasonboard.com>","References":"<20230318234014.29506-1-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 01/11] pipeline: ipu3: Check if sensor\n\tsupports test pattern control","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":"Daniel Scally via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Daniel Scally <dan.scally@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The IPU3 pipeline calls CameraSensor::setTestPatternMode() in ::start().\nThat control is not a libcamera mandatory control and so might not be\npresent for a sensor. Check for its presence before trying to set the\ncontrol to avoid uneccessary failures.\n\nFixes: acf8d028e (\"libcamera: pipeline: ipu3: Apply a requested test pattern mode\")\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\nI'll patch this control into the ov7251 driver upstream as the sensor does have\na test pattern mode, but still - it's not mandatory!\n\n src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 355cb0cb..d0d55651 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -722,10 +722,14 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis\n \tint ret;\n \n \t/* Disable test pattern mode on the sensor, if any. */\n-\tret = cio2->sensor()->setTestPatternMode(\n-\t\tcontrols::draft::TestPatternModeEnum::TestPatternModeOff);\n-\tif (ret)\n-\t\treturn ret;\n+\tconst ControlInfoMap &sensorControls = cio2->sensor()->controls();\n+\n+\tif (sensorControls.find(&controls::draft::TestPatternMode) != sensorControls.end()) {\n+\t\tret = cio2->sensor()->setTestPatternMode(\n+\t\t\tcontrols::draft::TestPatternModeEnum::TestPatternModeOff);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n \n \t/* Allocate buffers for internal pipeline usage. */\n \tret = allocateBuffers(camera);\n","prefixes":["libcamera-devel","01/11"]}