[{"id":1111,"web_url":"https://patchwork.libcamera.org/comment/1111/","msgid":"<20190323134745.GH4587@pendragon.ideasonboard.com>","date":"2019-03-23T13:47:45","subject":"Re: [libcamera-devel] [PATCH v4 25/31] libcamera: ipu3: Connect\n\tviewfinder's BufferReady signal","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, Mar 20, 2019 at 05:30:49PM +0100, Jacopo Mondi wrote:\n> Connect the viewfinder buffer ready signal to the IPU3CameraData slot\n> that complets the buffer first, and if not waiting for other buffers\n> completes the request as well.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 23 +++++++++++++++--------\n>  1 file changed, 15 insertions(+), 8 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index b2df9a4ac922..db1ec2a7c3e2 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -135,7 +135,7 @@ private:\n>  \t\t{\n>  \t\t}\n>  \n> -\t\tvoid imguOutputBufferReady(Buffer *buffer);\n> +\t\tvoid imguCaptureBufferReady(Buffer *buffer);\n>  \t\tvoid imguInputBufferReady(Buffer *buffer);\n>  \t\tvoid cio2BufferReady(Buffer *buffer);\n>  \n> @@ -621,8 +621,13 @@ int PipelineHandlerIPU3::start(Camera *camera)\n>  \t\t\t\t\t&IPU3CameraData::cio2BufferReady);\n>  \tdata->imgu->input->bufferReady.connect(data,\n>  \t\t\t\t\t&IPU3CameraData::imguInputBufferReady);\n> -\tdata->imgu->output->bufferReady.connect(data,\n> -\t\t\t\t\t&IPU3CameraData::imguOutputBufferReady);\n> +\n> +\tif (isOutputActive(data))\n> +\t\tdata->imgu->output->bufferReady.connect(data,\n> +\t\t\t\t\t&IPU3CameraData::imguCaptureBufferReady);\n> +\tif (isViewfinderActive(data))\n> +\t\tdata->imgu->viewfinder->bufferReady.connect(data,\n> +\t\t\t\t\t&IPU3CameraData::imguCaptureBufferReady);\n\nThe connections don't need to be conditional, the signal will not be\nemitted for inactive outputs.\n\n>  \n>  \t/*\n>  \t * Enqueue all available buffers to the CIO2 unit to start frame\n> @@ -1434,17 +1439,19 @@ void PipelineHandlerIPU3::IPU3CameraData::imguInputBufferReady(Buffer *buffer)\n>  }\n>  \n>  /**\n> - * \\brief ImgU output BufferReady slot\n> + * \\brief ImgU main and secondary output BufferReady slot\n>   * \\param buffer The completed buffer\n>   *\n> - * Buffer completed from the ImgU output are directed to the applications.\n> + * Buffer completed from the ImgU main and secondary outputs are directed to\n> + * the applications.\n>   */\n> -void PipelineHandlerIPU3::IPU3CameraData::imguOutputBufferReady(Buffer *buffer)\n> +void PipelineHandlerIPU3::IPU3CameraData::imguCaptureBufferReady(Buffer *buffer)\n>  {\n>  \tRequest *request = queuedRequests_.front();\n>  \n> -\tpipe_->completeBuffer(camera_, request, buffer);\n> -\tpipe_->completeRequest(camera_, request);\n> +\t/* TODO: this will probably need locking. */\n\nWhy so ?\n\n> +\tif (pipe_->completeBuffer(camera_, request, buffer))\n> +\t\tpipe_->completeRequest(camera_, request);\n>  }\n>  \n>  /**","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C88BA610B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 23 Mar 2019 14:47:58 +0100 (CET)","from pendragon.ideasonboard.com\n\t(p5269001-ipngn11702marunouchi.tokyo.ocn.ne.jp [114.158.195.1])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4F70249;\n\tSat, 23 Mar 2019 14:47:57 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1553348878;\n\tbh=7AABfgFkRNypp8po/vvqFfZSVvqDqURZd4JYhr0Ze5M=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CcLCcY3fIpdbwldd914valkfFjJED+PU8pOz4/0Idcv60L52IjoF5mmdZpduv0YNO\n\tGUBTixPmREfPY5n4tHbyGWB2YGYKKEr+fVgtra4XFzdEVH5SBeyw27QEdC85BRpfzo\n\tOyIoo+/48cj26BKeFxaZbK7S9nsFKyzuwErao7ho=","Date":"Sat, 23 Mar 2019 15:47:45 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190323134745.GH4587@pendragon.ideasonboard.com>","References":"<20190320163055.22056-1-jacopo@jmondi.org>\n\t<20190320163055.22056-26-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190320163055.22056-26-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v4 25/31] libcamera: ipu3: Connect\n\tviewfinder's BufferReady signal","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Sat, 23 Mar 2019 13:47:59 -0000"}}]