[{"id":11233,"web_url":"https://patchwork.libcamera.org/comment/11233/","msgid":"<20200707123004.GA36578@pyrite.rasen.tech>","date":"2020-07-07T12:30:04","subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: raspberrypi: Fix\n\tinitial value for scoring routine","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Mon, Jul 06, 2020 at 02:52:54PM +0100, Naushir Patuck wrote:\n> Use std::numerical_limits to initialise the best score instead of an\n> arbitrary value. This fixes a failure in v4l2-conformance when using\n> the Raspberry Pi pipeline handler and v4l2-compatibility libcamera\n> layer.\n> \n> Reported-by: Paul Elder <paul.elder@ideasonboard.com>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index f4966f86..bd2ed671 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -69,7 +69,7 @@ double scoreFormat(double desired, double actual)\n>  \n>  V4L2DeviceFormat findBestMode(V4L2PixFmtMap &formatsMap, const Size &req)\n>  {\n> -\tdouble bestScore = 9e9, score;\n> +\tdouble bestScore = std::numeric_limits<double>::max(), score;\n>  \tV4L2DeviceFormat bestMode = {};\n>  \n>  #define PENALTY_AR\t\t1500.0\n\nThis doesn't quite fix the issue I was having (I'll follow you up on\nthat), but I think this fix is still necessary.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>","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 E91BABD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Jul 2020 12:30:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7BE3360F52;\n\tTue,  7 Jul 2020 14:30:13 +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 0610E603AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jul 2020 14:30:12 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 582C62C9;\n\tTue,  7 Jul 2020 14:30:10 +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=\"k6rtcPpu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594125011;\n\tbh=XVxwkiZRTxBZnLA00zR70Hf7WGfjfOT4xrcd3R1sNn0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=k6rtcPpu0SVPE+TUK4DwDnOOiLOiejGUX5wAYLFPeGsImUms0RKm5LHgazdVyLnvz\n\t8ASClLk4If9DZKD6xAR7dk2esTG9Z2ncgDKkduvVfE2gNU9N/qOtWCidbx9J02JDot\n\tkpgaDz6NouwdtsRiWYYZL3Jrn8fr2mgVj/DjPuXc=","Date":"Tue, 7 Jul 2020 21:30:04 +0900","From":"paul.elder@ideasonboard.com","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20200707123004.GA36578@pyrite.rasen.tech>","References":"<20200706135254.1631048-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200706135254.1631048-1-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: raspberrypi: Fix\n\tinitial value for scoring routine","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>"}}]