From patchwork Thu Aug 4 12:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 16963 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 645FEBE173 for ; Thu, 4 Aug 2022 12:06:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 21A786332B; Thu, 4 Aug 2022 14:06:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1659614800; bh=cxwM1xp7J6XkLmHqw8EzzDZw1ee6gJ6jX7KrtbyqAKE=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=eo7R8hyMZsVIw43qFQePAsUf3x4dgb64PvXPKpZxDOg/RMEYbSHb1QIkQi7uM+Hga 72Jf3kOaNPsTJb7Ki8Jdwp1BE+KrvkA9f5uR4IlA9HAW/Cf2cKdB9wXjxc8mD0205N Xt6cUvPIpmpfG098TvNfRSuRjhL1PDXRdt5ukUNt1JnJofb/fy53DgU2FSdPgI3Oyu 3Yf54NIBKk2LyPMACRUIyIZ0cq5Rv6pZ22rr+HPysmekZJZ80akWkHa0CuXjDGuZXE SJ1PeRsXJYXi9gx+SdgJ2c3r3fNNStyYJ1jAGnQmiIxoZU2Z+e7UyAZKsmPBrqDSg6 wZQRVMQHqOSJQ== Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DCC166330D for ; Thu, 4 Aug 2022 14:06:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="n9reOqsB"; dkim-atps=neutral Received: by mail-pj1-x1029.google.com with SMTP id b4so9160700pji.4 for ; Thu, 04 Aug 2022 05:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TmJhxcVY/2qAKEaQY8HilcwdC03GALuvoAMB0UjlrgE=; b=n9reOqsBOwfAZOGdSvZvSUO7u4Xy3E0aad4xAwnYsUYDC2SoxKm/a1/04p/N0DOVJX D1IkgvJVRXrOW0/RGPRp8BX4A65RssCUh5MR+ZaSqWNlS2IHRtvLAv2bWai6ZyI3wJut 5ZSwxJqtFXTCfI/1lDyZg4lXMRmZw124tWlwE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TmJhxcVY/2qAKEaQY8HilcwdC03GALuvoAMB0UjlrgE=; b=pTS40gsMZAZ2w7/Rg17CNewgABgik2JX08NIfVc5vQa8qHZTUyehD86R6+6EXUOblV sORbpzVvZA4ce2/2ZETTj1lAc/Fxr2iGo++Pa/4OfpuFRqibJzobhDgOxAZ8QMTdrMCP 5NQUjQR2q8cYVuHtWE6okwMUkbngAdXZd+Sc0wlXtZ1kRFYocumFG0G7nFiinNAQjhOA zZmZ1dIqJfJz/MGRbmi6HWV5nVb+pnsvXOYZZEb+YBvBrkfC/S0SgizQocJ9IXMbCNB0 df63HFq23kwvecxXmPgOAr2R9RcUEkmp31S5FDb/syiZ5NwaaOvDuOs0zVhSqPws5BLx JE+A== X-Gm-Message-State: ACgBeo0FMa3XvzmQ+eLi8tFD0q2dcJwc3AF3HEDHo7VNiMI2au0bGUGi vnOie0Zb1vJ/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 m16-20020a170902f65000b0016d473b903bmr1545527plg.174.1659614797258; Thu, 04 Aug 2022 05:06:37 -0700 (PDT) Received: from localhost ([2401:fa00:1:17:5805:eb56:771a:6807]) by smtp.gmail.com with UTF8SMTPSA id z5-20020a170903018500b0016d987d7f76sm892013plg.11.2022.08.04.05.06.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 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 Subject: [libcamera-devel] [PATCH] libcamera: ipu3: Use std::max() instead of expandTo() to get the max resolution X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Han-Lin Chen via libcamera-devel From: Hanlin Chen Reply-To: Han-Lin Chen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Using Size::expandTo() to find the max resolution might generate a non-existent resolution. For example, when application request streams for 1920x1080 and 1600x1200, the max resolution will be wrongly 1920x1200 and fails the configuration. Bug: https://bugs.libcamera.org/show_bug.cgi?id=139 Signed-off-by: Han-Lin Chen --- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 75231156..335b6c94 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -254,7 +254,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate() rawSize.expandTo(cfg.size); } else { yuvCount++; - maxYuvSize.expandTo(cfg.size); + maxYuvSize = std::max(maxYuvSize, cfg.size); } }