From patchwork Mon Mar 27 09:34:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18468 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 A1A26C326C for ; Mon, 27 Mar 2023 09:34:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 47E356271E; Mon, 27 Mar 2023 11:34:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679909690; bh=XSUIUUNxfOpTmzrNOaJlxZ9ZFDh4NyWbb8aWkoecDO0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qfIaw05zYK0tA0LOlWkfkN6VsQq1XWVwXIyKo6Wgy0B/jdVo1PGYLr3aDvedTlXO5 baYVdyKgLlKjQz0/GSMWY3C/siE1Zg+wmkOo8ymu7e/N0R4iBvDJ91ShovXpjSLgzZ 02p0mfg+4MxgTUJvx1IC9OoSi6/KyWE9oIcgm97pDXJjPoBwuvz3+BjZfohxtSVa6N PvDVH8kEzyaMpGQW1Vyp96VIZNBf6DHjHo0fgujCOy7XhNQ8g8KfJ0cxFlDrKAn2TZ nXf0bQur3jXh4IurbbCRf1vGt3OugeXg1konkjftAlwhZju1VQlZqBGC7Z5+DF0ISX qcuYiTC8R3qhA== Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5548A62724 for ; Mon, 27 Mar 2023 11:34:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="CUn+q5aQ"; dkim-atps=neutral Received: by mail-io1-xd2e.google.com with SMTP id p17so3601603ioj.10 for ; Mon, 27 Mar 2023 02:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1679909685; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p0hVtHHnzZKHAsyUKyPksKTBylxtTOrJ1jmAU6zbBEE=; b=CUn+q5aQCWiaM2LvBo4a5CHoUrX3FTUbxqilQ1Zt4t5/8/mm8PWkCxOzpgU6nKiJZ+ QVOuAzaMVETQSAdRxVehb4RtZwV+DBNPB85NqePt16yMIYSDt5Esp6eMqmd3pZPKuDub WoGJEjnILEoUSCdgeG5N5ONl16HEKhOplpYWBb/LfguY0i0b9cKV5LexkZ5pBBrHOQbr 2rblJtvnNbNElptS4dKPhu/SNruYb7E/uBid12lw2A5hl2IfdsWpQnXz6E7a9ZCDymr2 ki0/s6+HVBe/CP3sLWKieserF4zZfeNzTONmFQtI0DQn74gFYD0LdF0AJO2BNSTnIc68 zRHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679909685; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p0hVtHHnzZKHAsyUKyPksKTBylxtTOrJ1jmAU6zbBEE=; b=uclv+rquOUsvvZwZ044aPV4aqKtA/MYPwZgcGMZ8J04dMuFWAToHepMu8/g2A1bQCt rLvY8e+AWzTOHU3P7gaTQaOC2rGe9T3amtCnmJX8I/IBWDH2JEa+KcqHpzp327DY58mK gTd2Nt70yRfG3A4hivw4U5iyJmXt4XsOOdg6JKPM0V1oz2pEhfyKzAwr+Sg9IAIjTaAP rbZnKK9ZLOqE1xbKUW7aOec2PR1wtH3/VC1lSjJDPQRtSeeNkBdP3pklKtu6AMj4vd/P X51ORoyVh5TAn9/rebOU4WniWGywbwI8e/Lj8Oo+hg7CJ/bG5tvjd4SVGGr0xsrs6Jg8 3zxA== X-Gm-Message-State: AO0yUKXVuNu+VS8U7o4ZiXRT3WoSR0aZTZYHkU9q0v88AjnYQgcETDlI DXHG8Mn2DMsAdvEG1LYz50eyLYUnlpPM7Ie81ZVF9g== X-Google-Smtp-Source: AK7set8CimX3INzdlWFcB7p0VJRWZM5wTJ989l/nlPYYCM07nA85xUdyqyx05MJeCUnOr0ha0Hkd/A== X-Received: by 2002:a5e:8c05:0:b0:759:6a8e:96e5 with SMTP id n5-20020a5e8c05000000b007596a8e96e5mr7057239ioj.17.1679909684982; Mon, 27 Mar 2023 02:34:44 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id d12-20020a056602328c00b0075464a69c10sm7658345ioz.10.2023.03.27.02.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 02:34:44 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 27 Mar 2023 10:34:39 +0100 Message-Id: <20230327093439.24670-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230327093439.24670-1-naush@raspberrypi.com> References: <20230327093439.24670-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/4] ipa: raspberrypi: Fix default frame durations calculation 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Fix a bug in the default frame durations calculation where the min/max values are swapped round. This is a rarely travelled code path, so has not actually caused a reported failure. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- src/ipa/raspberrypi/raspberrypi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index c10e57e07ab0..66a020d022cd 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -1486,8 +1486,8 @@ void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDur * This will only be applied once AGC recalculations occur. * The values may be clamped based on the sensor mode capabilities as well. */ - minFrameDuration_ = minFrameDuration ? minFrameDuration : defaultMaxFrameDuration; - maxFrameDuration_ = maxFrameDuration ? maxFrameDuration : defaultMinFrameDuration; + minFrameDuration_ = minFrameDuration ? minFrameDuration : defaultMinFrameDuration; + maxFrameDuration_ = maxFrameDuration ? maxFrameDuration : defaultMaxFrameDuration; minFrameDuration_ = std::clamp(minFrameDuration_, mode_.minFrameDuration, mode_.maxFrameDuration); maxFrameDuration_ = std::clamp(maxFrameDuration_,