[{"id":10987,"web_url":"https://patchwork.libcamera.org/comment/10987/","msgid":"<20200629204837.GT10681@pendragon.ideasonboard.com>","date":"2020-06-29T20:48:37","subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: ipu3: cio2: Do not\n\tproxy signal","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Mon, Jun 29, 2020 at 05:35:18PM +0200, Niklas Söderlund wrote:\n> Do not proxy the signal in the CI2Device when there is no need for it,\n> remove it.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n> This is a leftover form the CIO2 rework which fell thru the cracks I'm\n> sorry I missed to resort it in the last version.\n> ---\n>  src/libcamera/pipeline/ipu3/cio2.cpp | 8 --------\n>  src/libcamera/pipeline/ipu3/cio2.h   | 6 +++---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-\n>  3 files changed, 4 insertions(+), 12 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\n> index aa1459fb3599283b..08b6a9a12916299b 100644\n> --- a/src/libcamera/pipeline/ipu3/cio2.cpp\n> +++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n> @@ -15,7 +15,6 @@\n>  #include \"libcamera/internal/camera_sensor.h\"\n>  #include \"libcamera/internal/media_device.h\"\n>  #include \"libcamera/internal/v4l2_subdevice.h\"\n> -#include \"libcamera/internal/v4l2_videodevice.h\"\n>  \n>  namespace libcamera {\n>  \n> @@ -125,8 +124,6 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index)\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\toutput_->bufferReady.connect(this, &CIO2Device::cio2BufferReady);\n> -\n>  \treturn 0;\n\nYou could also merge the return with the function call just above this\nhunk if you want to.\n\n>  }\n>  \n> @@ -289,9 +286,4 @@ void CIO2Device::freeBuffers()\n>  \t\tLOG(IPU3, Error) << \"Failed to release CIO2 buffers\";\n>  }\n>  \n> -void CIO2Device::cio2BufferReady(FrameBuffer *buffer)\n> -{\n> -\tbufferReady.emit(buffer);\n> -}\n> -\n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h\n> index dc764b101f112f05..4fd949f8e5132e07 100644\n> --- a/src/libcamera/pipeline/ipu3/cio2.h\n> +++ b/src/libcamera/pipeline/ipu3/cio2.h\n> @@ -13,15 +13,15 @@\n>  \n>  #include <libcamera/signal.h>\n>  \n> +#include \"libcamera/internal/v4l2_videodevice.h\"\n> +\n>  namespace libcamera {\n>  \n>  class CameraSensor;\n>  class FrameBuffer;\n>  class MediaDevice;\n>  class Request;\n> -class V4L2DeviceFormat;\n>  class V4L2Subdevice;\n> -class V4L2VideoDevice;\n>  struct Size;\n>  struct StreamConfiguration;\n>  \n> @@ -48,7 +48,7 @@ public:\n>  \n>  \tint queueBuffer(Request *request, FrameBuffer *rawBuffer);\n>  \tvoid tryReturnBuffer(FrameBuffer *buffer);\n> -\tSignal<FrameBuffer *> bufferReady;\n> +\tSignal<FrameBuffer *> &bufferReady() { return output_->bufferReady; }\n\nI don't like how our signals are public member variables without a\ntrailing _, and I though about adding a macro along the lines of\n\n\tSIGNAL(bufferReady, FrameBuffer *);\n\nthat would result in\n\npublic:\n\tSignal<FrameBuffer *> &bufferReady() { return bufferReady_; }\nprivate:\n\tSignal<FrameBuffer *> bufferReady_;\npublic:\n\nexcept that I don't like how it would implicitly reset the access level\nto public. And it probably doesn't bring much either. Maybe I'll have a\nclever idea I like in the future :-) In any case, it's not really\nrelated to this patch, except for the fact that we would then always\nwrite\n\n\tdata->cio2_.bufferReady().connect(...);\n\nregardless of whether the signal is proxied or not, which I think would\nbe nice.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n>  private:\n>  \tvoid freeBuffers();\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 4e75bd40c66f821a..c1dc377d1fd5b58c 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -805,7 +805,7 @@ int PipelineHandlerIPU3::registerCameras()\n>  \t\t * associated ImgU input where they get processed and\n>  \t\t * returned through the ImgU main and secondary outputs.\n>  \t\t */\n> -\t\tdata->cio2_.bufferReady.connect(data.get(),\n> +\t\tdata->cio2_.bufferReady().connect(data.get(),\n>  \t\t\t\t\t&IPU3CameraData::cio2BufferReady);\n>  \t\tdata->imgu_->input_->bufferReady.connect(&data->cio2_,\n>  \t\t\t\t\t&CIO2Device::tryReturnBuffer);","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 123D3C2E6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Jun 2020 20:48:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7C1FD609DB;\n\tMon, 29 Jun 2020 22:48:42 +0200 (CEST)","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 BCAB7603B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2020 22:48:41 +0200 (CEST)","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 3631C299;\n\tMon, 29 Jun 2020 22:48:41 +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=\"e9ELMwrD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593463721;\n\tbh=yeyx8r3zK1oA3TPsxPTfuB7ROVUfzszNde9/S84qk1w=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=e9ELMwrDYgy9YgqcyPVWMoB9qoLLWDb6QpxocvhJFvqnpC0/4Y1z+iT4WIlUvK+JA\n\tkfAso/fOBE6egJ+zjeTVimo52Q+WdrjOTsbbKIb181OrCfHkJsgoz0Mlg3BBfqEg7L\n\t9zLeRQ/vsE+VnCjmmnmXtKpSh77WwEu6mCBlCUmQ=","Date":"Mon, 29 Jun 2020 23:48:37 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200629204837.GT10681@pendragon.ideasonboard.com>","References":"<20200629153518.3734304-1-niklas.soderlund@ragnatech.se>\n\t<20200629153518.3734304-2-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200629153518.3734304-2-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: ipu3: cio2: Do not\n\tproxy signal","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=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":11016,"web_url":"https://patchwork.libcamera.org/comment/11016/","msgid":"<20200630130029.GA2226315@oden.dyn.berto.se>","date":"2020-06-30T13:00:29","subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: ipu3: cio2: Do not\n\tproxy signal","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your feedback.\n\nOn 2020-06-29 23:48:37 +0300, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Mon, Jun 29, 2020 at 05:35:18PM +0200, Niklas Söderlund wrote:\n> > Do not proxy the signal in the CI2Device when there is no need for it,\n> > remove it.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> > This is a leftover form the CIO2 rework which fell thru the cracks I'm\n> > sorry I missed to resort it in the last version.\n> > ---\n> >  src/libcamera/pipeline/ipu3/cio2.cpp | 8 --------\n> >  src/libcamera/pipeline/ipu3/cio2.h   | 6 +++---\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-\n> >  3 files changed, 4 insertions(+), 12 deletions(-)\n> > \n> > diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\n> > index aa1459fb3599283b..08b6a9a12916299b 100644\n> > --- a/src/libcamera/pipeline/ipu3/cio2.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n> > @@ -15,7 +15,6 @@\n> >  #include \"libcamera/internal/camera_sensor.h\"\n> >  #include \"libcamera/internal/media_device.h\"\n> >  #include \"libcamera/internal/v4l2_subdevice.h\"\n> > -#include \"libcamera/internal/v4l2_videodevice.h\"\n> >  \n> >  namespace libcamera {\n> >  \n> > @@ -125,8 +124,6 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index)\n> >  \tif (ret)\n> >  \t\treturn ret;\n> >  \n> > -\toutput_->bufferReady.connect(this, &CIO2Device::cio2BufferReady);\n> > -\n> >  \treturn 0;\n> \n> You could also merge the return with the function call just above this\n> hunk if you want to.\n\nGood point, will do so for v2.\n\n> \n> >  }\n> >  \n> > @@ -289,9 +286,4 @@ void CIO2Device::freeBuffers()\n> >  \t\tLOG(IPU3, Error) << \"Failed to release CIO2 buffers\";\n> >  }\n> >  \n> > -void CIO2Device::cio2BufferReady(FrameBuffer *buffer)\n> > -{\n> > -\tbufferReady.emit(buffer);\n> > -}\n> > -\n> >  } /* namespace libcamera */\n> > diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h\n> > index dc764b101f112f05..4fd949f8e5132e07 100644\n> > --- a/src/libcamera/pipeline/ipu3/cio2.h\n> > +++ b/src/libcamera/pipeline/ipu3/cio2.h\n> > @@ -13,15 +13,15 @@\n> >  \n> >  #include <libcamera/signal.h>\n> >  \n> > +#include \"libcamera/internal/v4l2_videodevice.h\"\n> > +\n> >  namespace libcamera {\n> >  \n> >  class CameraSensor;\n> >  class FrameBuffer;\n> >  class MediaDevice;\n> >  class Request;\n> > -class V4L2DeviceFormat;\n> >  class V4L2Subdevice;\n> > -class V4L2VideoDevice;\n> >  struct Size;\n> >  struct StreamConfiguration;\n> >  \n> > @@ -48,7 +48,7 @@ public:\n> >  \n> >  \tint queueBuffer(Request *request, FrameBuffer *rawBuffer);\n> >  \tvoid tryReturnBuffer(FrameBuffer *buffer);\n> > -\tSignal<FrameBuffer *> bufferReady;\n> > +\tSignal<FrameBuffer *> &bufferReady() { return output_->bufferReady; }\n> \n> I don't like how our signals are public member variables without a\n> trailing _, and I though about adding a macro along the lines of\n> \n> \tSIGNAL(bufferReady, FrameBuffer *);\n> \n> that would result in\n> \n> public:\n> \tSignal<FrameBuffer *> &bufferReady() { return bufferReady_; }\n> private:\n> \tSignal<FrameBuffer *> bufferReady_;\n> public:\n\nLIBCAMERA_OBJECT\n\nsignals:\n    void bufferReady(FrameBuffer *);\n\n;-P\n\n> \n> except that I don't like how it would implicitly reset the access level\n> to public. And it probably doesn't bring much either. Maybe I'll have a\n> clever idea I like in the future :-) In any case, it's not really\n> related to this patch, except for the fact that we would then always\n> write\n> \n> \tdata->cio2_.bufferReady().connect(...);\n> \n> regardless of whether the signal is proxied or not, which I think would\n> be nice.\n\nJoking aside I think this would be a nice thing if something clever \ncould be figure out about a SIGNAL() macro along the lines you suggest.  \nIt would also need to be figured out how the Doxygen section for such \nsignals should be written with ease.\n\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> >  \n> >  private:\n> >  \tvoid freeBuffers();\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index 4e75bd40c66f821a..c1dc377d1fd5b58c 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -805,7 +805,7 @@ int PipelineHandlerIPU3::registerCameras()\n> >  \t\t * associated ImgU input where they get processed and\n> >  \t\t * returned through the ImgU main and secondary outputs.\n> >  \t\t */\n> > -\t\tdata->cio2_.bufferReady.connect(data.get(),\n> > +\t\tdata->cio2_.bufferReady().connect(data.get(),\n> >  \t\t\t\t\t&IPU3CameraData::cio2BufferReady);\n> >  \t\tdata->imgu_->input_->bufferReady.connect(&data->cio2_,\n> >  \t\t\t\t\t&CIO2Device::tryReturnBuffer);\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 909B7BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Jun 2020 13:00:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0717160C56;\n\tTue, 30 Jun 2020 15:00:34 +0200 (CEST)","from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com\n\t[IPv6:2a00:1450:4864:20::22e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C2ED603B4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2020 15:00:32 +0200 (CEST)","by mail-lj1-x22e.google.com with SMTP id t25so17789965lji.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Jun 2020 06:00:32 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\td6sm708113lja.77.2020.06.30.06.00.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 30 Jun 2020 06:00:30 -0700 (PDT)"],"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=\"fW2zwvMg\"; 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=q7AWN/O/LEHk+F94DScOCwHxlRAJUVseOhX0I/+ZPYQ=;\n\tb=fW2zwvMgEE9UvsMIlcTltoEX6MrUI62ZS4008qNu2r7NBnAylu0V0jAFpCe6HAeqJL\n\t37W6EOj5I2oCRDk5IE/SfIr46QWX1RGVd9rxa55u8ubSzQ2Ikb8Q4c95JsfoLS/e9lyd\n\tFwqGIBJgc9tzRoCVmbWXXAD8vyRrbKY53c121nTYC/8xVROElNBFQWM+ehpcvPBg55y4\n\tLeBMWCCT5T3yPYKiiX9F+ElnJlEJMsN6laIBsBVsNz3pUItCo6lD+3rhFPLr6JQYq15I\n\t8QCo05+pwCHeGa1IysR9RcqpvGhhIYBGQJb5Dxlil+FaPwGpvSd0FQ1WU07UGOIZC8S8\n\tFbaQ==","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=q7AWN/O/LEHk+F94DScOCwHxlRAJUVseOhX0I/+ZPYQ=;\n\tb=pgbh06YLjKpnwfT0GVCn6OpIezj38z85uZGvQUwFUjUmR3PpMxsVtiSHSNyd6pZBFC\n\tm+/dOkOtLwd606b07U9/MX6r4fCHGU2xFS4RcgWAhLx6cJvySwkwCZ0Yt367C0XJYfam\n\tDyJaGuw0odro1zwVD3VCFDgVqsCFrkYWIK634uT9oWjzrvh4KQSEgE4s41+jwNh+R6Vh\n\tT3PbYFIcIQj+HdTb/AV0X42vQsFPGRABOox3gTSwb0DctovRtPZR3ksJSAxkxyXaFizD\n\tr5pQeYE2z0v6NEx6nJus1reZEDxHKZc5FQ9bE1JXhnj3x+LJYxsHbPQNQh3qYRUUTrPb\n\tUikQ==","X-Gm-Message-State":"AOAM532FSIHweWn8C+/Eu94RNFLUo+yZulIxIrTPmoJBPa9wm+xtHwaG\n\tFi5pNl91aqvrCKTjElHCh1yXWQ==","X-Google-Smtp-Source":"ABdhPJzPe2NZEHgQChzkkXwAuaf8XzByMp8Jc5oUqh2TXreMeVI5vlNlnAy6vfsnhl6PLRj1x2uPog==","X-Received":"by 2002:a2e:85ce:: with SMTP id h14mr732355ljj.356.1593522031197;\n\tTue, 30 Jun 2020 06:00:31 -0700 (PDT)","Date":"Tue, 30 Jun 2020 15:00:29 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20200630130029.GA2226315@oden.dyn.berto.se>","References":"<20200629153518.3734304-1-niklas.soderlund@ragnatech.se>\n\t<20200629153518.3734304-2-niklas.soderlund@ragnatech.se>\n\t<20200629204837.GT10681@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200629204837.GT10681@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: ipu3: cio2: Do not\n\tproxy signal","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=\"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>"}}]