{"id":11574,"url":"https://patchwork.libcamera.org/api/patches/11574/?format=json","web_url":"https://patchwork.libcamera.org/patch/11574/","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":"<20210313102741.2890809-2-naush@raspberrypi.com>","date":"2021-03-13T10:27:40","name":"[libcamera-devel,1/2] pipeline: raspberrypi: Avoid multiple opens of Unicam embedded data node","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"b5e2072e6bc314184aca82ff33fd64aa2540892c","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11574/mbox/","series":[{"id":1789,"url":"https://patchwork.libcamera.org/api/series/1789/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1789","date":"2021-03-13T10:27:39","name":"RaspberryPi: Fixes for compliance","version":1,"mbox":"https://patchwork.libcamera.org/series/1789/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11574/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11574/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 4C492BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Mar 2021 10:27:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E25A168C6C;\n\tSat, 13 Mar 2021 11:27:48 +0100 (CET)","from mail-wm1-x332.google.com (mail-wm1-x332.google.com\n\t[IPv6:2a00:1450:4864:20::332])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 35ADC602E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 11:27:48 +0100 (CET)","by mail-wm1-x332.google.com with SMTP id\n\tr15-20020a05600c35cfb029010e639ca09eso17258787wmq.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 02:27:48 -0800 (PST)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tg5sm11760178wrq.30.2021.03.13.02.27.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 13 Mar 2021 02:27:47 -0800 (PST)"],"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=\"SjoeGLZO\"; 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=M+FmiV1+Z+NI3asFb2J1an453JDSYe2mOftFh6wRtHU=;\n\tb=SjoeGLZOGOt8g6nVByTNGe+XqeK29RvlNpp8eVkajpi+cTN7MNkfpNVLjyHtJAUxAz\n\tKGMQo+hUuBtbAxMVLTYOyCeF1tylJJPOc5mLchFPmwT2vxQNZ+b4O488Cxip4Qw+4seW\n\tZBzs7AbMM2yy7YCFfwH9GW8Zj6MXGOkEnCWaF01zqErtEZHv+LddQltKJ0bfZ2AJ6k9b\n\t8oi5Z3qESR/lk0pvTVW4i5pfrtRx1dTTSJDK75P0sfoXitUyZWUKk+zqbyexpS2GE4i7\n\tsIdm7//svmNJ9TqYtUhazD1tbjTcntDPFuPYyUCqTmSf4FG/oT6iUutFPdy+kLPi2IUm\n\tzEBg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\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=M+FmiV1+Z+NI3asFb2J1an453JDSYe2mOftFh6wRtHU=;\n\tb=Gv/COPsfqfHJjtd+F+YZiPfrlWGrsORszvBiPorg2vMQ8BXaaugtSrWM0oOLYY04/4\n\tdYiZf7nL/uCNfY5ysgFl+XNf9vxbr7KQ/XdS8uFSFadLneV31j1UqhXUnay/eDtBAaLS\n\tQDkN4+GD0E5Tvut3OP3umVWAER9P4w0L49GCflFJdx5VuEAJg+o44XfrjPeQ4H0UnuxT\n\tDFiHEMA6l2SV6vjysAzCff5+NVDbJ+MN5mmyBjbOzn1XcT+0ljDUQ1BcEH3PO8IdGF2l\n\tdIkqI4IqaiuqftBw2BgbQe6wcqr+AZQ8svD0GGUH6E/srZtGklm3yVzG0c4ldx6q6rrn\n\tsXfg==","X-Gm-Message-State":"AOAM5337ZMgy2FRKw0i07FMX5cH1yKpjq/Hi6+WcpPO5CEKmamsElnvD\n\td7BthwMKmvVfn0jImYqJVFs2oNcXnKvdrA==","X-Google-Smtp-Source":"ABdhPJy8qprzO55afWvrlyCqA+NHCFh2D2o+L7IMCjLvHSn7BZtudejWSuJhMA+qYCYN4RS8Lydrpw==","X-Received":"by 2002:a1c:32ca:: with SMTP id\n\ty193mr17071556wmy.56.1615631267405; \n\tSat, 13 Mar 2021 02:27:47 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 13 Mar 2021 10:27:40 +0000","Message-Id":"<20210313102741.2890809-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210313102741.2890809-1-naush@raspberrypi.com>","References":"<20210313102741.2890809-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 1/2] pipeline: raspberrypi: Avoid multiple\n\topens of 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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"It is possible for the application to call pipeline_handler::configure()\nmultiple times, which would attempt to open the Unicam embedded data\nnode on every call. This would cause a warning message as the node\nwould have already been opened. Avoid this by tracking if the node\nhas previously been opened.\n\nNote that this is a temporary fix since the open call for the Unicam\nembedded data node will be moved from pipeline_handler::configure() to\npipeline_handler::match().\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 41f1cbffa931..9847e926b048 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -138,7 +138,7 @@ class RPiCameraData : public CameraData\n {\n public:\n \tRPiCameraData(PipelineHandler *pipe)\n-\t\t: CameraData(pipe), state_(State::Stopped),\n+\t\t: CameraData(pipe), embeddedNodeOpened_(false), state_(State::Stopped),\n \t\t  supportsFlips_(false), flipsAlterBayerOrder_(false),\n \t\t  updateScalerCrop_(true), dropFrameCount_(0), ispOutputCount_(0)\n \t{\n@@ -183,6 +183,7 @@ public:\n \n \tstd::unique_ptr<DelayedControls> delayedCtrls_;\n \tbool sensorMetadata_;\n+\tbool embeddedNodeOpened_;\n \n \t/*\n \t * All the functions in this class are called from a single calling\n@@ -726,8 +727,13 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \tif (data->sensorMetadata_) {\n \t\tformat = {};\n \t\tformat.fourcc = V4L2PixelFormat(V4L2_META_FMT_SENSOR_DATA);\n+\n+\t\tif (!data->embeddedNodeOpened_) {\n+\t\t\tdata->unicam_[Unicam::Embedded].dev()->open();\n+\t\t\tdata->embeddedNodeOpened_ = true;\n+\t\t}\n+\n \t\tLOG(RPI, Debug) << \"Setting embedded data format.\";\n-\t\tdata->unicam_[Unicam::Embedded].dev()->open();\n \t\tret = data->unicam_[Unicam::Embedded].dev()->setFormat(&format);\n \t\tif (ret) {\n \t\t\tLOG(RPI, Error) << \"Failed to set format on Unicam embedded: \"\n","prefixes":["libcamera-devel","1/2"]}