[{"id":10933,"web_url":"https://patchwork.libcamera.org/comment/10933/","msgid":"<20200628140127.GH1105424@oden.dyn.berto.se>","date":"2020-06-28T14:01:27","subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: simple: Setup\n\tlinks outside for format try loop","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 work.\n\nOn 2020-06-28 12:52:04 +0300, Laurent Pinchart wrote:\n> The SimpleCameraData::init() function needs to setup links along the\n> pipeline, but doesn't need to repeat that operation for each media bus\n> code it tries. Move the link setup before the loop.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 16 ++++++++--------\n>  1 file changed, 8 insertions(+), 8 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 1ec8d0f7de03..9274e61462fc 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -250,6 +250,14 @@ int SimpleCameraData::init()\n>  \tSimpleConverter *converter = pipe->converter();\n>  \tint ret;\n>  \n> +\t/*\n> +\t * Setup links first as some subdev drivers take active links into\n> +\t * account to propagate TRY formats. Such is life :-(\n> +\t */\n> +\tret = setupLinks();\n> +\tif (ret < 0)\n> +\t\treturn ret;\n> +\n>  \t/*\n>  \t * Enumerate the possible pipeline configurations. For each media bus\n>  \t * format supported by the sensor, propagate the formats through the\n> @@ -259,14 +267,6 @@ int SimpleCameraData::init()\n>  \tfor (unsigned int code : sensor_->mbusCodes()) {\n>  \t\tV4L2SubdeviceFormat format{ code, sensor_->resolution() };\n>  \n> -\t\t/*\n> -\t\t * Setup links first as some subdev drivers take active links\n> -\t\t * into account to propagate TRY formats. Such is life :-(\n> -\t\t */\n> -\t\tret = setupLinks();\n> -\t\tif (ret < 0)\n> -\t\t\treturn ret;\n> -\n>  \t\tret = setupFormats(&format, V4L2Subdevice::TryFormat);\n>  \t\tif (ret < 0) {\n>  \t\t\tLOG(SimplePipeline, Error)\n> -- \n> Regards,\n> \n> Laurent Pinchart\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 586C9C2E66\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Jun 2020 14:01:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A9FCD609DB;\n\tSun, 28 Jun 2020 16:01:31 +0200 (CEST)","from mail-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A3B70603B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Jun 2020 16:01:29 +0200 (CEST)","by mail-lj1-x242.google.com with SMTP id 9so15215675ljc.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Jun 2020 07:01:29 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tk3sm511380ljk.107.2020.06.28.07.01.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 28 Jun 2020 07:01:28 -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=\"EB8O5smC\"; 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=ccc5kg4mVftqXKelG7dNxn2kGtyeWnplQRJW5HAKw7c=;\n\tb=EB8O5smCoipqXtTOJIHXl1FaPsOuFwcOvmoopC03UJlGbGG98YwvSsI+Ur9R0uQBTl\n\tR3hnTuSYEcIGQl2H3Sa71RPz0C+7i+fO5alvoCabBegAxe6aZaSUfOkzazSbMOFzex4A\n\tP5nJ4Rx2jbkt1UdM4kauFNoGtVbY9kF8zYWnv4c3HJnzjjHhzyg2/V5Z+BcKpEUC6Ahs\n\tXTa2wXUzFojtlx9uucE6+NFxBMKKZorOrnCBqBzHCc3SlRgVqz9eayB8nBol3yTBXvcb\n\tRLTNUYHN9ut+cpVxOjldnAInHypqo4hzzEZ1gjwgPFzXoHV5LNW0KEQ+iOcmxcUN6j+m\n\tTwEg==","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=ccc5kg4mVftqXKelG7dNxn2kGtyeWnplQRJW5HAKw7c=;\n\tb=pODgxNFL1/K3YlIehzReOjx51LwB+bQcUDC6aUk9QN1XVbBQq8e8CR7cqgKRHmKjNo\n\t/a1+j2+6zN3eZlHl1w1+z4Q/eP51zbjkKM4Czt+T9cPblaB+1foY44BfbaW3CYwNj+Ub\n\tFdzdGSgSvCIHA83GcRm1NCklAYZZqQYihx6VctWtCDHGlgRRQy4gxwlYOF/Xc9rN8xzZ\n\tkhj/4lZ5T04pNtEk+PzrOMedLSxx5aHqhDRNKZz40tRMywl5ZriOErmaKnBZhDAaB+0X\n\tjPVhMvdxFtHJ/8m9UvfaSCIOJAnhUWDbqv/kGv6o7BtIc6GXwY5m6u/+AY5S5RjzqZAd\n\tTR6A==","X-Gm-Message-State":"AOAM530fac1Kx0B3JPS53ZiuR4mrykVr72Uh3gIYYUwce3ikiP9isAYm\n\tXfT5Y5ksFhMhyUV6FKEPRfm0w+05KaI=","X-Google-Smtp-Source":"ABdhPJxsege6PWMC6EBqo9JQ6a6ynlJ9LXWmJ0Ijb8PU+gbTBRUInWlyKHUjKDWoe0TgaITuQe8hmQ==","X-Received":"by 2002:a05:651c:50d:: with SMTP id\n\to13mr6388771ljp.181.1593352889039; \n\tSun, 28 Jun 2020 07:01:29 -0700 (PDT)","Date":"Sun, 28 Jun 2020 16:01:27 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20200628140127.GH1105424@oden.dyn.berto.se>","References":"<20200628095204.23527-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200628095204.23527-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: simple: Setup\n\tlinks outside for format try loop","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>"}}]