{"id":8650,"url":"https://patchwork.libcamera.org/api/1.1/patches/8650/?format=json","web_url":"https://patchwork.libcamera.org/patch/8650/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200706135254.1631048-1-naush@raspberrypi.com>","date":"2020-07-06T13:52:54","name":"[libcamera-devel] libcamera: pipeline: raspberrypi: Fix initial value for scoring routine","commit_ref":"d76acac30dc714e63057ee0cc424b12624994072","pull_url":null,"state":"accepted","archived":false,"hash":"2930d6ac9d68355f848b913b6a70556b984043ba","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8650/mbox/","series":[{"id":1087,"url":"https://patchwork.libcamera.org/api/1.1/series/1087/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1087","date":"2020-07-06T13:52:54","name":"[libcamera-devel] libcamera: pipeline: raspberrypi: Fix initial value for scoring routine","version":1,"mbox":"https://patchwork.libcamera.org/series/1087/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8650/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8650/checks/","tags":{},"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 C9C2BBD790\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jul 2020 13:53:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5F5E5603AB;\n\tMon,  6 Jul 2020 15:53:06 +0200 (CEST)","from mail-wr1-x443.google.com (mail-wr1-x443.google.com\n\t[IPv6:2a00:1450:4864:20::443])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4F676603AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jul 2020 15:53:04 +0200 (CEST)","by mail-wr1-x443.google.com with SMTP id z13so41035409wrw.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Jul 2020 06:53:04 -0700 (PDT)","from naushir-VirtualBox.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tf17sm4028203wme.14.2020.07.06.06.53.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 06 Jul 2020 06:53:02 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"P2ajUvDj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=zhSxyFS/XevjFqiBYxJve17zgp1EKjQNWhDw4uwoHJ0=;\n\tb=P2ajUvDj4slB9hRBGMboFI1O77Q06LQ8D5GUyO6DTOuEKU3XmYg27qeELM+FI7fuTI\n\tUIfHyctaPTR5ilIf2iFrpPBV9XQmP5ow0H28Jkr6RKos1yKcA14HOM9hFh0il1THBoqT\n\tc71k3kafuJahv+aiXOklr8IQeWDcvx4ncwh9qPcmwPsBeqfub3F+nUMlXqacD+Wll87E\n\tFTk+CmjTe7kGeEFn/SnUsO7wJZgKpuIvumL2iz44f4zZQaoNcOc4xplMDfjY57k3bYdb\n\tNIyhe8rw1v1eglge7IHAvu9dMILp+lxw4n+21M5ErZWHEpBW+GIJ0QENJIO9m9Ghp4+7\n\tbqOg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=zhSxyFS/XevjFqiBYxJve17zgp1EKjQNWhDw4uwoHJ0=;\n\tb=BlkNLAyQ2QSAGrTEfHqphInoPFOghBwjYkeHbXbIJo9wbpdfc+ete5gR0QL7p3AKcy\n\tWQkGH1K03QpaGCwqnGQyvFRo1y4NrksAnI5GKBBXHNeF5xiXbcAojAQN68DzdYFKxnS+\n\tQkRYNbfq+EH6OjvPzZjaLR4RgEhsND1sJJJjHQnGnFVsBz5UqsGpo9f0/wpBHWvQ0Zau\n\tf99HyLUITYqKdV30LgrCoZhOG5rqG0OY98BB/ydiwlpsP6lO35ZTGC0Ycy6Ts+lHxomW\n\tPwBR5dUnTY9FrVW5jq2WOzkJ43WtMrrhmF5WFm6f33JEHn0qMsgmYYroVDQbgxm5KbsE\n\tpq0g==","X-Gm-Message-State":"AOAM532ORkAAvrPk+9gDchRjTi/OGJ/OANA9Iak475Qmgoi9xlzYRLcE\n\to5Jj/LiZZoHrh2cAgSCwjXxdBYvM+rw=","X-Google-Smtp-Source":"ABdhPJxCWZFSjqRn9251+yDrRWtxHGbrn3l1PBZ4Iu13NybPXpH8V0B4cuOiwujAxDjx3+zK21qduA==","X-Received":"by 2002:a5d:684f:: with SMTP id\n\to15mr44989938wrw.148.1594043583707; \n\tMon, 06 Jul 2020 06:53:03 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  6 Jul 2020 14:52:54 +0100","Message-Id":"<20200706135254.1631048-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Subject":"[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>","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>"},"content":"Use std::numerical_limits to initialise the best score instead of an\narbitrary value. This fixes a failure in v4l2-conformance when using\nthe Raspberry Pi pipeline handler and v4l2-compatibility libcamera\nlayer.\n\nReported-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 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","prefixes":["libcamera-devel"]}