{"id":16963,"url":"https://patchwork.libcamera.org/api/patches/16963/?format=json","web_url":"https://patchwork.libcamera.org/patch/16963/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20220804120620.1696350-1-hanlinchen@chromium.org>","date":"2022-08-04T12:06:20","name":"[libcamera-devel] libcamera: ipu3: Use std::max() instead of expandTo() to get the max resolution","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"361ba515cd88a9128128850f98760c7e57f9e20e","submitter":{"id":98,"url":"https://patchwork.libcamera.org/api/people/98/?format=json","name":"Hanlin Chen","email":"hanlinchen@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16963/mbox/","series":[{"id":3372,"url":"https://patchwork.libcamera.org/api/series/3372/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3372","date":"2022-08-04T12:06:20","name":"[libcamera-devel] libcamera: ipu3: Use std::max() instead of expandTo() to get the max resolution","version":1,"mbox":"https://patchwork.libcamera.org/series/3372/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16963/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16963/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 645FEBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Aug 2022 12:06:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 21A786332B;\n\tThu,  4 Aug 2022 14:06:40 +0200 (CEST)","from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com\n\t[IPv6:2607:f8b0:4864:20::1029])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DCC166330D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Aug 2022 14:06:38 +0200 (CEST)","by mail-pj1-x1029.google.com with SMTP id b4so9160700pji.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Aug 2022 05:06:38 -0700 (PDT)","from localhost ([2401:fa00:1:17:5805:eb56:771a:6807])\n\tby smtp.gmail.com with UTF8SMTPSA id\n\tz5-20020a170903018500b0016d987d7f76sm892013plg.11.2022.08.04.05.06.36\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tThu, 04 Aug 2022 05:06:37 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659614800;\n\tbh=cxwM1xp7J6XkLmHqw8EzzDZw1ee6gJ6jX7KrtbyqAKE=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=eo7R8hyMZsVIw43qFQePAsUf3x4dgb64PvXPKpZxDOg/RMEYbSHb1QIkQi7uM+Hga\n\t72Jf3kOaNPsTJb7Ki8Jdwp1BE+KrvkA9f5uR4IlA9HAW/Cf2cKdB9wXjxc8mD0205N\n\tXt6cUvPIpmpfG098TvNfRSuRjhL1PDXRdt5ukUNt1JnJofb/fy53DgU2FSdPgI3Oyu\n\t3Yf54NIBKk2LyPMACRUIyIZ0cq5Rv6pZ22rr+HPysmekZJZ80akWkHa0CuXjDGuZXE\n\tSJ1PeRsXJYXi9gx+SdgJ2c3r3fNNStyYJ1jAGnQmiIxoZU2Z+e7UyAZKsmPBrqDSg6\n\twZQRVMQHqOSJQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=TmJhxcVY/2qAKEaQY8HilcwdC03GALuvoAMB0UjlrgE=;\n\tb=n9reOqsBOwfAZOGdSvZvSUO7u4Xy3E0aad4xAwnYsUYDC2SoxKm/a1/04p/N0DOVJX\n\tD1IkgvJVRXrOW0/RGPRp8BX4A65RssCUh5MR+ZaSqWNlS2IHRtvLAv2bWai6ZyI3wJut\n\t5ZSwxJqtFXTCfI/1lDyZg4lXMRmZw124tWlwE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"n9reOqsB\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=TmJhxcVY/2qAKEaQY8HilcwdC03GALuvoAMB0UjlrgE=;\n\tb=pTS40gsMZAZ2w7/Rg17CNewgABgik2JX08NIfVc5vQa8qHZTUyehD86R6+6EXUOblV\n\tsORbpzVvZA4ce2/2ZETTj1lAc/Fxr2iGo++Pa/4OfpuFRqibJzobhDgOxAZ8QMTdrMCP\n\t5NQUjQR2q8cYVuHtWE6okwMUkbngAdXZd+Sc0wlXtZ1kRFYocumFG0G7nFiinNAQjhOA\n\tzZmZ1dIqJfJz/MGRbmi6HWV5nVb+pnsvXOYZZEb+YBvBrkfC/S0SgizQocJ9IXMbCNB0\n\tdf63HFq23kwvecxXmPgOAr2R9RcUEkmp31S5FDb/syiZ5NwaaOvDuOs0zVhSqPws5BLx\n\tJE+A==","X-Gm-Message-State":"ACgBeo0FMa3XvzmQ+eLi8tFD0q2dcJwc3AF3HEDHo7VNiMI2au0bGUGi\n\tvnOie0Zb1vJ/kMw5eY+PiATN6qhpQypzMQ==","X-Google-Smtp-Source":"AA6agR4WqRcj19YV+hQ0IPipiaEavwlbOndpCsNGu58K6W3smbaRTxWaFBI/FXGY0zkHl+Jde+GPEQ==","X-Received":"by 2002:a17:902:f650:b0:16d:473b:903b with SMTP id\n\tm16-20020a170902f65000b0016d473b903bmr1545527plg.174.1659614797258; \n\tThu, 04 Aug 2022 05:06:37 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu,  4 Aug 2022 20:06:20 +0800","Message-Id":"<20220804120620.1696350-1-hanlinchen@chromium.org>","X-Mailer":"git-send-email 2.37.1.455.g008518b4e5-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] libcamera: ipu3: Use std::max() instead\n\tof expandTo() to get the max resolution","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>","From":"Han-Lin Chen via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Han-Lin Chen <hanlinchen@chromium.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Using Size::expandTo() to find the max resolution might generate a non-existent\nresolution. For example, when application request streams for 1920x1080 and\n1600x1200, the max resolution will be wrongly 1920x1200 and fails the\nconfiguration.\n\nBug: https://bugs.libcamera.org/show_bug.cgi?id=139\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 75231156..335b6c94 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -254,7 +254,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\t\trawSize.expandTo(cfg.size);\n \t\t} else {\n \t\t\tyuvCount++;\n-\t\t\tmaxYuvSize.expandTo(cfg.size);\n+\t\t\tmaxYuvSize = std::max(maxYuvSize, cfg.size);\n \t\t}\n \t}\n \n","prefixes":["libcamera-devel"]}