[{"id":5232,"web_url":"https://patchwork.libcamera.org/comment/5232/","msgid":"<20200617011039.GT913@pendragon.ideasonboard.com>","date":"2020-06-17T01:10:39","subject":"Re: [libcamera-devel] [PATCH 08/15] v4l2: v4l2_camera: Re-validate\n\tconfiguration after adjusted","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Tue, Jun 16, 2020 at 10:12:37PM +0900, Paul Elder wrote:\n> If the camera configuration has been adjusted, validate it again to\n> ensure that it's valid, before configuring the camera with it.\n\nThis shouldn't be needed, an adjusted configuration is supposed to be\nvalid. If that's not the case, it's a bug in the pipeline handler (in\nwhich case a unit test should be added to catch this, in addition to\nfixing the bug).\n\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  src/v4l2/v4l2_camera.cpp | 13 ++++++++++---\n>  1 file changed, 10 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp\n> index 2557320..fdbf461 100644\n> --- a/src/v4l2/v4l2_camera.cpp\n> +++ b/src/v4l2/v4l2_camera.cpp\n> @@ -119,11 +119,18 @@ int V4L2Camera::configure(StreamConfiguration *streamConfigOut,\n>  \t\tLOG(V4L2Compat, Debug) << \"Configuration invalid\";\n>  \t\treturn -EINVAL;\n>  \t}\n> -\tif (validation == CameraConfiguration::Adjusted)\n> +\tif (validation == CameraConfiguration::Adjusted) {\n>  \t\tLOG(V4L2Compat, Debug) << \"Configuration adjusted\";\n> +\t\tvalidation = config_->validate();\n> +\t\tif (validation != CameraConfiguration::Valid) {\n> +\t\t\tLOG(V4L2Compat, Error)\n> +\t\t\t\t<< \"Configuration adjusted but not valid\";\n> +\t\t\treturn -EINVAL;\n> +\t\t}\n> +\t}\n>  \n> -\tLOG(V4L2Compat, Debug) << \"Validated configuration is: \"\n> -\t\t\t      << streamConfig.toString();\n> +\tLOG(V4L2Compat, Debug)\n> +\t\t<< \"Validated configuration is: \" << streamConfig.toString();\n>  \n>  \tint ret = camera_->configure(config_.get());\n>  \tif (ret < 0)","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C11E9603D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Jun 2020 03:11: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 59C87F9;\n\tWed, 17 Jun 2020 03:11:02 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LKOqU1eq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592356262;\n\tbh=Hfd+87C4p5WBNfBMScyxis4Mfo7O2RB9grzAobx4qo0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LKOqU1eq4qspyxl7AF02cQPLhuXy6mMSdAu/CUm9YFt2EM/Rdirb327/o+m3H8pyq\n\tbdIPEti/fQyoZxI8krPJaiNjaHU9Imsg9MApojUpcrgl/PAUwU5Fg19UWdbWDxNe2p\n\tD6Xpe6pQ27D+FT3967pyWrDbxQA3TPm/dsWT8F3s=","Date":"Wed, 17 Jun 2020 04:10:39 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200617011039.GT913@pendragon.ideasonboard.com>","References":"<20200616131244.70308-1-paul.elder@ideasonboard.com>\n\t<20200616131244.70308-9-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200616131244.70308-9-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 08/15] v4l2: v4l2_camera: Re-validate\n\tconfiguration after adjusted","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>","X-List-Received-Date":"Wed, 17 Jun 2020 01:11:03 -0000"}}]