From patchwork Mon Oct 10 13:45:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Olivier Gayot X-Patchwork-Id: 17570 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 6D472BD16B for ; Mon, 10 Oct 2022 13:50:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D955162D64; Mon, 10 Oct 2022 15:50:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665409834; bh=kZFXeAmmFzMVGQ0Crs45f/kFbhtW8GYYO3UpjtoXGHw=; h=To:Date:List-Id:List-Post:From:Cc:List-Subscribe:List-Unsubscribe: List-Archive:Reply-To:List-Help:Subject:From; b=E19JyBwpzYdUXi4QtC6H+wBdB0nJo9eydDc9MPleVOP6B6/3wRm79QZhlciw7WrPm Lep32ATyufB7KBxf+VJ4F+0cs7Cp20y2OCzHaCcEWh3K7QGtwphD4kxfvNBw9ULaAE l1cxXPqy15lqvAqGb3PnZMDxA9zuWX5bbyzR/hoLCWcgSxdHZPzxnlvcp/3huEgf0k eFqht1ZM/K7bG64J7wJGRFSCL7ayMBiMyvm7p9sTep3XG7v4wpl5SZ7bGDIZj8A4Q0 Mr+/v6GZr33I+hhL92mZZ1PlOro272sECMrjjkM0pJDOhKsXtHhqkfNgynijmN3rpw DpT8vdqwES8TA== To: libcamera-devel@lists.libcamera.org Date: Mon, 10 Oct 2022 15:45:08 +0200 X-Mailman-Approved-At: Mon, 10 Oct 2022 15:50:33 +0200 MIME-Version: 1.0 Message-ID: List-Id: List-Post: X-Patchwork-Original-From: Olivier Gayot via libcamera-devel From: Olivier Gayot Precedence: list Cc: Olivier Gayot , Olivier Gayot X-Mailman-Version: 2.1.29 X-BeenThere: libcamera-devel@lists.libcamera.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: olivier.gayot@canonical.com List-Help: Subject: [libcamera-devel] [PATCH] ipa: tweak constant expressions that fail to be determined on ppc64el Content-Disposition: inline Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Olivier Gayot On ppc64el, GCC fails to determine the result of some long double expressions at compile time. This makes libcamera fail to build with GCC on that architecture. e.g.: constexpr auto x = 1.0l/30.0; in ‘constexpr’ expansion of ‘std::chrono::operator/, double>(std::literals::chrono_literals::operator""s(1.0e+0l), 6.0e+1)’ /usr/include/c++/11/chrono:710:39: error: ‘(1.0e+0l / 6.0e+1)’ is not a constant expression 710 | return __cd(__cd(__d).count() / __s); Tweaking the expressions just a bit makes GCC happy and allows libcamera to build properly on ppc64el. Signed-off-by: Olivier Gayot --- 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 14b06a4f..3e4383f9 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -60,7 +60,7 @@ using utils::Duration; /* Configure the sensor with these values initially. */ constexpr double defaultAnalogueGain = 1.0; constexpr Duration defaultExposureTime = 20.0ms; -constexpr Duration defaultMinFrameDuration = 1.0s / 30.0; +constexpr Duration defaultMinFrameDuration = 1s / 30.0; constexpr Duration defaultMaxFrameDuration = 250.0s; /* @@ -69,7 +69,7 @@ constexpr Duration defaultMaxFrameDuration = 250.0s; * we rate-limit the controller Prepare() and Process() calls to lower than or * equal to this rate. */ -constexpr Duration controllerMinFrameDuration = 1.0s / 30.0; +constexpr Duration controllerMinFrameDuration = 1s / 30.0; /* List of controls handled by the Raspberry Pi IPA */ static const ControlInfoMap::Map ipaControls{