[{"id":16055,"web_url":"https://patchwork.libcamera.org/comment/16055/","msgid":"<20210330100757.pio2iv6sqqrptcal@uno.localdomain>","date":"2021-03-30T10:07:57","subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Hiro,\n\nOn Tue, Mar 30, 2021 at 03:27:36PM +0900, Hirokazu Honda wrote:\n> A more appropriate type is std::dequeue as requests are reported\n> and removed in the order of queuing.\n>\n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>\n> ---\n>  include/libcamera/internal/pipeline_handler.h | 4 ++--\n>  src/libcamera/pipeline_handler.cpp            | 8 ++++----\n>  2 files changed, 6 insertions(+), 6 deletions(-)\n>\n> diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\n> index 9bdda8f3..ff9d88d8 100644\n> --- a/include/libcamera/internal/pipeline_handler.h\n> +++ b/include/libcamera/internal/pipeline_handler.h\n> @@ -7,9 +7,9 @@\n>  #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n>  #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n>\n> -#include <list>\n>  #include <map>\n>  #include <memory>\n> +#include <queue>\n>  #include <set>\n>  #include <string>\n>  #include <sys/types.h>\n> @@ -44,7 +44,7 @@ public:\n>  \tvirtual ~CameraData() = default;\n>\n>  \tPipelineHandler *pipe_;\n> -\tstd::list<Request *> queuedRequests_;\n> +\tstd::deque<Request *> queuedRequests_;\n>  \tControlInfoMap controlInfo_;\n>  \tControlList properties_;\n>\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index e3d4975d..0fe913e9 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -72,10 +72,10 @@ LOG_DEFINE_CATEGORY(Pipeline)\n>\n>  /**\n>   * \\var CameraData::queuedRequests_\n> - * \\brief The list of queued and not yet completed request\n> + * \\brief The queue of incomplete requests.\n\nwe don't use . at the end\n\n>   *\n> - * The list of queued request is used to track requests queued in order to\n> - * ensure completion of all requests when the pipeline handler is stopped.\n> + * This queue is used to ensure that all requests are completed when the pipeline\n> + * handler is stopped.\n>   *\n>   * \\sa PipelineHandler::queueRequest(), PipelineHandler::stop(),\n>   * PipelineHandler::completeRequest()\n> @@ -386,7 +386,7 @@ int PipelineHandler::queueRequest(Request *request)\n>\n>  \tint ret = queueRequestDevice(camera, request);\n>  \tif (ret)\n> -\t\tdata->queuedRequests_.remove(request);\n> +\t\tdata->queuedRequests_.pop_back(request);\n\nThe nit about the full stop can be fixed when applying\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n>\n>  \treturn ret;\n>  }\n> --\n> 2.31.0.291.g576ba9dcdaf-goog\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 B08DAC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Mar 2021 10:07:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19BD268781;\n\tTue, 30 Mar 2021 12:07:25 +0200 (CEST)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4AED4602D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Mar 2021 12:07:23 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id A507440007;\n\tTue, 30 Mar 2021 10:07:22 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Tue, 30 Mar 2021 12:07:57 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<20210330100757.pio2iv6sqqrptcal@uno.localdomain>","References":"<20210330062736.391600-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210330062736.391600-1-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","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=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16057,"web_url":"https://patchwork.libcamera.org/comment/16057/","msgid":"<20210330103523.juzdsocrtnpxbkwz@basti-TUXEDO-Book-XA1510>","date":"2021-03-30T10:35:23","subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","submitter":{"id":78,"url":"https://patchwork.libcamera.org/api/people/78/","name":"Sebastian Fricke","email":"sebastian.fricke@posteo.net"},"content":"Hey Jacopo,\n\nOn 30.03.2021 12:07, Jacopo Mondi wrote:\n>Hi Hiro,\n>\n>On Tue, Mar 30, 2021 at 03:27:36PM +0900, Hirokazu Honda wrote:\n>> A more appropriate type is std::dequeue as requests are reported\n>> and removed in the order of queuing.\n>>\n>> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n>> Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>\n>> ---\n>>  include/libcamera/internal/pipeline_handler.h | 4 ++--\n>>  src/libcamera/pipeline_handler.cpp            | 8 ++++----\n>>  2 files changed, 6 insertions(+), 6 deletions(-)\n>>\n>> diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\n>> index 9bdda8f3..ff9d88d8 100644\n>> --- a/include/libcamera/internal/pipeline_handler.h\n>> +++ b/include/libcamera/internal/pipeline_handler.h\n>> @@ -7,9 +7,9 @@\n>>  #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n>>  #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n>>\n>> -#include <list>\n>>  #include <map>\n>>  #include <memory>\n>> +#include <queue>\n>>  #include <set>\n>>  #include <string>\n>>  #include <sys/types.h>\n>> @@ -44,7 +44,7 @@ public:\n>>  \tvirtual ~CameraData() = default;\n>>\n>>  \tPipelineHandler *pipe_;\n>> -\tstd::list<Request *> queuedRequests_;\n>> +\tstd::deque<Request *> queuedRequests_;\n>>  \tControlInfoMap controlInfo_;\n>>  \tControlList properties_;\n>>\n>> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n>> index e3d4975d..0fe913e9 100644\n>> --- a/src/libcamera/pipeline_handler.cpp\n>> +++ b/src/libcamera/pipeline_handler.cpp\n>> @@ -72,10 +72,10 @@ LOG_DEFINE_CATEGORY(Pipeline)\n>>\n>>  /**\n>>   * \\var CameraData::queuedRequests_\n>> - * \\brief The list of queued and not yet completed request\n>> + * \\brief The queue of incomplete requests.\n>\n>we don't use . at the end\n\nThat was my fault, I suggested that change :S\nThank you.\n\n>\n>>   *\n>> - * The list of queued request is used to track requests queued in order to\n>> - * ensure completion of all requests when the pipeline handler is stopped.\n>> + * This queue is used to ensure that all requests are completed when the pipeline\n>> + * handler is stopped.\n>>   *\n>>   * \\sa PipelineHandler::queueRequest(), PipelineHandler::stop(),\n>>   * PipelineHandler::completeRequest()\n>> @@ -386,7 +386,7 @@ int PipelineHandler::queueRequest(Request *request)\n>>\n>>  \tint ret = queueRequestDevice(camera, request);\n>>  \tif (ret)\n>> -\t\tdata->queuedRequests_.remove(request);\n>> +\t\tdata->queuedRequests_.pop_back(request);\n>\n>The nit about the full stop can be fixed when applying\n>Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n>\n>Thanks\n>  j\n>>\n>>  \treturn ret;\n>>  }\n>> --\n>> 2.31.0.291.g576ba9dcdaf-goog\n>>\n>> _______________________________________________\n>> libcamera-devel mailing list\n>> libcamera-devel@lists.libcamera.org\n>> https://lists.libcamera.org/listinfo/libcamera-devel\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 D3CFEC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Mar 2021 10:35:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7833D68781;\n\tTue, 30 Mar 2021 12:35:26 +0200 (CEST)","from mout02.posteo.de (mout02.posteo.de [185.67.36.66])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 90C76602D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Mar 2021 12:35:25 +0200 (CEST)","from submission (posteo.de [89.146.220.130]) \n\tby mout02.posteo.de (Postfix) with ESMTPS id EB4832400FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Mar 2021 12:35:24 +0200 (CEST)","from customer (localhost [127.0.0.1])\n\tby submission (posteo.de) with ESMTPSA id 4F8m7039pWz9rxG;\n\tTue, 30 Mar 2021 12:35:24 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=posteo.net header.i=@posteo.net\n\theader.b=\"Bg9cNVhx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;\n\tt=1617100525; bh=uik0nFV5NDfA75J1T4FNBZWCOvJlJwmSsdd9Yf6JnkI=;\n\th=Date:From:To:Cc:Subject:From;\n\tb=Bg9cNVhx9hu6IuC4x6s9mvYCz8/Zq6CiSb7DCuf+KQJg7JZgb1we4HhM4dhOkj7On\n\tclS8628amD46PUUQEtfsdcXi4c/y+4uKocK3d92sPrRSaNq3q45LXn2A1e08bGYcYD\n\txO6M8Co8sW1d6p140FbDMrmNWN7K99QN1vOEq1YWZAzdYYkjPnsuOTauYbN7L+fBWG\n\tSY6GJyBSI25XwuqSd6T16o0BUfMldpDxVgolKUHJzWIxS6se/jg1r+jxCZN6RfjPPY\n\tP6YYdKHNV86ohemczH06hP3XFxslnHs13GLM0Dsi9ChAF1MQnyRPb6zhF4yN32JoTm\n\tql+7wRw5qbd7w==","Date":"Tue, 30 Mar 2021 12:35:23 +0200","From":"Sebastian Fricke <sebastian.fricke@posteo.net>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20210330103523.juzdsocrtnpxbkwz@basti-TUXEDO-Book-XA1510>","References":"<20210330062736.391600-1-hiroh@chromium.org>\n\t<20210330100757.pio2iv6sqqrptcal@uno.localdomain>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210330100757.pio2iv6sqqrptcal@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","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-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16059,"web_url":"https://patchwork.libcamera.org/comment/16059/","msgid":"<YGL/SiHGRrnCLtRv@pendragon.ideasonboard.com>","date":"2021-03-30T10:36:58","subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThank you for the patch.\n\nOn Tue, Mar 30, 2021 at 03:27:36PM +0900, Hirokazu Honda wrote:\n> A more appropriate type is std::dequeue as requests are reported\n> and removed in the order of queuing.\n> \n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>\n> ---\n>  include/libcamera/internal/pipeline_handler.h | 4 ++--\n>  src/libcamera/pipeline_handler.cpp            | 8 ++++----\n>  2 files changed, 6 insertions(+), 6 deletions(-)\n> \n> diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\n> index 9bdda8f3..ff9d88d8 100644\n> --- a/include/libcamera/internal/pipeline_handler.h\n> +++ b/include/libcamera/internal/pipeline_handler.h\n> @@ -7,9 +7,9 @@\n>  #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n>  #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n>  \n> -#include <list>\n>  #include <map>\n>  #include <memory>\n> +#include <queue>\n>  #include <set>\n>  #include <string>\n>  #include <sys/types.h>\n> @@ -44,7 +44,7 @@ public:\n>  \tvirtual ~CameraData() = default;\n>  \n>  \tPipelineHandler *pipe_;\n> -\tstd::list<Request *> queuedRequests_;\n> +\tstd::deque<Request *> queuedRequests_;\n\nWouldn't std::queue actually convey the meaning better ? It's\nimplemented on top of a double-ended queue (deque) by default, but\nconceptually, it exposes a FIFO interface.\n\n>  \tControlInfoMap controlInfo_;\n>  \tControlList properties_;\n>  \n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index e3d4975d..0fe913e9 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -72,10 +72,10 @@ LOG_DEFINE_CATEGORY(Pipeline)\n>  \n>  /**\n>   * \\var CameraData::queuedRequests_\n> - * \\brief The list of queued and not yet completed request\n> + * \\brief The queue of incomplete requests.\n>   *\n> - * The list of queued request is used to track requests queued in order to\n> - * ensure completion of all requests when the pipeline handler is stopped.\n> + * This queue is used to ensure that all requests are completed when the pipeline\n> + * handler is stopped.\n>   *\n>   * \\sa PipelineHandler::queueRequest(), PipelineHandler::stop(),\n>   * PipelineHandler::completeRequest()\n> @@ -386,7 +386,7 @@ int PipelineHandler::queueRequest(Request *request)\n>  \n>  \tint ret = queueRequestDevice(camera, request);\n>  \tif (ret)\n> -\t\tdata->queuedRequests_.remove(request);\n> +\t\tdata->queuedRequests_.pop_back(request);\n>  \n>  \treturn ret;\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 06EA0C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Mar 2021 10:37:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6BF068781;\n\tTue, 30 Mar 2021 12:37:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D58E9602D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Mar 2021 12:37:42 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 726C4102;\n\tTue, 30 Mar 2021 12:37:42 +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=\"IN8QJ3XS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617100662;\n\tbh=+PdF+ArdjV9zi+L31V6SqaTFgdotx8ff2H7JFtPrSgs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=IN8QJ3XSYtCRGm7jy/QAyTxWr9txoGoNno9YSk1MY+QEKV6bJg3cP5fadNlu3PVMs\n\t7s7p641bJjpDU8WcIEOAkGXQ64Z9ZpOOmDqEUkyz+8awpj0lIdH9azFUmYF+G+c4xB\n\tA9r5alhm6x0juokBvXHs6sjR3W7nN4RxloiJaQEk=","Date":"Tue, 30 Mar 2021 13:36:58 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YGL/SiHGRrnCLtRv@pendragon.ideasonboard.com>","References":"<20210330062736.391600-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210330062736.391600-1-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","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=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16064,"web_url":"https://patchwork.libcamera.org/comment/16064/","msgid":"<CAO5uPHNRcbkn2YLQ9y0yh_HhJpTCe40Un+ERrV2LyRPnp6FDFw@mail.gmail.com>","date":"2021-03-31T05:33:09","subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi all, thanks for review!\n\nOn Tue, Mar 30, 2021 at 7:37 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Hiro,\n>\n> Thank you for the patch.\n>\n> On Tue, Mar 30, 2021 at 03:27:36PM +0900, Hirokazu Honda wrote:\n> > A more appropriate type is std::dequeue as requests are reported\n> > and removed in the order of queuing.\n> >\n> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>\n> > ---\n> >  include/libcamera/internal/pipeline_handler.h | 4 ++--\n> >  src/libcamera/pipeline_handler.cpp            | 8 ++++----\n> >  2 files changed, 6 insertions(+), 6 deletions(-)\n> >\n> > diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\n> > index 9bdda8f3..ff9d88d8 100644\n> > --- a/include/libcamera/internal/pipeline_handler.h\n> > +++ b/include/libcamera/internal/pipeline_handler.h\n> > @@ -7,9 +7,9 @@\n> >  #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n> >  #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n> >\n> > -#include <list>\n> >  #include <map>\n> >  #include <memory>\n> > +#include <queue>\n> >  #include <set>\n> >  #include <string>\n> >  #include <sys/types.h>\n> > @@ -44,7 +44,7 @@ public:\n> >       virtual ~CameraData() = default;\n> >\n> >       PipelineHandler *pipe_;\n> > -     std::list<Request *> queuedRequests_;\n> > +     std::deque<Request *> queuedRequests_;\n>\n> Wouldn't std::queue actually convey the meaning better ? It's\n> implemented on top of a double-ended queue (deque) by default, but\n> conceptually, it exposes a FIFO interface.\n>\n\nThe reason why I couldn't make it std::queue is a request is removed\non failure of queueRequestDevice and pop_back() is required in\nqueueRequest().\nI wonder if we need to insert once before queueRequestDevice() call.\nFor example, is the following code fine?\nint ret = queueRequestDevice(camera, request);\nif (!ret)\n   data->queuedRequests_.push(request);\nreturn ret;\n\nMy concern to this code is that queueRequetDevice() might call\ncompleteRequest(), and then the request isn't in\ndata->queuedRequests().\n\n-Hiro\n\n> >       ControlInfoMap controlInfo_;\n> >       ControlList properties_;\n> >\n> > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > index e3d4975d..0fe913e9 100644\n> > --- a/src/libcamera/pipeline_handler.cpp\n> > +++ b/src/libcamera/pipeline_handler.cpp\n> > @@ -72,10 +72,10 @@ LOG_DEFINE_CATEGORY(Pipeline)\n> >\n> >  /**\n> >   * \\var CameraData::queuedRequests_\n> > - * \\brief The list of queued and not yet completed request\n> > + * \\brief The queue of incomplete requests.\n> >   *\n> > - * The list of queued request is used to track requests queued in order to\n> > - * ensure completion of all requests when the pipeline handler is stopped.\n> > + * This queue is used to ensure that all requests are completed when the pipeline\n> > + * handler is stopped.\n> >   *\n> >   * \\sa PipelineHandler::queueRequest(), PipelineHandler::stop(),\n> >   * PipelineHandler::completeRequest()\n> > @@ -386,7 +386,7 @@ int PipelineHandler::queueRequest(Request *request)\n> >\n> >       int ret = queueRequestDevice(camera, request);\n> >       if (ret)\n> > -             data->queuedRequests_.remove(request);\n> > +             data->queuedRequests_.pop_back(request);\n> >\n> >       return ret;\n> >  }\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 B363AC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 31 Mar 2021 05:33:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0B78A60518;\n\tWed, 31 Mar 2021 07:33:22 +0200 (CEST)","from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com\n\t[IPv6:2607:f8b0:4864:20::b2d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B7051602DB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 31 Mar 2021 07:33:19 +0200 (CEST)","by mail-yb1-xb2d.google.com with SMTP id l15so19982190ybm.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Mar 2021 22:33:19 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"T/waQIdE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=kjvDr6upxdtQs5L1EuOTsMOaQZU9zz/lwEIlK2YNI8g=;\n\tb=T/waQIdE9EEf44nIHiTktPXUmNhEfxLCo/Cp8Kp+47bItkjPn7CeuMZP4aDRurbV22\n\tFCLgVX86vXO4mS5pULuxrGPspd4IxXtU+XpZvhb7FDJC7GXia6NTt5TtnMhOtnoCMwVW\n\tLc4+tcD4nvPvb7Qbyt4R3lhrO1UUYbO5M0K3E=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=kjvDr6upxdtQs5L1EuOTsMOaQZU9zz/lwEIlK2YNI8g=;\n\tb=EEurPC73ALBm+yai7O6qULGJf7t/upvCp+rW0qIMpc/kbWTFCslz+FnTjI39Dx53Ik\n\tdMJ+DIaLHkQn0di6fgbsJQ5PZs9GCEhCKHUMxoK7STLwuqzJmATO3iTvgnC7DX9H9HBE\n\tsSLNmG3/ngx1znOJdSRn26w70/B2S1kLSdxaSQtL7jJzWLw3xYlwaTMll9UkJcmxBOCY\n\tydp9+KYyXlDGje8J8xIle9L2MJdHmPse6eSCYxVk9zACOwXWRseBaj//ITwiMfw1i6Wj\n\t5frdczjlZ0wwsTFxYu+yA17L8iivExpF5Uv+Ph2GslQJfPYj29V1zRIrKDf51B5pA+3Q\n\tMgyA==","X-Gm-Message-State":"AOAM531kFM17+a/is99UmghmTb+sAjB3j88uxK9CplyS9E76dHBq+VWf\n\t7d/Dc4vTyIFRdL6WOc6Xot3zaTvExZ40L2kZlwA+8g==","X-Google-Smtp-Source":"ABdhPJyRDty5VxFJRTANwfrpQn/f/Xv72waq7VlkSzqD3MhT6LlD/gWSDKfEbNJq/Jz3srVKR1ZtepHzpeO2tKtDO8o=","X-Received":"by 2002:a25:6782:: with SMTP id\n\tb124mr2503379ybc.472.1617168798545; \n\tTue, 30 Mar 2021 22:33:18 -0700 (PDT)","MIME-Version":"1.0","References":"<20210330062736.391600-1-hiroh@chromium.org>\n\t<YGL/SiHGRrnCLtRv@pendragon.ideasonboard.com>","In-Reply-To":"<YGL/SiHGRrnCLtRv@pendragon.ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Wed, 31 Mar 2021 14:33:09 +0900","Message-ID":"<CAO5uPHNRcbkn2YLQ9y0yh_HhJpTCe40Un+ERrV2LyRPnp6FDFw@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","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 <libcamera-devel@lists.libcamera.org>","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>"}},{"id":16099,"web_url":"https://patchwork.libcamera.org/comment/16099/","msgid":"<YGe8/XWxHgRXjLoS@pendragon.ideasonboard.com>","date":"2021-04-03T00:55:25","subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nOn Wed, Mar 31, 2021 at 02:33:09PM +0900, Hirokazu Honda wrote:\n> On Tue, Mar 30, 2021 at 7:37 PM Laurent Pinchart wrote:\n> > On Tue, Mar 30, 2021 at 03:27:36PM +0900, Hirokazu Honda wrote:\n> > > A more appropriate type is std::dequeue as requests are reported\n> > > and removed in the order of queuing.\n> > >\n> > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > > Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>\n> > > ---\n> > >  include/libcamera/internal/pipeline_handler.h | 4 ++--\n> > >  src/libcamera/pipeline_handler.cpp            | 8 ++++----\n> > >  2 files changed, 6 insertions(+), 6 deletions(-)\n> > >\n> > > diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\n> > > index 9bdda8f3..ff9d88d8 100644\n> > > --- a/include/libcamera/internal/pipeline_handler.h\n> > > +++ b/include/libcamera/internal/pipeline_handler.h\n> > > @@ -7,9 +7,9 @@\n> > >  #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n> > >  #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n> > >\n> > > -#include <list>\n> > >  #include <map>\n> > >  #include <memory>\n> > > +#include <queue>\n> > >  #include <set>\n> > >  #include <string>\n> > >  #include <sys/types.h>\n> > > @@ -44,7 +44,7 @@ public:\n> > >       virtual ~CameraData() = default;\n> > >\n> > >       PipelineHandler *pipe_;\n> > > -     std::list<Request *> queuedRequests_;\n> > > +     std::deque<Request *> queuedRequests_;\n> >\n> > Wouldn't std::queue actually convey the meaning better ? It's\n> > implemented on top of a double-ended queue (deque) by default, but\n> > conceptually, it exposes a FIFO interface.\n> \n> The reason why I couldn't make it std::queue is a request is removed\n> on failure of queueRequestDevice and pop_back() is required in\n> queueRequest().\n> I wonder if we need to insert once before queueRequestDevice() call.\n> For example, is the following code fine?\n> int ret = queueRequestDevice(camera, request);\n> if (!ret)\n>    data->queuedRequests_.push(request);\n> return ret;\n> \n> My concern to this code is that queueRequetDevice() might call\n> completeRequest(), and then the request isn't in\n> data->queuedRequests().\n\nI agree, this can cause problems.\n\nWith your \"[PATCH 0/3] Handle an request error\" series, an in particular\npatch 2/3, I think you don't need to remove the request from the queue\nanymore. Maybe this patch could be rebased on top of that series, and\nthen would be able to use std::queue ?\n\n> > >       ControlInfoMap controlInfo_;\n> > >       ControlList properties_;\n> > >\n> > > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > > index e3d4975d..0fe913e9 100644\n> > > --- a/src/libcamera/pipeline_handler.cpp\n> > > +++ b/src/libcamera/pipeline_handler.cpp\n> > > @@ -72,10 +72,10 @@ LOG_DEFINE_CATEGORY(Pipeline)\n> > >\n> > >  /**\n> > >   * \\var CameraData::queuedRequests_\n> > > - * \\brief The list of queued and not yet completed request\n> > > + * \\brief The queue of incomplete requests.\n> > >   *\n> > > - * The list of queued request is used to track requests queued in order to\n> > > - * ensure completion of all requests when the pipeline handler is stopped.\n> > > + * This queue is used to ensure that all requests are completed when the pipeline\n> > > + * handler is stopped.\n> > >   *\n> > >   * \\sa PipelineHandler::queueRequest(), PipelineHandler::stop(),\n> > >   * PipelineHandler::completeRequest()\n> > > @@ -386,7 +386,7 @@ int PipelineHandler::queueRequest(Request *request)\n> > >\n> > >       int ret = queueRequestDevice(camera, request);\n> > >       if (ret)\n> > > -             data->queuedRequests_.remove(request);\n> > > +             data->queuedRequests_.pop_back(request);\n\nBy the way, I think this should be\n\n\t\tdata->queuedRequests_.pop_back();\n\nas it doesn't compile otherwise, but if you rebase the patch as proposed\nabove, it won't matter.\n\n> > >\n> > >       return ret;\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 86265C0DA3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  3 Apr 2021 00:56:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8C7468786;\n\tSat,  3 Apr 2021 02:56:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 850FE602CF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Apr 2021 02:56:10 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F3ADA3D7;\n\tSat,  3 Apr 2021 02:56:09 +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=\"ZvOwByTr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617411370;\n\tbh=Lq55QtSoAHGAf9XxpjIOkl4Zcf5An5EZ73YBBNY1a5w=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ZvOwByTr1sjEUHVoJ0kxu1SbzTYcElpoeZz4FvYdKwANlVPVQr1SbKw04rWfMLTX5\n\tRkmLsB0aglp5il8cTnAUjBER0SzLdiJyvxMHCS1vsKkWMZ2eDizRRjPeZcAuR49Fp5\n\tQ0ewjRELzTMbl2l1oSQ17xvNpsHw5FBLxEYn6XmA=","Date":"Sat, 3 Apr 2021 03:55:25 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YGe8/XWxHgRXjLoS@pendragon.ideasonboard.com>","References":"<20210330062736.391600-1-hiroh@chromium.org>\n\t<YGL/SiHGRrnCLtRv@pendragon.ideasonboard.com>\n\t<CAO5uPHNRcbkn2YLQ9y0yh_HhJpTCe40Un+ERrV2LyRPnp6FDFw@mail.gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<CAO5uPHNRcbkn2YLQ9y0yh_HhJpTCe40Un+ERrV2LyRPnp6FDFw@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: CameraData: Change\n\tqueuedRequests_ type to std::dequeue","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 <libcamera-devel@lists.libcamera.org>","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>"}}]