[{"id":15635,"web_url":"https://patchwork.libcamera.org/comment/15635/","msgid":"<YEv3QWNmA79lR0Qr@bismarck.dyn.berto.se>","date":"2021-03-12T23:20:33","subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Kieran and Laurent,\n\nOn 2021-03-12 05:47:21 +0000, Kieran Bingham wrote:\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Events may be queued to the pipeline handler between the pipeline\n> handler entering the ::stop() function, and before the call to stop the\n> IPA has completed.\n> \n> Handle these events by dispatching all pending messages at the proxy\n> after the IPA has fully stopped.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  utils/ipc/generators/libcamera_templates/proxy_functions.tmpl | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> index 13dc8fdcab6e..8addc2fad0a8 100644\n> --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> @@ -31,6 +31,8 @@\n>  \tthread_.exit();\n>  \tthread_.wait();\n>  \n> +\tThread::current()->dispatchMessages(Message::Type::InvokeMessage);\n\nIs this not similar to the issue we have in cam? What if the events \nprocessed here themself queue events will they be processed? I wonder if \nthe cleanest solution to all this would be to stop accepting messages as \nthe first step and return errors for all calls that would generate an \nevent. After we stopped accepting new events we can process the queue \nuntil it's empty and once that is done we can stop the IPA.\n\nMaybe it's overkill but at least we would make the race windows smaller \nand easier to reproduce when found as they would only depend on the \ncontent of the queue at stop().\n\n> +\n>  \trunning_ = false;\n>  {%- endmacro -%}\n>  \n> -- \n> 2.25.1\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 BA8DDBD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Mar 2021 23:20:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1111568C68;\n\tSat, 13 Mar 2021 00:20:37 +0100 (CET)","from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com\n\t[IPv6:2a00:1450:4864:20::32e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 41164602E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 00:20:35 +0100 (CET)","by mail-wm1-x32e.google.com with SMTP id g20so4719221wmk.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Mar 2021 15:20:35 -0800 (PST)","from localhost (p54ac5521.dip0.t-ipconnect.de. [84.172.85.33])\n\tby smtp.gmail.com with ESMTPSA id\n\tp17sm3721221wmq.47.2021.03.12.15.20.34\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 12 Mar 2021 15:20:34 -0800 (PST)"],"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=\"OuTqS6IT\"; 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=yXdIX+3MDLiwjNmwm2oqXG1+PWWo2gAtTLTBa4zPh64=;\n\tb=OuTqS6ITfnQIq+PEQpjUj3u1cYXf5qNvNfsr3X1Q+Hc5TSqAM9RRBxgdo4GQJINoH1\n\tDNT6zoWvvNE/oqw5eUgn5DItvh9q3/9JX9o7HIw9r1wEU3uxkpNYzvHevXE35QP602Bg\n\tj2iQlMPda6sgWiXPHUS1KF0BcfMXoV2VF/VqZVNeqK84GSzqF5aYHX1X7pAA4Na2sgxy\n\tNWyUw5GiprmegOzcR2dZpPbeb/sIT8SPazJNCgJGIQSthzlRKITsdOuSbgcOpzw2QN50\n\tXyYpYGHP66UYKdHJFgIKa/UqzYm8FkqwKJ1dzVqZhPVHPXdqUMBrDlnPD2RQFaf7v9QP\n\tnTLQ==","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=yXdIX+3MDLiwjNmwm2oqXG1+PWWo2gAtTLTBa4zPh64=;\n\tb=RdvFFbrWW1ovj5v6io/dNzP7tfvsOncmzqnRpElw0kNvk1FhnV+8vUHyb4v0+7USed\n\tljPr9YwXTv3mfVw5lJ14m+SOhpRN3mNvmL0Qq5d9Wxj1dIE2FN8+wDnWmgHPW32ml4S/\n\tev0kbI2UqoULr+na1MbN1+1pv65jexL3gnrTpDaI6EAY09m14qXn+TuRar6KmbeYdDld\n\tJzzNYIBKIDyjP00Moiqa7b4RB2sdCgaNvuZCwPFNsf7oY/ydSNfBZL8bSnNw7/uIRB7n\n\tz/PY2KWZkrdcAeRMcYeirJtdxNuGji/u8lN7OISu5rww2zPWOOU6eXScnTW5BI0Ye4sY\n\t1WkQ==","X-Gm-Message-State":"AOAM532f9sS2sAvsF6HryzOMBhY2ZzbveRY79Sz8WjsFnNNGgFPHO/oJ\n\tsOo8frCo7Ghrobxy2aDfygJZcdub3eT0X2lQ","X-Google-Smtp-Source":"ABdhPJxPYu2SjFvkzsbB6vg+WUJBMBA3yEDH/SqQDBAx0OA66vC9N0JNMNcKiOAFi1K5GnFHgTLokA==","X-Received":"by 2002:a1c:bc82:: with SMTP id\n\tm124mr15205111wmf.118.1615591234864; \n\tFri, 12 Mar 2021 15:20:34 -0800 (PST)","Date":"Sat, 13 Mar 2021 00:20:33 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YEv3QWNmA79lR0Qr@bismarck.dyn.berto.se>","References":"<20210312054727.852622-1-kieran.bingham@ideasonboard.com>\n\t<20210312054727.852622-3-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210312054727.852622-3-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","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=\"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>"}},{"id":15645,"web_url":"https://patchwork.libcamera.org/comment/15645/","msgid":"<20210313092801.n3gwidi5adqr642p@uno.localdomain>","date":"2021-03-13T09:28:01","subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Kieran\n\nOn Fri, Mar 12, 2021 at 05:47:21AM +0000, Kieran Bingham wrote:\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> Events may be queued to the pipeline handler between the pipeline\n> handler entering the ::stop() function, and before the call to stop the\n> IPA has completed.\n>\n> Handle these events by dispatching all pending messages at the proxy\n> after the IPA has fully stopped.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> ---\n>  utils/ipc/generators/libcamera_templates/proxy_functions.tmpl | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> index 13dc8fdcab6e..8addc2fad0a8 100644\n> --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> @@ -31,6 +31,8 @@\n>  \tthread_.exit();\n>  \tthread_.wait();\n>\n> +\tThread::current()->dispatchMessages(Message::Type::InvokeMessage);\n> +\n>  \trunning_ = false;\n>  {%- endmacro -%}\n>\n> --\n> 2.25.1\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 9D190BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Mar 2021 09:27:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 68005602E3;\n\tSat, 13 Mar 2021 10:27:32 +0100 (CET)","from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1CCAC602E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 10:27:31 +0100 (CET)","from uno.localdomain (host-79-22-58-175.retail.telecomitalia.it\n\t[79.22.58.175]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id 4D31C200007;\n\tSat, 13 Mar 2021 09:27:30 +0000 (UTC)"],"Date":"Sat, 13 Mar 2021 10:28:01 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20210313092801.n3gwidi5adqr642p@uno.localdomain>","References":"<20210312054727.852622-1-kieran.bingham@ideasonboard.com>\n\t<20210312054727.852622-3-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210312054727.852622-3-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","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":15655,"web_url":"https://patchwork.libcamera.org/comment/15655/","msgid":"<YE0vcM54kQ3o0cgI@pendragon.ideasonboard.com>","date":"2021-03-13T21:32:32","subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nOn Sat, Mar 13, 2021 at 12:20:33AM +0100, Niklas Söderlund wrote:\n> On 2021-03-12 05:47:21 +0000, Kieran Bingham wrote:\n> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > \n> > Events may be queued to the pipeline handler between the pipeline\n> > handler entering the ::stop() function, and before the call to stop the\n> > IPA has completed.\n> > \n> > Handle these events by dispatching all pending messages at the proxy\n> > after the IPA has fully stopped.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  utils/ipc/generators/libcamera_templates/proxy_functions.tmpl | 2 ++\n> >  1 file changed, 2 insertions(+)\n> > \n> > diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> > index 13dc8fdcab6e..8addc2fad0a8 100644\n> > --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> > +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> > @@ -31,6 +31,8 @@\n> >  \tthread_.exit();\n> >  \tthread_.wait();\n> >  \n> > +\tThread::current()->dispatchMessages(Message::Type::InvokeMessage);\n> \n> Is this not similar to the issue we have in cam? What if the events \n> processed here themself queue events will they be processed?\n\nIt's up to the pipeline handler to decide what to do with these events.\nFor instance, if the pipeline handler stop() function stops the IPA\nfirst and then stops video nodes, and the events delivered from the IPA\nresult in buffers being queued to the video nodes, those buffers will be\ncancelled right away when the video nodes are stopped, so it's harmless\n(even if it wastes a bit of CPU time). On the other hand, if the\npipeline handler sends more events to the IPA, the IPA would never be\nable to process them as it's stopped by the time messages are dispatched\nhere, and that's an error. The pipeline handler may thus need to\nimplement a state machine to correctly process events it receives,\ndepending on what state it is in. In any case, pending events should be\ndelivered before the IPA stop() call returns, as the alternative is to\ndeliver them later, which creates more race conditions (one case e\nparticularly want to avoid is events generated before stop() being\ndelivered after the camera is re-start()ed, and considered by the\npipeline handler as events pertaining to the new capture session).\n\n> I wonder if \n> the cleanest solution to all this would be to stop accepting messages as \n> the first step and return errors for all calls that would generate an \n> event. After we stopped accepting new events we can process the queue \n> until it's empty and once that is done we can stop the IPA.\n\nI think that's what I meant above with the state machine, right ? I see\nit as a pipeline handler decision, depending on whether the event\nhandlers can run unconditionally or not.\n\n> Maybe it's overkill but at least we would make the race windows smaller \n> and easier to reproduce when found as they would only depend on the \n> content of the queue at stop().\n> \n> > +\n> >  \trunning_ = false;\n> >  {%- endmacro -%}\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 843ACBD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Mar 2021 21:33:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D676B6084D;\n\tSat, 13 Mar 2021 22:33:08 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AF539605B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 22:33:07 +0100 (CET)","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 2C9BD3F0;\n\tSat, 13 Mar 2021 22:33:07 +0100 (CET)"],"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=\"fLBl3cs9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615671187;\n\tbh=kWBs8w50WhcdKy9uZ+3HRGDIJJsKt08H0Up5V0B7ztM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=fLBl3cs9Auwdj+6gCP8hqzi0TdgL2g6+nDaySC3+UY1mL+KrzEemTafF29tcloxiF\n\t95pdkQOKZw3vaEAHIIEv1bgqxxNgMGSl4w0cAzDjzI9e6yX8s9ZSY4ID17B3TE4rtq\n\tEhTtUMC+Apk/Nzo3pa9xNuf0r3kC4xkvwEdtazoE=","Date":"Sat, 13 Mar 2021 23:32:32 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<YE0vcM54kQ3o0cgI@pendragon.ideasonboard.com>","References":"<20210312054727.852622-1-kieran.bingham@ideasonboard.com>\n\t<20210312054727.852622-3-kieran.bingham@ideasonboard.com>\n\t<YEv3QWNmA79lR0Qr@bismarck.dyn.berto.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<YEv3QWNmA79lR0Qr@bismarck.dyn.berto.se>","Subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","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=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":15656,"web_url":"https://patchwork.libcamera.org/comment/15656/","msgid":"<YE0vx60AgMQI0atc@pendragon.ideasonboard.com>","date":"2021-03-13T21:33:59","subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the (my ;-)) patch.\n\nOn Fri, Mar 12, 2021 at 05:47:21AM +0000, Kieran Bingham wrote:\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Events may be queued to the pipeline handler between the pipeline\n> handler entering the ::stop() function, and before the call to stop the\n> IPA has completed.\n> \n> Handle these events by dispatching all pending messages at the proxy\n> after the IPA has fully stopped.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nThis can go in a follow-up patch, but we need to document the fact that\npipeline handlers shall expect events to be delivered while they're\nblocked on stop().\n\n> ---\n>  utils/ipc/generators/libcamera_templates/proxy_functions.tmpl | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> index 13dc8fdcab6e..8addc2fad0a8 100644\n> --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> @@ -31,6 +31,8 @@\n>  \tthread_.exit();\n>  \tthread_.wait();\n>  \n> +\tThread::current()->dispatchMessages(Message::Type::InvokeMessage);\n> +\n>  \trunning_ = false;\n>  {%- endmacro -%}\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 A234FBD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Mar 2021 21:34:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5C0916084D;\n\tSat, 13 Mar 2021 22:34:36 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9BEF7605B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 22:34:34 +0100 (CET)","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 2813D3F0;\n\tSat, 13 Mar 2021 22:34:34 +0100 (CET)"],"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=\"sPHzXBb3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615671274;\n\tbh=P/kITbMo2c3FaH3nFA2NEtrQN+zQs/1QDtb8VB1TjZo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sPHzXBb34c8L+vK76q+Uhf0BEkw6ruy7IWYWGRUiQLfm9PhQRq2pDhVxBAno9eXIb\n\ttRsF+uY2+dMT6dPRfQWC2tdIehlzEDS1rOlqELm3E8Xaq/+eNgOgEffYX91dzCLeiu\n\tPYHLhGlPeEiUjEm3WUybLPUZuzXAab6OV2iOky6c=","Date":"Sat, 13 Mar 2021 23:33:59 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YE0vx60AgMQI0atc@pendragon.ideasonboard.com>","References":"<20210312054727.852622-1-kieran.bingham@ideasonboard.com>\n\t<20210312054727.852622-3-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210312054727.852622-3-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/8] utils: ipc: proxy: Process\n\tpending messages","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>"}}]