[{"id":27939,"web_url":"https://patchwork.libcamera.org/comment/27939/","msgid":"<u2fwrummg5vaq2hvks52wrq7jmz5gg6vglsezz63qzjgellzgn@zsec6lreijxp>","date":"2023-10-12T07:50:24","subject":"Re: [libcamera-devel] [PATCH 02/20] pipeline: rpi: Add Recurrent\n\tand Needs32bitConv flags to RPi::Stream","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"On Fri, Oct 06, 2023 at 02:19:42PM +0100, Naushir Patuck via libcamera-devel wrote:\n> Add a new \"Recurrent\" stream flag. This flag indicates the stream buffer\n> handling/management happend from the pipeline handler exclusively. This\n> is used for TDN/Stitch and Config streams.\n>\n> Add a new Needs32bitConv stream flag to indicate that this stream needs\n> a software postprocessing conversion run on it before returning out to\n> the application.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n\n> ---\n>  src/libcamera/pipeline/rpi/common/rpi_stream.cpp |  4 ++--\n>  src/libcamera/pipeline/rpi/common/rpi_stream.h   | 11 +++++++++++\n>  2 files changed, 13 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> index 83c2205f7ca0..fd6f2efc6e27 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> @@ -155,7 +155,7 @@ int Stream::queueBuffer(FrameBuffer *buffer)\n>\n>  void Stream::returnBuffer(FrameBuffer *buffer)\n>  {\n> -\tif (!(flags_ & StreamFlag::External)) {\n> +\tif (!(flags_ & StreamFlag::External) && !(flags_ & StreamFlag::Recurrent)) {\n>  \t\t/* For internal buffers, simply requeue back to the device. */\n>  \t\tqueueToDevice(buffer);\n>  \t\treturn;\n> @@ -217,7 +217,7 @@ int Stream::queueAllBuffers()\n>  {\n>  \tint ret;\n>\n> -\tif (flags_ & StreamFlag::External)\n> +\tif ((flags_ & StreamFlag::External) || (flags_ & StreamFlag::Recurrent))\n>  \t\treturn 0;\n>\n>  \twhile (!availableBuffers_.empty()) {\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> index 861e9c8e7dab..c5e35d134926 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> @@ -70,6 +70,17 @@ public:\n>  \t\t * to the pipeline handler when requested.\n>  \t\t */\n>  \t\tRequiresMmap\t= (1 << 2),\n> +\t\t/*\n> +\t\t * Indicates a stream that needs buffers recycled every frame internally\n> +\t\t * in the pipeline handler, e.g. stitch, TDN, config. All buffer\n> +\t\t * management will be handled by the pipeline handler.\n> +\t\t */\n> +\t\tRecurrent\t= (1 << 3),\n> +\t\t/*\n> +\t\t * Indicates that the output stream needs a software format conversion\n> +\t\t * to be applied after ISP processing.\n> +\t\t */\n> +\t\tNeeds32bitConv\t= (1 << 4),\n>  \t};\n>\n>  \tusing StreamFlags = Flags<StreamFlag>;\n> --\n> 2.34.1\n>","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 DC141BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Oct 2023 07:50:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2FA756297B;\n\tThu, 12 Oct 2023 09:50:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A456462962\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Oct 2023 09:50:27 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 87EADF0C;\n\tThu, 12 Oct 2023 09:50:24 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697097029;\n\tbh=B0a4tuXT3yqmtkNLFFgZE2/jNzeHIgKAxX82igSEhGo=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=bIglWO+ZjP6ScCBF+GfcmgRzbMqs3DlbctKtD0Of/mTrvQcdyYtGnnxyHDt0sRq1i\n\tnq6RDHyscfhQ+iITLj+lB1kwhGvnKdehI/5MnrGHRWiUlq/5ZZ4/ls4HyZnYL/1+bE\n\tSggo14+ZGUU1biu7lrovOKb4BgOckfat4zK12GkYhiztK596jWGGjJXBffAkSlaPB2\n\t/SSTR0Qfqyv9gGYDxOYJdaOXfMhm9fvJZK0bKVS+aKHkKAjWSgdiRmk0Tyb3yBHk3N\n\t4JLCMb6ENrNq6eTCYK1ABM8YFt4JmVocd+yDZ6wjfmbEm3317qkTvCsJITjdhHJ+ia\n\tOt4NsinBX+xFQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697097024;\n\tbh=B0a4tuXT3yqmtkNLFFgZE2/jNzeHIgKAxX82igSEhGo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=diCRUzlzd2Mp2lOS+ordz+AJwoKhxPt/RBGjJCcrZbPf2aOnJgT+1bkswz/dtH+UC\n\t6g7/yAmCo25LGdvXuMcyZy5w7Pm8gzzL3ktYOfMe/0vlbTtcbOvwTdVj6U0jakLh6M\n\tu+ram0FBl69APkvfPOI3RPnYKNrT2u4XqxphZcDQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"diCRUzlz\"; dkim-atps=neutral","Date":"Thu, 12 Oct 2023 09:50:24 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<u2fwrummg5vaq2hvks52wrq7jmz5gg6vglsezz63qzjgellzgn@zsec6lreijxp>","References":"<20231006132000.23504-1-naush@raspberrypi.com>\n\t<20231006132000.23504-3-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20231006132000.23504-3-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 02/20] pipeline: rpi: Add Recurrent\n\tand Needs32bitConv flags to RPi::Stream","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]