[{"id":20400,"web_url":"https://patchwork.libcamera.org/comment/20400/","msgid":"<CAHW6GYL+0J+bTk7QW4GX8qGxPE6E9UuZ0noVv--0swvXi0hpBg@mail.gmail.com>","date":"2021-10-22T15:24:13","subject":"Re: [libcamera-devel] [PATCH v2 4/6] pipeline: raspberrypi: Remove\n\t\"unpacked\" format penalty in mode selection","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch.\n\nOn Fri, 22 Oct 2021 at 15:40, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> With the recent change to switch to programming the sensor device directly,\n> the notion of packed vs unpacked modes are not relevent, since that is a\n> Unicam format construct. Remove any scoring based on packed/unpacked modes.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ----\n>  1 file changed, 4 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 45725527d66e..2b70b877e70a 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -109,7 +109,6 @@ V4L2SubdeviceFormat findBestMode(const SensorFormats &formatsMap, const Size &re\n>  #define PENALTY_8BIT           2000.0\n>  #define PENALTY_10BIT          1000.0\n>  #define PENALTY_12BIT             0.0\n> -#define PENALTY_UNPACKED        500.0\n>\n>         /* Calculate the closest/best mode from the user requested size. */\n>         for (const auto &iter : formatsMap) {\n> @@ -127,9 +126,6 @@ V4L2SubdeviceFormat findBestMode(const SensorFormats &formatsMap, const Size &re\n>                         score += PENALTY_AR * scoreFormat(reqAr, modeAr);\n>\n>                         /* Add any penalties... this is not an exact science! */\n> -                       if (!info.packed)\n> -                               score += PENALTY_UNPACKED;\n> -\n\nAgreed, good to see this go.\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nDavid\n\n>                         if (info.bitsPerPixel == 12)\n>                                 score += PENALTY_12BIT;\n>                         else if (info.bitsPerPixel == 10)\n> --\n> 2.25.1\n>","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 25751BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 22 Oct 2021 15:24:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B201B68F5B;\n\tFri, 22 Oct 2021 17:24:25 +0200 (CEST)","from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 39C9A6012A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Oct 2021 17:24:24 +0200 (CEST)","by mail-wr1-x433.google.com with SMTP id m22so4718897wrb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Oct 2021 08:24:24 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"U4L+jt8D\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=0j9zpIAhmiLNI0/wLxW5F6j14gYO1lVVqWVMzlPixug=;\n\tb=U4L+jt8DRJfTkLS5Ca5sPeauyMlHMo4Mgx6KSvqn4t079uOl/JJU3tkt0PbH5L03Sp\n\tACsUdwJDtb5tXlEjoYe4KzpNlqOfjEUsV87tZnhQxdvNggHNbQCnPaxyBA3oy6AXw0c8\n\tvS8wa76ntu0LEbM75MrJCIIeIBz5yX1OsdJF2ylrHyhGuKLd6OSrWqcPf/0mI0WJZQ3t\n\t2v/D0Tj1lr3zoKDKaQHv3E7LM9246S3cPmUenSeN138lOKtv4aizC3a5MktJbRQlJXm9\n\tZ4V+SxSLPM1COenpZZDp63AWG6TWpw5FkEdQNXUxbKZb0CxcBX6vCNIzzQ4wO2iJzN3f\n\tG2BQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=0j9zpIAhmiLNI0/wLxW5F6j14gYO1lVVqWVMzlPixug=;\n\tb=Zi8JjbiBd5QJdwxcq7ym8K5NoJ6ZRBLHWUh4cctWkqXjqL9q0BAFFnORdu4JDlH03b\n\tlchdlas9n46E78Trk/Wi0698ftXr6r2C4cSGdXBCWsqR2JbSvTIkIu36diY6PHqvVB60\n\tdD8OmSxHVD4MbywYTxIIa6qqF9CjUPpQm4ZpRmKwlZwWir9+ItHssy3hCv8fXBb4KWxf\n\tNqq4XKJapQCWSjP5NTiYy+GRvojQpQPPvNjIsnf6UXvAwJggwn70r35jQhgHRtDE3FA4\n\tjYSWR5A5epGdkYLw51COOxsE2zN4SVhQjlwIDWNaN3CgSQ2oc9iHU4d6MpKioXhO8UAk\n\tSuqg==","X-Gm-Message-State":"AOAM531KeVqvt1fqPHK2CG8xmSpf/1GXxDWE1IJFp6iBMtRu24AxTp94\n\tmka3eqiqCSsHEouhT32kVeuMT2hWed/j2bGwvUKoyI0ESIc=","X-Google-Smtp-Source":"ABdhPJzij6/f1ClLXb3XjfxKdpwMdsY84R50Z22Rcx/rLhAsqJwRjsAlUG5Kn4gV1YhZ4Y6wOGblBWACPo5PkgHpLGY=","X-Received":"by 2002:a05:6000:90:: with SMTP id\n\tm16mr657177wrx.354.1634916263914; \n\tFri, 22 Oct 2021 08:24:23 -0700 (PDT)","MIME-Version":"1.0","References":"<20211022143907.3089419-1-naush@raspberrypi.com>\n\t<20211022143907.3089419-5-naush@raspberrypi.com>","In-Reply-To":"<20211022143907.3089419-5-naush@raspberrypi.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Fri, 22 Oct 2021 16:24:13 +0100","Message-ID":"<CAHW6GYL+0J+bTk7QW4GX8qGxPE6E9UuZ0noVv--0swvXi0hpBg@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 4/6] pipeline: raspberrypi: Remove\n\t\"unpacked\" format penalty in mode selection","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20448,"web_url":"https://patchwork.libcamera.org/comment/20448/","msgid":"<YXbinli57v5sSEYK@pendragon.ideasonboard.com>","date":"2021-10-25T17:00:14","subject":"Re: [libcamera-devel] [PATCH v2 4/6] pipeline: raspberrypi: Remove\n\t\"unpacked\" format penalty in mode selection","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Fri, Oct 22, 2021 at 03:39:05PM +0100, Naushir Patuck wrote:\n> With the recent change to switch to programming the sensor device directly,\n> the notion of packed vs unpacked modes are not relevent, since that is a\n> Unicam format construct. Remove any scoring based on packed/unpacked modes.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ----\n>  1 file changed, 4 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 45725527d66e..2b70b877e70a 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -109,7 +109,6 @@ V4L2SubdeviceFormat findBestMode(const SensorFormats &formatsMap, const Size &re\n>  #define PENALTY_8BIT\t\t2000.0\n>  #define PENALTY_10BIT\t\t1000.0\n>  #define PENALTY_12BIT\t\t   0.0\n> -#define PENALTY_UNPACKED\t 500.0\n>  \n>  \t/* Calculate the closest/best mode from the user requested size. */\n>  \tfor (const auto &iter : formatsMap) {\n> @@ -127,9 +126,6 @@ V4L2SubdeviceFormat findBestMode(const SensorFormats &formatsMap, const Size &re\n>  \t\t\tscore += PENALTY_AR * scoreFormat(reqAr, modeAr);\n>  \n>  \t\t\t/* Add any penalties... this is not an exact science! */\n> -\t\t\tif (!info.packed)\n> -\t\t\t\tscore += PENALTY_UNPACKED;\n> -\n\nI'm all for exact science when possible :-)\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t\t\tif (info.bitsPerPixel == 12)\n>  \t\t\t\tscore += PENALTY_12BIT;\n>  \t\t\telse if (info.bitsPerPixel == 10)","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 2F522BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Oct 2021 17:00:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E17A764875;\n\tMon, 25 Oct 2021 19:00:37 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C20E60125\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Oct 2021 19:00:36 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 201CEE0A;\n\tMon, 25 Oct 2021 19:00:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LwmuD3Tf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635181236;\n\tbh=08dHEy/ABpdzl737W6Mi4vzQX0gxKF3s0FcAwOX3tHc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LwmuD3TfXIcmvY/usrypYnvfho1j/dG/wFoGxJW7te0wEV6xsgMrhPLfWBD6HJ+H9\n\tYxz0sbfDkNW87Z6A01kbPKlCmn20959cg+7R3Ee9KLLE+OeKe58xEmK5knODzRFp4d\n\tZQtfaxN5WS0TJNt5ZPKXKbI28mJM8FHYqgrN46RM=","Date":"Mon, 25 Oct 2021 20:00:14 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YXbinli57v5sSEYK@pendragon.ideasonboard.com>","References":"<20211022143907.3089419-1-naush@raspberrypi.com>\n\t<20211022143907.3089419-5-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211022143907.3089419-5-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v2 4/6] pipeline: raspberrypi: Remove\n\t\"unpacked\" format penalty in mode selection","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]