{"id":8616,"url":"https://patchwork.libcamera.org/api/1.1/patches/8616/?format=json","web_url":"https://patchwork.libcamera.org/patch/8616/","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":"<20200704005227.21782-13-laurent.pinchart@ideasonboard.com>","date":"2020-07-04T00:52:27","name":"[libcamera-devel,v2,12/12] libcamera: pipeline: raspberrypi: Start IPA when starting camera","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"acb3dbb0cff7ed62f2c677631506d3da31e9ecb9","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8616/mbox/","series":[{"id":1081,"url":"https://patchwork.libcamera.org/api/1.1/series/1081/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1081","date":"2020-07-04T00:52:15","name":"Support passing custom data to IPA configure()","version":2,"mbox":"https://patchwork.libcamera.org/series/1081/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8616/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8616/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 C21ECBE905\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  4 Jul 2020 00:52:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8ABAC60DF3;\n\tSat,  4 Jul 2020 02:52:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 723E460DE4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Jul 2020 02:52:42 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EC771814;\n\tSat,  4 Jul 2020 02:52:41 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"PcC8wWHm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593823962;\n\tbh=KyOfb9eDOXqb+ehjjLEXoRYfLNnQuSMh6/4DDgSR4lA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=PcC8wWHmDDTMGVbceQRv5IR7CaZWSiRz3TzDPW2SFGyRljL9aCXMzf/bdZeGVAWNS\n\tCEVQwTVQ64yX+dIHBlAQBEsc3tTHj22eL83+En4AOFzp7JWlT8FIkFUTxU2PHhGBpE\n\tdhdMWulRkB9cNFAA8FL2lS2iHymdWHPRnzC939I0=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat,  4 Jul 2020 03:52:27 +0300","Message-Id":"<20200704005227.21782-13-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200704005227.21782-1-laurent.pinchart@ideasonboard.com>","References":"<20200704005227.21782-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 12/12] libcamera: pipeline:\n\traspberrypi: Start IPA when starting camera","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=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The IPA is meant to be started when starting the camera, and stopped\nwhen stopping it. It was so far start early in order to handle the\nIPAInterface::processEvent() call related to lens shading table\nallocation before IPAInterface::configure() to pass the table to the\nIPA. Now that the lens shading table is passed through configure(),\nstarting the IPA early isn't needed anymore.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 31 ++++++++++---------\n 1 file changed, 17 insertions(+), 14 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 9babf9f4a19c..c877820a6e1e 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -303,10 +303,6 @@ public:\n \t\t\tvcsm_.free(lsTable_);\n \t\t\tlsTable_ = nullptr;\n \t\t}\n-\n-\t\t/* Stop the IPA proxy thread. */\n-\t\tif (ipa_)\n-\t\t\tipa_->stop();\n \t}\n \n \tvoid frameStarted(uint32_t sequence);\n@@ -800,6 +796,16 @@ int PipelineHandlerRPi::start(Camera *camera)\n \tret = queueAllBuffers(camera);\n \tif (ret) {\n \t\tLOG(RPI, Error) << \"Failed to queue buffers\";\n+\t\tstop(camera);\n+\t\treturn ret;\n+\t}\n+\n+\t/* Start the IPA. */\n+\tret = data->ipa_->start();\n+\tif (ret) {\n+\t\tLOG(RPI, Error)\n+\t\t\t<< \"Failed to start IPA for \" << camera->name();\n+\t\tstop(camera);\n \t\treturn ret;\n \t}\n \n@@ -810,8 +816,10 @@ int PipelineHandlerRPi::start(Camera *camera)\n \tV4L2DeviceFormat sensorFormat;\n \tdata->unicam_[Unicam::Image].dev()->getFormat(&sensorFormat);\n \tret = data->isp_[Isp::Input].dev()->setFormat(&sensorFormat);\n-\tif (ret)\n+\tif (ret) {\n+\t\tstop(camera);\n \t\treturn ret;\n+\t}\n \n \t/* Enable SOF event generation. */\n \tdata->unicam_[Unicam::Image].dev()->setFrameStartEnabled(true);\n@@ -855,6 +863,9 @@ void PipelineHandlerRPi::stop(Camera *camera)\n \tdata->bayerQueue_ = std::queue<FrameBuffer *>{};\n \tdata->embeddedQueue_ = std::queue<FrameBuffer *>{};\n \n+\t/* Stop the IPA. */\n+\tdata->ipa_->stop();\n+\n \tfreeBuffers(camera);\n }\n \n@@ -1107,15 +1118,7 @@ int RPiCameraData::loadIPA()\n \t\t.configurationFile = ipa_->configurationFile(sensor_->model() + \".json\")\n \t};\n \n-\tipa_->init(settings);\n-\n-\t/*\n-\t * Startup the IPA thread now. Without this call, none of the IPA API\n-\t * functions will run.\n-\t *\n-\t * It only gets stopped in the class destructor.\n-\t */\n-\treturn ipa_->start();\n+\treturn ipa_->init(settings);\n }\n \n int RPiCameraData::configureIPA()\n","prefixes":["libcamera-devel","v2","12/12"]}