{"id":14362,"url":"https://patchwork.libcamera.org/api/1.1/patches/14362/?format=json","web_url":"https://patchwork.libcamera.org/patch/14362/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20211027092803.3671096-9-naush@raspberrypi.com>","date":"2021-10-27T09:28:02","name":"[libcamera-devel,v3,8/9] pipeline: raspberrypi: Account for a missing Unicam embedded data node","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"a8df2b12cebc4f0ef3ec48a12ee8749d9de4779d","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14362/mbox/","series":[{"id":2660,"url":"https://patchwork.libcamera.org/api/1.1/series/2660/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2660","date":"2021-10-27T09:27:54","name":"Raspberry Pi: Conversion to media controller","version":3,"mbox":"https://patchwork.libcamera.org/series/2660/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14362/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14362/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 17A83BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 09:28:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BA3C164896;\n\tWed, 27 Oct 2021 11:28:19 +0200 (CEST)","from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65BB86488D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 11:28:14 +0200 (CEST)","by mail-wr1-x433.google.com with SMTP id z14so2974913wrg.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 02:28:14 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:6561:eb24:3f00:ce98])\n\tby smtp.gmail.com with ESMTPSA id\n\tx2sm2861360wmj.3.2021.10.27.02.28.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Oct 2021 02:28:12 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"SrFMPOpa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=koj/vGPOhCtDOgqqv3BAPCzy3I6XV7nQB2MvwB2zY3k=;\n\tb=SrFMPOpawD/vO8NDQ1T0jlNZ/uuVnUZ1Wqe1ThKNcCu3VZJ1IbgyMHBYpaioKE0D0N\n\tVHpTUQPvxV5guxWLttMs2sdAmUJlxSs1XM7cSQesfAlD+TAThqroaEdFyclBRnxf9evi\n\tlxxvKSS6+FLwM80YalhAzmGIqAauhwsYSafg0TBPNjpUzBusxRw9JJb+xAy6NjJEakX/\n\tY6+uDZOO2GP4uUnB+cwgRb1RcZ5zHtJ3IfmVKyfMLy21OG48SRvKoQF0/Qz2KY8EkIzo\n\tvhyxz5Tstb+qb/W08rqrr+0CsqJw7T8QQiknomPPaBBW836RJS7dipQlO6v4Jp75llJa\n\tUVsw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=koj/vGPOhCtDOgqqv3BAPCzy3I6XV7nQB2MvwB2zY3k=;\n\tb=mt+oakWmMjXd75flau3xlKliZCUdb5iPzwJezaa7AofeHR6HXs4K0TcnuxM0jOKy9p\n\tPmqrDx1plE3QtpvFSIQm0FrEhnaZAXsf8wb0AL0kPCkemybCd6J4DGCy0WfFKnx29DUL\n\thfiO6C3powL5LQkt5qTWDQ/40vGLgFlgydBl5W+jK1jp+WMSFXBlrM77sUBzS0siIryU\n\tUGePCYu1rQPUYOYYMf/YiXPS6Pn5E9pH066ne+z9uYjcG0Sye/H/HW+7Rj84VZvS/89z\n\tEnWEwrZzaBXDZeiEWqXZ2W9A7lMBRWRZ+VEDaHWwakoh/en/vRKD/woIAaVx9reCqbV9\n\tc3AA==","X-Gm-Message-State":"AOAM530KsUmuuD7uUhj8+qC2bdZalSFmQb+r6XNb20QgOoNsNLlx3TzU\n\tk112O+qcxUWTqpGD0/6kmangfjkWcaQvY+ud","X-Google-Smtp-Source":"ABdhPJyl0gv0LIJHf2KOLgRLpzufPiCyyEMXsTjoEqjBkA0qG/8mBKrMA9FEJpgiLfGNHwMVMQCRVA==","X-Received":"by 2002:a5d:59ae:: with SMTP id\n\tp14mr38484000wrr.76.1635326893871; \n\tWed, 27 Oct 2021 02:28:13 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 27 Oct 2021 10:28:02 +0100","Message-Id":"<20211027092803.3671096-9-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20211027092803.3671096-1-naush@raspberrypi.com>","References":"<20211027092803.3671096-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 8/9] pipeline: raspberrypi: Account for\n\ta missing Unicam embedded data node","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The unicam driver no longer registers an embedded data node if the sensor does\nnot provide this stream. Account for this in the pipeline handler match routine\nby not assuming it is always present.\n\nAdd a warning if Unicam and the CamHelper do not agree on the presense of sensor\nembedded data, and disable its usage in these cases.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp         | 16 +++++++++++++---\n 1 file changed, 13 insertions(+), 3 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex e01359b20fd9..52521857b61c 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1015,7 +1015,6 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \tDeviceMatch unicam(\"unicam\");\n \tDeviceMatch isp(\"bcm2835-isp\");\n \n-\tunicam.add(\"unicam-embedded\");\n \tunicam.add(\"unicam-image\");\n \n \tisp.add(\"bcm2835-isp0-output0\"); /* Input */\n@@ -1036,9 +1035,16 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \n \t/* Locate and open the unicam video streams. */\n-\tdata->unicam_[Unicam::Embedded] = RPi::Stream(\"Unicam Embedded\", unicam_->getEntityByName(\"unicam-embedded\"));\n \tdata->unicam_[Unicam::Image] = RPi::Stream(\"Unicam Image\", unicam_->getEntityByName(\"unicam-image\"));\n \n+\t/* An embedded data node will not be present if the sensor does not support it. */\n+\tMediaEntity *embeddedEntity = unicam_->getEntityByName(\"unicam-embedded\");\n+\tif (embeddedEntity) {\n+\t\tdata->unicam_[Unicam::Embedded] = RPi::Stream(\"Unicam Embedded\", embeddedEntity);\n+\t\tdata->unicam_[Unicam::Embedded].dev()->bufferReady.connect(data.get(),\n+\t\t\t\t\t\t\t\t\t   &RPiCameraData::unicamBufferDequeue);\n+\t}\n+\n \t/* Tag the ISP input stream as an import stream. */\n \tdata->isp_[Isp::Input] = RPi::Stream(\"ISP Input\", isp_->getEntityByName(\"bcm2835-isp0-output0\"), true);\n \tdata->isp_[Isp::Output0] = RPi::Stream(\"ISP Output0\", isp_->getEntityByName(\"bcm2835-isp0-capture1\"));\n@@ -1048,7 +1054,6 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \t/* Wire up all the buffer connections. */\n \tdata->unicam_[Unicam::Image].dev()->frameStart.connect(data.get(), &RPiCameraData::frameStarted);\n \tdata->unicam_[Unicam::Image].dev()->bufferReady.connect(data.get(), &RPiCameraData::unicamBufferDequeue);\n-\tdata->unicam_[Unicam::Embedded].dev()->bufferReady.connect(data.get(), &RPiCameraData::unicamBufferDequeue);\n \tdata->isp_[Isp::Input].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispInputDequeue);\n \tdata->isp_[Isp::Output0].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispOutputDequeue);\n \tdata->isp_[Isp::Output1].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispOutputDequeue);\n@@ -1076,6 +1081,11 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \t}\n \n+\tif (sensorConfig.sensorMetadata ^ !!embeddedEntity) {\n+\t\tLOG(RPI, Warning) << \"Mismatch between Unicam and CamHelper for embedded data usage!\";\n+\t\tsensorConfig.sensorMetadata = false;\n+\t}\n+\n \t/*\n \t * Open all Unicam and ISP streams. The exception is the embedded data\n \t * stream, which only gets opened below if the IPA reports that the sensor\n","prefixes":["libcamera-devel","v3","8/9"]}