{"id":8492,"url":"https://patchwork.libcamera.org/api/1.1/patches/8492/?format=json","web_url":"https://patchwork.libcamera.org/patch/8492/","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":"<20200628231934.29025-9-laurent.pinchart@ideasonboard.com>","date":"2020-06-28T23:19:33","name":"[libcamera-devel,v1,8/9] libcamera: pipeline: raspberrypi: Start IPA when starting camera","commit_ref":null,"pull_url":null,"state":"superseded","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/8492/mbox/","series":[{"id":1054,"url":"https://patchwork.libcamera.org/api/1.1/series/1054/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1054","date":"2020-06-28T23:19:25","name":"Support passing custom data to IPA configure()","version":1,"mbox":"https://patchwork.libcamera.org/series/1054/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8492/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8492/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 32E59C2E66\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Jun 2020 23:19:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EBFAC60AFF;\n\tMon, 29 Jun 2020 01:19:52 +0200 (CEST)","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 6DBCB609DB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2020 01:19:44 +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 E92559C5;\n\tMon, 29 Jun 2020 01:19:43 +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=\"qwSeYUYv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593386384;\n\tbh=phr37Do1+a4jKTug4mfpVra4Cn063fKxPTCMZ0pTmHo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qwSeYUYvZzDV2iU7k11PXu97vBJTX+nkd//mxo78NDmDF34eTunS2zrOdICbz/eag\n\tN34l+xpbmzEkkw7iUUSkexf+pTanyOnhXOXzdIO5sCOrlNPHLE6FgovusVBiCXJYbf\n\tOJIbFfnQKOe3qtL/lvuqfJ6mvSbM3fWM7i2zu0cY=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 29 Jun 2020 02:19:33 +0300","Message-Id":"<20200628231934.29025-9-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200628231934.29025-1-laurent.pinchart@ideasonboard.com>","References":"<20200628231934.29025-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v1 8/9] libcamera: pipeline: raspberrypi:\n\tStart 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=\"us-ascii\"","Content-Transfer-Encoding":"7bit","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>\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 60b01484b329..137e07379cf5 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -302,10 +302,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@@ -787,6 +783,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@@ -797,8 +803,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@@ -842,6 +850,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@@ -1094,15 +1105,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","v1","8/9"]}