[{"id":10936,"web_url":"https://patchwork.libcamera.org/comment/10936/","msgid":"<20200628181139.GL1105424@oden.dyn.berto.se>","date":"2020-06-28T18:11:39","subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: ipu3: Accept an empty\n\troles list","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2020-06-28 17:55:38 +0200, Jacopo Mondi wrote:\n> The IPU3 pipeline handler that does not support receiving an empty list\n> of roles at generateConfiguration() time. This contradicts the camera\n> API which allows application to generate empty CameraConfiguration to\n> be later manually filled.\n> \n> Fix this by returning an empty CameraConfiguration if the list of\n> requested roles is empty. While at it, align the style with the other\n> pipeline handlers.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nI'm not sure this is the way we wish this API to work in the end. But a \ngood start is that all pipelines do the same thing :-)\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index ef57196c32da..cbf19793c43e 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -292,14 +292,15 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>  \tconst StreamRoles &roles)\n>  {\n>  \tIPU3CameraData *data = cameraData(camera);\n> -\tIPU3CameraConfiguration *config;\n> +\tIPU3CameraConfiguration *config = new IPU3CameraConfiguration(camera, data);\n>  \tstd::set<Stream *> streams = {\n>  \t\t&data->outStream_,\n>  \t\t&data->vfStream_,\n>  \t\t&data->rawStream_,\n>  \t};\n>  \n> -\tconfig = new IPU3CameraConfiguration(camera, data);\n> +\tif (roles.empty())\n> +\t\treturn config;\n>  \n>  \tfor (const StreamRole role : roles) {\n>  \t\tStreamConfiguration cfg = {};\n> -- \n> 2.27.0\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 7CA59C2E69\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Jun 2020 18:11:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4B975609C9;\n\tSun, 28 Jun 2020 20:11:42 +0200 (CEST)","from mail-lf1-x142.google.com (mail-lf1-x142.google.com\n\t[IPv6:2a00:1450:4864:20::142])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B70B1603B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Jun 2020 20:11:40 +0200 (CEST)","by mail-lf1-x142.google.com with SMTP id g2so7870268lfb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Jun 2020 11:11:40 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tu5sm8293634lfm.81.2020.06.28.11.11.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 28 Jun 2020 11:11:39 -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=\"JFkdxQ/a\"; 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=+Vsg99fMsG3XrMOEAGk/1RLWqf5i0o2S9GHs39YrllE=;\n\tb=JFkdxQ/aY0b8U32PikyON8rtGJGLZIs9cTtlKv0s731qp4az7Pf7RfeBG2Odshpd6r\n\taby3a8LmMpWtTzF+59GNZDQrfShU+GUGogitXCh1RsA2aV0Mt3eOTFlmz3yQUwouwhue\n\txBUZeMFABuRZk+IB0/dukx9kFaCVT0DbuQzBVz0yWnVBjxivcnBp3oPYOnmja3/FpgTD\n\tKLmT3ppuTqWv0plXBfWuqG98Tirx9X8cUIfXiWiD6Buy/UZX5tyL3P4v1zNkb8sT0wzn\n\tfpsy4O8TcF2Z3HMgTESlE51AZyl4dZVGzWXowmnWpIn1e52Z8RjJkjXiSijxRtxEp+ht\n\tenbQ==","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=+Vsg99fMsG3XrMOEAGk/1RLWqf5i0o2S9GHs39YrllE=;\n\tb=TCs+a5irRv30I4HLVCEKS//9gxeTI+d5j5MWG7VQZ67GJyUAKezr60OmNinClX1sjr\n\taUa+NvxPfwN8jtGxG4DlWns8wiiNcI86DAz25qj5XzTEo4t3O9kCfkT+1FUlaIKLRvGC\n\tRGZCGWVs7MJmXjoOsg/0nxe2n6zYyrFCT3cIOuCnVRoPMNBN/Upnrzg536CwahkSLaLe\n\t3QJS05SZBjglNZSomVlKDkxc41SZ6CL/QGJQ+qc3m8NH+o19PAxO+/95OMnwC2LymJ1j\n\toBmDd0KhNL6ec3DHSHvB3uNC4FmvUenecAVWZyYUtMFXcB35Q+nmedPymayS3kaFaL3y\n\tPPrg==","X-Gm-Message-State":"AOAM532urXDoWnCWwERpjocuum83QZ7QvomNeXIsi97p3nCFfWoyvU2c\n\tooazs8eP8Vrqlzv3MWxhakCBxkEhBEg=","X-Google-Smtp-Source":"ABdhPJx9xu7GRWFAslhFlGqu/lh7RtMh4tFUc0KBS69gBUFo2BPYkz/mRFPunPG3UYwKSsCYgqPM8w==","X-Received":"by 2002:ac2:44cd:: with SMTP id d13mr7130852lfm.13.1593367900000;\n\tSun, 28 Jun 2020 11:11:40 -0700 (PDT)","Date":"Sun, 28 Jun 2020 20:11:39 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200628181139.GL1105424@oden.dyn.berto.se>","References":"<20200628155539.29498-1-jacopo@jmondi.org>\n\t<20200628155539.29498-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200628155539.29498-3-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: ipu3: Accept an empty\n\troles list","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>"}},{"id":10943,"web_url":"https://patchwork.libcamera.org/comment/10943/","msgid":"<20200628204158.GX6954@pendragon.ideasonboard.com>","date":"2020-06-28T20:41:58","subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: ipu3: Accept an empty\n\troles list","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 Sun, Jun 28, 2020 at 05:55:38PM +0200, Jacopo Mondi wrote:\n> The IPU3 pipeline handler that does not support receiving an empty list\n> of roles at generateConfiguration() time. This contradicts the camera\n> API which allows application to generate empty CameraConfiguration to\n> be later manually filled.\n> \n> Fix this by returning an empty CameraConfiguration if the list of\n> requested roles is empty. While at it, align the style with the other\n> pipeline handlers.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index ef57196c32da..cbf19793c43e 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -292,14 +292,15 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,\n>  \tconst StreamRoles &roles)\n>  {\n>  \tIPU3CameraData *data = cameraData(camera);\n> -\tIPU3CameraConfiguration *config;\n> +\tIPU3CameraConfiguration *config = new IPU3CameraConfiguration(camera, data);\n\nI wouldn't have changed this, up to you.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \tstd::set<Stream *> streams = {\n>  \t\t&data->outStream_,\n>  \t\t&data->vfStream_,\n>  \t\t&data->rawStream_,\n>  \t};\n>  \n> -\tconfig = new IPU3CameraConfiguration(camera, data);\n> +\tif (roles.empty())\n> +\t\treturn config;\n>  \n>  \tfor (const StreamRole role : roles) {\n>  \t\tStreamConfiguration cfg = {};","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 7DFEEC2E69\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Jun 2020 20:42:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 50082609D6;\n\tSun, 28 Jun 2020 22:42:03 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45A76609A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Jun 2020 22:42:02 +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 D568A4FB;\n\tSun, 28 Jun 2020 22:42:01 +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=\"df6U7ilJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593376922;\n\tbh=+Mbaf11MfIqSMutOcdwziEMadImfFkoiWNMuU8OLFCA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=df6U7ilJXRj9eCXKXczswQDWeJJOF8j2p8g8Jdmbe47ohkvucSz6fPpNdN4sPVpOP\n\tTcevDFO9EbCWdCnN5Gqa1MXSwvX/8cZeiaOHjpJcz41BaXjekS+5cGPOXdc5wJG6YA\n\tdTDMacFSOFaTSYmVr6PLT5uX2/xG5FwfUel+bYgM=","Date":"Sun, 28 Jun 2020 23:41:58 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200628204158.GX6954@pendragon.ideasonboard.com>","References":"<20200628155539.29498-1-jacopo@jmondi.org>\n\t<20200628155539.29498-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200628155539.29498-3-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: ipu3: Accept an empty\n\troles list","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>"}}]