[{"id":10968,"web_url":"https://patchwork.libcamera.org/comment/10968/","msgid":"<20200629145526.GG1852218@oden.dyn.berto.se>","date":"2020-06-29T14:55:26","subject":"Re: [libcamera-devel] [PATCH v1 8/9] libcamera: pipeline:\n\traspberrypi: Start IPA when starting camera","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-06-29 02:19:33 +0300, Laurent Pinchart wrote:\n> The IPA is meant to be started when starting the camera, and stopped\n> when stopping it. It was so far start early in order to handle the\n> IPAInterface::processEvent() call related to lens shading table\n> allocation before IPAInterface::configure() to pass the table to the\n> IPA. Now that the lens shading table is passed through configure(),\n> starting the IPA early isn't needed anymore.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 31 ++++++++++---------\n>  1 file changed, 17 insertions(+), 14 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 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> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 AEB79BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Jun 2020 14:55:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 28417609C9;\n\tMon, 29 Jun 2020 16:55:29 +0200 (CEST)","from mail-lj1-x243.google.com (mail-lj1-x243.google.com\n\t[IPv6:2a00:1450:4864:20::243])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 034D4603B4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2020 16:55:28 +0200 (CEST)","by mail-lj1-x243.google.com with SMTP id e4so18380608ljn.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2020 07:55:27 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\to1sm9182421lfi.92.2020.06.29.07.55.26\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 29 Jun 2020 07:55:26 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"Atne0auC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=fnDSRrjxPYQfFD8RGzsSI2fMKQLGfVA+npbv5Z6j4zw=;\n\tb=Atne0auCgM7G+Q039TEldDgmzD1AkXy2fzKiqVR8t5B8UtfP1uL/D7Y/xipyXQ7Oa7\n\tt3iaMPPG+x7gytTr4+Y64Fc26n8Xf3DnxWkXQ/FveII7wftnrntYb2+LevJO3IrXcUXb\n\tty1uB+6oV9C+ZIveBc7Lt4q7f8fwPbioGi3i4GB6Iwzb5jYwEEaKxYeX+nL227gNu08k\n\tA/luPhGSg6C7F1cL9xFNy77XFjzJ9OOW/wXXCgGE5NbLZCk/szP95CVLKnob39zX7T/8\n\tsnb0W6KMuJBF4pdpC1I+oky0DivITrWpYzbDpj8ls6j6DYVvcf1EvMg6e5o/nJd8nDwL\n\tlzyg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=fnDSRrjxPYQfFD8RGzsSI2fMKQLGfVA+npbv5Z6j4zw=;\n\tb=pIaJWiCv3NiBO0jlp6c7eSSpTlpnBL37Q6QagBGAC+f9/si2HDdkGintSw07XttaXw\n\tsSjRXJ3iDJ5k+GNCbPIRDKqcYKmhHBOamSIfouRoNrK8gJUwYZBqdL69hNYvTQjonoO4\n\th6VoP1PWFAnXXldLQMT2a1aR6DmNZDMbhvqg2g+TeNKDI34D+GthNMNrGBx9LDMpC46w\n\tcPTUAe19a+5QR42AbgeHhPzfFbLO3tRuNDSbPqrzJz16yr6D6BOtLTOJQRLMJzJUywXO\n\tDQMmOVp3x59rZaxG6+tE/9S1G6R0bbfKXAFCDMii9LUO+P75m9NZqOPz8pF0gONiVK9Z\n\txceQ==","X-Gm-Message-State":"AOAM531ktLJDmeO86Yji5HKqZPPGCBACv8o9U8EOXM/m/xSVJ6wL5b93\n\tX0U029BDqEJz+uYInDc1IXRvRn0b60c=","X-Google-Smtp-Source":"ABdhPJzNLjIlWkxkyuQjjbjxKYPXWVe8oLkBXQJ0igeykAsF58DTdOsE12eYUNyxNiOs2GNGVMv1dw==","X-Received":"by 2002:a2e:9e88:: with SMTP id f8mr7909663ljk.193.1593442527353;\n\tMon, 29 Jun 2020 07:55:27 -0700 (PDT)","Date":"Mon, 29 Jun 2020 16:55:26 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20200629145526.GG1852218@oden.dyn.berto.se>","References":"<20200628231934.29025-1-laurent.pinchart@ideasonboard.com>\n\t<20200628231934.29025-9-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200628231934.29025-9-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v1 8/9] 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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]