[{"id":1010,"web_url":"https://patchwork.libcamera.org/comment/1010/","msgid":"<20190302225638.GN4682@pendragon.ideasonboard.com>","date":"2019-03-02T22:56:38","subject":"Re: [libcamera-devel] [PATCH 07/10] libcamera: ipu3: Queue requests\n\tto the pipeline","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 Thu, Feb 28, 2019 at 09:04:07PM +0100, Jacopo Mondi wrote:\n> Implement queueRequest for the IPU3 pipeline manager. When a request is\n> queued, a new buffer is queued to the ImgU output and the CIO2 output.\n> Also queue buffers for the viewfinder and stat video nodes, even if\n> they're not used at the moment.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 27 ++++++++++++++++++++++++++-\n>  1 file changed, 26 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 60a48859b398..8ce661e27f62 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -152,11 +152,15 @@ private:\n>  \n>  \tstd::shared_ptr<MediaDevice> cio2MediaDev_;\n>  \tstd::shared_ptr<MediaDevice> imguMediaDev_;\n> +\n> +\tunsigned int tmpBufferCount;\n>  };\n>  \n>  PipelineHandlerIPU3::PipelineHandlerIPU3(CameraManager *manager)\n>  \t: PipelineHandler(manager), cio2MediaDev_(nullptr), imguMediaDev_(nullptr)\n>  {\n> +\t/* FIXME: this is an hack. */\n> +\ttmpBufferCount = 0;\n>  }\n>  \n>  PipelineHandlerIPU3::~PipelineHandlerIPU3()\n> @@ -430,9 +434,30 @@ void PipelineHandlerIPU3::stop(const Camera *camera)\n>  int PipelineHandlerIPU3::queueRequest(const Camera *camera, Request *request)\n>  {\n>  \tIPU3CameraData *data = cameraData(camera);\n> +\tV4L2Device *viewfinder = data->imgu->viewfinder;\n> +\tV4L2Device *output = data->imgu->output;\n>  \tV4L2Device *cio2 = data->cio2.output;\n> +\tV4L2Device *stat = data->imgu->stat;\n>  \tStream *stream = &data->stream_;\n> +\tBuffer *tmpBuffer;\n> +\n> +\t/*\n> +\t * Queue buffer on VF and stat.\n> +\t * FIXME: this is an hack!\n> +\t */\n> +\ttmpBuffer = &data->imgu->vfPool.buffers()[tmpBufferCount];\n> +\tviewfinder->queueBuffer(tmpBuffer);\n> +\n> +\ttmpBuffer = &data->imgu->statPool.buffers()[tmpBufferCount];\n> +\tstat->queueBuffer(tmpBuffer);\n\nLet's not use the video nodes we don't need and get rid of this hack.\n\n> +\n> +\ttmpBuffer = &data->cio2.pool.buffers()[tmpBufferCount];\n> +\tcio2->queueBuffer(tmpBuffer);\n\nAll cio2 buffers should be queued internally at stream start, they're\nunrelated to requests.\n\n> +\n> +\ttmpBufferCount++;\n> +\ttmpBufferCount %= IPU3_BUF_NUM;\n>  \n> +\t/* Queue a buffer to the ImgU output for capture. */\n>  \tBuffer *buffer = request->findBuffer(stream);\n>  \tif (!buffer) {\n>  \t\tLOG(IPU3, Error)\n> @@ -440,7 +465,7 @@ int PipelineHandlerIPU3::queueRequest(const Camera *camera, Request *request)\n>  \t\treturn -ENOENT;\n>  \t}\n>  \n> -\tcio2->queueBuffer(buffer);\n> +\toutput->queueBuffer(buffer);\n>  \n>  \treturn 0;\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 EA8C6610BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  2 Mar 2019 23:56:44 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 691A454E;\n\tSat,  2 Mar 2019 23:56:44 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1551567404;\n\tbh=InqyMdQIsZYTx3rPEsEwjWu0DPRXoXGrj3tW62UBEkg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=MNEiYnFmFiPf95RpTafMNOz+pT+kqSCl/C1LNStAVt7tbjfZh2I1xntzlw3QlwfKK\n\t91zRUFFW4hk1tM/pHcGSYxaMmb5Z5YYQuoszQ8Rm5BrVXLzyGK9POK4GSjD5ODNg5O\n\tA5tW+VD83/h2d0T7qOPMjwX3JRwXnzcYMoh9L8/4=","Date":"Sun, 3 Mar 2019 00:56:38 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190302225638.GN4682@pendragon.ideasonboard.com>","References":"<20190228200410.3022-1-jacopo@jmondi.org>\n\t<20190228200410.3022-8-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190228200410.3022-8-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 07/10] libcamera: ipu3: Queue requests\n\tto the pipeline","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, 02 Mar 2019 22:56:45 -0000"}}]