From patchwork Mon Jun 24 19:29:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20368 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 BB2B8BD87C for ; Mon, 24 Jun 2024 19:30:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7024A654AE; Mon, 24 Jun 2024 21:30:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Pf4HmrKv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B81E654A3 for ; Mon, 24 Jun 2024 21:30:05 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6368718D7; Mon, 24 Jun 2024 21:29:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257383; bh=dEZ9heUGMM/sZ3NvPDI18wKyL3LpZaNmSCroL7Im9f4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pf4HmrKvPQ1jEwOi89B18B3jzS5/nNjyqa85kD80S3yJ/I507711XJP+DGU0j26a9 mE/MciNcycu183NfGo0CyRL7Iwi8SNzuTJcvRan7vHikHlYcebup+CKOkUzSlro7VT 7DbsfiX/8RrcfAIooE4qTvk5Z9P2cC7tPW9QNi0Q= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 01/10] libcamera: base: log: Declare log categories when defining them Date: Mon, 24 Jun 2024 22:29:32 +0300 Message-ID: <20240624192941.22943-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" libcamera will enable -Wmissing-declarations to catch mismatches between function declarations and definitions. There is one offender in log.h: when a category is defined with LOG_DEFINE_CATEGORY(), it generates a function with no declaration. Fix it by declaring the function using LOG_DECLARE_CATEGORY() as the first step fo the category definition. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/base/log.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h index b5775e491fee..df27df034d79 100644 --- a/include/libcamera/base/log.h +++ b/include/libcamera/base/log.h @@ -48,6 +48,7 @@ private: extern const LogCategory &_LOG_CATEGORY(name)(); #define LOG_DEFINE_CATEGORY(name) \ +LOG_DECLARE_CATEGORY(name) \ const LogCategory &_LOG_CATEGORY(name)() \ { \ /* The instance will be deleted by the Logger destructor. */ \ From patchwork Mon Jun 24 19:29:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20369 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 38CE2BD87C for ; Mon, 24 Jun 2024 19:30:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DA489654AA; Mon, 24 Jun 2024 21:30:10 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="T8oNxdNH"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F21EA654A1 for ; Mon, 24 Jun 2024 21:30:06 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E3BD518ED; Mon, 24 Jun 2024 21:29:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257385; bh=j9RrLLxmhULYnH+F2cHOe2p0fXdHEv3+MjmL7WvbinU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T8oNxdNHffTZ1AlaHDob9ssJI86fC+ybr2n024vjhh6FqQl5cyltGpawJHzkDhZrV zymORmU5A+btLSndVq4YZKcEeG1DdhXTy7hdoI4RmqYCDdolrTAsknup47OdOMavDM dT76QZqM+to3pQhfTa3RqFmcoMbjPxGwY8TVuhWE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 02/10] ipa: ipa_interface: Declare ipaCreate() in libcamera namespace Date: Mon, 24 Jun 2024 22:29:33 +0300 Message-ID: <20240624192941.22943-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The ipaCreate() function is the entry point to IPA modules. It is declared in ipa_interface.h, and defined by each module. As the function is defined with extern "C" linkage, the namespace in which it is contained is not very relevant from a caller's point of view. For the IPA module implementer, however, defining the function in the libcamera namespace avoids adding an explicit libcamera:: prefix to the symbols used by the function. This is why all IPA modules define their ipaCreate() entry point in the libcamera namespace. The ipa_interface.h file, however, declares the function in the global namespace. This doesn't cause any issue at runtime, but will cause a missing declaration warning when we enable them. To prepare for that, move the function declaration to the libcamera namespace. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/ipa/ipa_interface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h index b93f1a15b2c9..53cf5377fcc6 100644 --- a/include/libcamera/ipa/ipa_interface.h +++ b/include/libcamera/ipa/ipa_interface.h @@ -33,8 +33,8 @@ public: virtual ~IPAInterface() = default; }; -} /* namespace libcamera */ - extern "C" { libcamera::IPAInterface *ipaCreate(); } + +} /* namespace libcamera */ From patchwork Mon Jun 24 19:29:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20370 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 CC6C4BD87C for ; Mon, 24 Jun 2024 19:30:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 62453654A3; Mon, 24 Jun 2024 21:30:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bblzG9Lm"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 49408654A4 for ; Mon, 24 Jun 2024 21:30:08 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B0661920; Mon, 24 Jun 2024 21:29:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257386; bh=Di1YBA3b4BJ7lfuLwErRfBSyJwCU/ZdoC6j1+QW/VYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bblzG9Lmc9S5x86I7BEicymegRissuVDfb3FAbtkx3EdhY6TNnByCFoqfAgTOz2fw cGUX+f3vcct1ufIdum8X9kOeLg5NWVmcTcl8+jUN2Xhi2cz8kPZkpbslJoAOdX/cqu 8sQo/rIhyNDfu3XtunrFfBZNb9zockGeIA/ieIKI= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 03/10] ipa: rpi: Define local functions in anonymous namespace Date: Mon, 24 Jun 2024 22:29:34 +0300 Message-ID: <20240624192941.22943-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Multiple local functions are defined in the global namespace without the static keyword. This compiles fine for now, but will cause a missing declaration warning when we enable them. To prepare for that, move the function declaration to an anonymous namespace. While at it, for consistency, include an existing static function in the namespace and drop the static keyword. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- src/ipa/rpi/controller/rpi/ccm.cpp | 6 +++++- src/ipa/rpi/controller/rpi/contrast.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ipa/rpi/controller/rpi/ccm.cpp b/src/ipa/rpi/controller/rpi/ccm.cpp index e673964c1856..aefa580c9a4b 100644 --- a/src/ipa/rpi/controller/rpi/ccm.cpp +++ b/src/ipa/rpi/controller/rpi/ccm.cpp @@ -113,8 +113,10 @@ void Ccm::initialise() { } +namespace { + template -static bool getLocked(Metadata *metadata, std::string const &tag, T &value) +bool getLocked(Metadata *metadata, std::string const &tag, T &value) { T *ptr = metadata->getLocked(tag); if (ptr == nullptr) @@ -149,6 +151,8 @@ Matrix applySaturation(Matrix const &ccm, double saturation) return Y2RGB * S * RGB2Y * ccm; } +} /* namespace */ + void Ccm::prepare(Metadata *imageMetadata) { bool awbOk = false, luxOk = false; diff --git a/src/ipa/rpi/controller/rpi/contrast.cpp b/src/ipa/rpi/controller/rpi/contrast.cpp index 9b37943ae9c9..fe866a544293 100644 --- a/src/ipa/rpi/controller/rpi/contrast.cpp +++ b/src/ipa/rpi/controller/rpi/contrast.cpp @@ -94,6 +94,8 @@ void Contrast::prepare(Metadata *imageMetadata) imageMetadata->set("contrast.status", status_); } +namespace { + ipa::Pwl computeStretchCurve(Histogram const &histogram, ContrastConfig const &config) { @@ -153,6 +155,8 @@ ipa::Pwl applyManualContrast(ipa::Pwl const &gammaCurve, double brightness, return newGammaCurve; } +} /* namespace */ + void Contrast::process(StatisticsPtr &stats, [[maybe_unused]] Metadata *imageMetadata) { From patchwork Mon Jun 24 19:29:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20371 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 262E4BD87C for ; Mon, 24 Jun 2024 19:30:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BA0D8654A3; Mon, 24 Jun 2024 21:30:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ehWqtyUI"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B7EC4654B1 for ; Mon, 24 Jun 2024 21:30:09 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8A6BE191B; Mon, 24 Jun 2024 21:29:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257387; bh=0l+odjtUOc5OsKWhoawlrDZnwD+4VcttMUEBoWWUYQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ehWqtyUIvt5Zv7TqDyRrLDGSAF8qQiRUD872I/HZIUeNNXcCHGcJi/o6L+qOkpPfF yMIRX9KrRgKAj1Il0GqBV2+/8vz+HEKvNDt31f3UK6Ykeju10BYuYWBfK/0UtwgdOj /a5rb+kcmMWj+nVnPCWEE0ZKYDSzlZ+adzPkgRlg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 04/10] py: libcamera: Move function declarations to common header Date: Mon, 24 Jun 2024 22:29:35 +0300 Message-ID: <20240624192941.22943-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The init_py_*() functions are called by the top-level entry point of the libcamera Python module to initialize different parts of the bindings. They are declared in py_main.cpp where they are called, and defined in separate compilation units. This results in functions being defined without a corresponding declaration, and will generate warnings when we enable -Wmissing-declarations. Fix this by moving the function declarations from py_main.c to py_main.h, and including py_main.h in the various compilation units that need it. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/py/libcamera/py_color_space.cpp | 2 ++ src/py/libcamera/py_controls_generated.cpp.in | 2 ++ src/py/libcamera/py_enums.cpp | 2 ++ src/py/libcamera/py_formats_generated.cpp.in | 2 ++ src/py/libcamera/py_geometry.cpp | 2 ++ src/py/libcamera/py_main.cpp | 8 -------- src/py/libcamera/py_main.h | 10 ++++++++++ src/py/libcamera/py_properties_generated.cpp.in | 2 ++ src/py/libcamera/py_transform.cpp | 2 ++ 9 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/py/libcamera/py_color_space.cpp b/src/py/libcamera/py_color_space.cpp index 5201121a79ca..fd5a5dabe597 100644 --- a/src/py/libcamera/py_color_space.cpp +++ b/src/py/libcamera/py_color_space.cpp @@ -12,6 +12,8 @@ #include #include +#include "py_main.h" + namespace py = pybind11; using namespace libcamera; diff --git a/src/py/libcamera/py_controls_generated.cpp.in b/src/py/libcamera/py_controls_generated.cpp.in index 8d282ce51856..26d5a104f209 100644 --- a/src/py/libcamera/py_controls_generated.cpp.in +++ b/src/py/libcamera/py_controls_generated.cpp.in @@ -11,6 +11,8 @@ #include +#include "py_main.h" + namespace py = pybind11; class PyControls diff --git a/src/py/libcamera/py_enums.cpp b/src/py/libcamera/py_enums.cpp index e25689c674ef..ca6aeb868cbe 100644 --- a/src/py/libcamera/py_enums.cpp +++ b/src/py/libcamera/py_enums.cpp @@ -9,6 +9,8 @@ #include +#include "py_main.h" + namespace py = pybind11; using namespace libcamera; diff --git a/src/py/libcamera/py_formats_generated.cpp.in b/src/py/libcamera/py_formats_generated.cpp.in index a3f7f94d525d..c5fb9063992c 100644 --- a/src/py/libcamera/py_formats_generated.cpp.in +++ b/src/py/libcamera/py_formats_generated.cpp.in @@ -11,6 +11,8 @@ #include +#include "py_main.h" + namespace py = pybind11; class PyFormats diff --git a/src/py/libcamera/py_geometry.cpp b/src/py/libcamera/py_geometry.cpp index 5c2aeac483db..c7e303609427 100644 --- a/src/py/libcamera/py_geometry.cpp +++ b/src/py/libcamera/py_geometry.cpp @@ -14,6 +14,8 @@ #include #include +#include "py_main.h" + namespace py = pybind11; using namespace libcamera; diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index bce082186a8b..ab33f38a8fb7 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -85,14 +85,6 @@ PYBIND11_DECLARE_HOLDER_TYPE(T, PyCameraSmartPtr) */ static std::weak_ptr gCameraManager; -void init_py_color_space(py::module &m); -void init_py_controls_generated(py::module &m); -void init_py_enums(py::module &m); -void init_py_formats_generated(py::module &m); -void init_py_geometry(py::module &m); -void init_py_properties_generated(py::module &m); -void init_py_transform(py::module &m); - PYBIND11_MODULE(_libcamera, m) { init_py_enums(m); diff --git a/src/py/libcamera/py_main.h b/src/py/libcamera/py_main.h index 5bb5f2d1b303..4d594326e212 100644 --- a/src/py/libcamera/py_main.h +++ b/src/py/libcamera/py_main.h @@ -7,8 +7,18 @@ #include +#include + namespace libcamera { LOG_DECLARE_CATEGORY(Python) } + +void init_py_color_space(pybind11::module &m); +void init_py_controls_generated(pybind11::module &m); +void init_py_enums(pybind11::module &m); +void init_py_formats_generated(pybind11::module &m); +void init_py_geometry(pybind11::module &m); +void init_py_properties_generated(pybind11::module &m); +void init_py_transform(pybind11::module &m); diff --git a/src/py/libcamera/py_properties_generated.cpp.in b/src/py/libcamera/py_properties_generated.cpp.in index e3802b81a075..d28f1ab8b61a 100644 --- a/src/py/libcamera/py_properties_generated.cpp.in +++ b/src/py/libcamera/py_properties_generated.cpp.in @@ -11,6 +11,8 @@ #include +#include "py_main.h" + namespace py = pybind11; class PyProperties diff --git a/src/py/libcamera/py_transform.cpp b/src/py/libcamera/py_transform.cpp index f3a0bfaf4fc5..768260ffccf0 100644 --- a/src/py/libcamera/py_transform.cpp +++ b/src/py/libcamera/py_transform.cpp @@ -12,6 +12,8 @@ #include #include +#include "py_main.h" + namespace py = pybind11; using namespace libcamera; From patchwork Mon Jun 24 19:29:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20372 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 1D52BBD87C for ; Mon, 24 Jun 2024 19:30:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BE5EE654BE; Mon, 24 Jun 2024 21:30:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AvaWKqEi"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E7490654B2 for ; Mon, 24 Jun 2024 21:30:10 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D98EB1934; Mon, 24 Jun 2024 21:29:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257389; bh=3sX8uGR0wTvKNMPbxF8Rntb9Hn5Vy6k0psjTkRrib08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AvaWKqEiFoZ3HFtMMVQyfJ5qK6u9cMG6+fJgymr3X1rIBw/7tlnAhHAFnS5lUcbpg fEM4SDC5LgHNylAmzVC+kA1f0Z+rEZIOD4uTXXmKXbI54MxDJWD3oBJ+bivE4dzpqv p6WOZfhxK34AG5X1CDd7IwmeYntAIdfagO7cIYps= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 05/10] v4l2: v4l2_compat: Include missing headers Date: Mon, 24 Jun 2024 22:29:36 +0300 Message-ID: <20240624192941.22943-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The close() and ioctl() functions are declared in the unistd.h and sys/ioctl.h headers. Include them to provide the declarations. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/v4l2/v4l2_compat.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/v4l2/v4l2_compat.cpp b/src/v4l2/v4l2_compat.cpp index 8e2b7e924dfb..9dd1577dfbde 100644 --- a/src/v4l2/v4l2_compat.cpp +++ b/src/v4l2/v4l2_compat.cpp @@ -10,9 +10,11 @@ #include #include #include +#include #include #include #include +#include #include From patchwork Mon Jun 24 19:29:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20373 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 BF026BD87C for ; Mon, 24 Jun 2024 19:30:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 33EE2654BB; Mon, 24 Jun 2024 21:30:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PMSY4Jhr"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 33BE4654A1 for ; Mon, 24 Jun 2024 21:30:12 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2CA641929; Mon, 24 Jun 2024 21:29:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257390; bh=CjT1AKIin2El6EqOoEw0L/uzN21PIyPNg3xLusvHwMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PMSY4JhrDXlK0vUCkMDT5pKbaEpaxlNexz+2Rb5sAtTDH38bRmbkznJTM91ui3Hgz TE4B1LY2BFMA04fd7mbcZy8qOUu5WpPq042tpE7Ixnyz9eaX09xoOW1TfxpG/GG3Iu uB2tE4BaypJ9whlc4fb03pmDgZVdOLTWE1/A3thQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 06/10] v4l2: v4l2_compat: Selectively disable -Wmissing-declarations Date: Mon, 24 Jun 2024 22:29:37 +0300 Message-ID: <20240624192941.22943-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" _FORTIFY_SOURCE redirects the open*() calls to __open*_2() functions. The libcamera V4L2 adaptation layer intercepts those functions to support applications compiled with _FORTIFY_SOURCE. When _FORTIFY_SOURCE is not enabled, the C library headers will not provide declarations for the fortified functions, which will cause missing declaration warnings when we unable them. Fix this by disabling the -Wmissing-declarations warnings selectively for the _FORTIFY_SOURCE functions. To avoid sparkling pragmas around, move the relevant function definitions next to each other. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/v4l2/v4l2_compat.cpp | 43 ++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/v4l2/v4l2_compat.cpp b/src/v4l2/v4l2_compat.cpp index 9dd1577dfbde..8ff93192c3e3 100644 --- a/src/v4l2/v4l2_compat.cpp +++ b/src/v4l2/v4l2_compat.cpp @@ -42,12 +42,6 @@ LIBCAMERA_PUBLIC int open(const char *path, int oflag, ...) oflag, mode); } -/* _FORTIFY_SOURCE redirects open to __open_2 */ -LIBCAMERA_PUBLIC int __open_2(const char *path, int oflag) -{ - return open(path, oflag); -} - #ifndef open64 LIBCAMERA_PUBLIC int open64(const char *path, int oflag, ...) { @@ -58,11 +52,6 @@ LIBCAMERA_PUBLIC int open64(const char *path, int oflag, ...) return V4L2CompatManager::instance()->openat(AT_FDCWD, path, oflag | O_LARGEFILE, mode); } - -LIBCAMERA_PUBLIC int __open64_2(const char *path, int oflag) -{ - return open(path, oflag); -} #endif LIBCAMERA_PUBLIC int openat(int dirfd, const char *path, int oflag, ...) @@ -74,11 +63,6 @@ LIBCAMERA_PUBLIC int openat(int dirfd, const char *path, int oflag, ...) return V4L2CompatManager::instance()->openat(dirfd, path, oflag, mode); } -LIBCAMERA_PUBLIC int __openat_2(int dirfd, const char *path, int oflag) -{ - return openat(dirfd, path, oflag); -} - #ifndef openat64 LIBCAMERA_PUBLIC int openat64(int dirfd, const char *path, int oflag, ...) { @@ -89,12 +73,37 @@ LIBCAMERA_PUBLIC int openat64(int dirfd, const char *path, int oflag, ...) return V4L2CompatManager::instance()->openat(dirfd, path, oflag | O_LARGEFILE, mode); } +#endif + +/* + * _FORTIFY_SOURCE redirects open* to __open*_2. Disable the + * -Wmissing-declarations warnings, as the functions won't be declared if + * _FORTIFY_SOURCE is not in use. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-declarations" + +LIBCAMERA_PUBLIC int __open_2(const char *path, int oflag) +{ + return open(path, oflag); +} + +LIBCAMERA_PUBLIC int __open64_2(const char *path, int oflag) +{ + return open(path, oflag); +} + +LIBCAMERA_PUBLIC int __openat_2(int dirfd, const char *path, int oflag) +{ + return openat(dirfd, path, oflag); +} LIBCAMERA_PUBLIC int __openat64_2(int dirfd, const char *path, int oflag) { return openat(dirfd, path, oflag); } -#endif + +#pragma GCC diagnostic pop LIBCAMERA_PUBLIC int dup(int oldfd) { From patchwork Mon Jun 24 19:29:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20374 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 13B06BD87C for ; Mon, 24 Jun 2024 19:30:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C1B4D654A3; Mon, 24 Jun 2024 21:30:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="W9BEKz6w"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 81E47654AA for ; Mon, 24 Jun 2024 21:30:13 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 779BE1935; Mon, 24 Jun 2024 21:29:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257391; bh=sp/WPqVO9zetJYTYWRR9AGDR3MeZFbO9fzrm5MU26wI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W9BEKz6wqW2d+xwrezmkxncJmpJLCLTJE3WUxDOMSbuHFDHrCwABosu8aXiHnzHWF TlTEwGITWGTCOskIrKQfBGFf2iRQuiPtQZw9weaKAJsEe4hxEFrzLNI7lP7uJ01GaR QOBlUnu1Gi29JFsoG4cAX/JnNm8wJfUtq9J/cp9k= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 07/10] apps: Define local functions in anonymous namespace Date: Mon, 24 Jun 2024 22:29:38 +0300 Message-ID: <20240624192941.22943-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Multiple local functions are defined in the global namespace without the static keyword. This compiles fine for now, but will cause a missing declaration warning when we enable thel. To prepare for that, move the function declaration to an anonymous namespace. While at it, for consistency, include an existing static function in the namespace and drop the static keyword. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/apps/cam/main.cpp | 4 ++++ src/apps/common/dng_writer.cpp | 6 +++++- src/apps/qcam/main.cpp | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/apps/cam/main.cpp b/src/apps/cam/main.cpp index 4f87f200db21..460dbc813060 100644 --- a/src/apps/cam/main.cpp +++ b/src/apps/cam/main.cpp @@ -344,12 +344,16 @@ std::string CamApp::cameraName(const Camera *camera) return name; } +namespace { + void signalHandler([[maybe_unused]] int signal) { std::cout << "Exiting" << std::endl; CamApp::instance()->quit(); } +} /* namespace */ + int main(int argc, char **argv) { CamApp app; diff --git a/src/apps/common/dng_writer.cpp b/src/apps/common/dng_writer.cpp index 59f1fa23543b..58e35f3f9e1b 100644 --- a/src/apps/common/dng_writer.cpp +++ b/src/apps/common/dng_writer.cpp @@ -126,6 +126,8 @@ struct Matrix3d { float m[9]; }; +namespace { + void packScanlineSBGGR8(void *output, const void *input, unsigned int width) { const uint8_t *in = static_cast(input); @@ -282,7 +284,7 @@ void thumbScanlineIPU3([[maybe_unused]] const FormatInfo &info, void *output, } } -static const std::map formatInfo = { +const std::map formatInfo = { { formats::SBGGR8, { .bitsPerSample = 8, .pattern = { CFAPatternBlue, CFAPatternGreen, CFAPatternGreen, CFAPatternRed }, @@ -381,6 +383,8 @@ static const std::map formatInfo = { } }, }; +} /* namespace */ + int DNGWriter::write(const char *filename, const Camera *camera, const StreamConfiguration &config, const ControlList &metadata, diff --git a/src/apps/qcam/main.cpp b/src/apps/qcam/main.cpp index 9846fba58508..d0bde14130fb 100644 --- a/src/apps/qcam/main.cpp +++ b/src/apps/qcam/main.cpp @@ -21,6 +21,8 @@ using namespace libcamera; +namespace { + void signalHandler([[maybe_unused]] int signal) { qInfo() << "Exiting"; @@ -52,6 +54,8 @@ OptionsParser::Options parseOptions(int argc, char *argv[]) return options; } +} /* namespace */ + int main(int argc, char **argv) { QApplication app(argc, argv); From patchwork Mon Jun 24 19:29:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20375 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 336E7BD87C for ; Mon, 24 Jun 2024 19:30:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 716A5654BF; Mon, 24 Jun 2024 21:30:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SKdglmMT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D4802654B5 for ; Mon, 24 Jun 2024 21:30:14 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C06BB1650; Mon, 24 Jun 2024 21:29:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257393; bh=WaH4L3NJ0vi0DBXLJq31p62+/GCmxmIVmgCqAjzse+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SKdglmMTb0UGFHnhhTFBc5/9aaKIj63rDj/QB2HYu0Y5gbGIPmwOBsOlS7n+lahB2 omIAnuhVuImpd7HqNbDCkB94rNBTBZQ1I4VWE3qCHOj/3U5pGYukqBcA9Gq2Nhn7E5 399cWKwTwTbXJXL1sj3bTYKD/SNlmxEGcQeuO3wU= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 08/10] test: ipc: unixsocket: Define local function in anonymous namespace Date: Mon, 24 Jun 2024 22:29:39 +0300 Message-ID: <20240624192941.22943-9-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" A local function in the unixsocket test is defined in the global namespace without the static keyword. This compiles fine for now, but will cause a missing declaration warning when we enable them. To prepare for that, enclose the function declaration in an anonymous namespace. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- test/ipc/unixsocket.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp index f44ab9c90e25..2546882da085 100644 --- a/test/ipc/unixsocket.cpp +++ b/test/ipc/unixsocket.cpp @@ -34,6 +34,8 @@ using namespace libcamera; using namespace std; using namespace std::chrono_literals; +namespace { + int calculateLength(int fd) { lseek(fd, 0, 0); @@ -43,6 +45,8 @@ int calculateLength(int fd) return size; } +} /* namespace */ + class UnixSocketTestSlave { public: From patchwork Mon Jun 24 19:29:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20376 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 D6468BD87C for ; Mon, 24 Jun 2024 19:30:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4254A654BC; Mon, 24 Jun 2024 21:30:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UlZwKVqf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 27729654AF for ; Mon, 24 Jun 2024 21:30:16 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 185B818D7; Mon, 24 Jun 2024 21:29:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257394; bh=MLJQcwfndfHJYzzUbAmcbbUv6ZRcW1lyfHCSN7X2JW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UlZwKVqf78+mEp6pDwN7QsBR08YSwSUBwY5Zg/tkIs4yj+qL5aelvSDXu630kSM4D JfUN2u6g4+JpuQ7qQSYBb4OrodIZOO1w/Ewd7k6ifM+Q6655chDTHj71N7y8i3k/32 VlBq+zzKTz1p7eBYxhmAHZm5CTSHWVBwQVGeBRig= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 09/10] test: gstreamer: Include missing sanitizer/asan_interface.h header Date: Mon, 24 Jun 2024 22:29:40 +0300 Message-ID: <20240624192941.22943-10-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The GStreamet tests define a __asan_default_options() function to influence the behaviour of ASan. The function is declared in sanitizer/asan_interface.h, but we don't include the header. This will cause missing declaration warnings when we enable the -Wmissing-declarations option. Include the header to fix the issue. It can't be done unconditionally as not all toolchains provide ASan, so check for its availability at configuration time. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- test/gstreamer/gstreamer_test.cpp | 6 ++++++ test/gstreamer/meson.build | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp index e8119b853e7e..a15fef0e0c07 100644 --- a/test/gstreamer/gstreamer_test.cpp +++ b/test/gstreamer/gstreamer_test.cpp @@ -9,12 +9,17 @@ #include +#if HAVE_ASAN +#include +#endif + #include "gstreamer_test.h" #include "test.h" using namespace std; +#if HAVE_ASAN extern "C" { const char *__asan_default_options() { @@ -26,6 +31,7 @@ const char *__asan_default_options() return "detect_leaks=false"; } } +#endif GstreamerTest::GstreamerTest(unsigned int numStreams) : pipeline_(nullptr), libcameraSrc_(nullptr) diff --git a/test/gstreamer/meson.build b/test/gstreamer/meson.build index f3ba5a23dfba..37ad125ef3fd 100644 --- a/test/gstreamer/meson.build +++ b/test/gstreamer/meson.build @@ -11,8 +11,15 @@ gstreamer_tests = [ ] gstreamer_dep = dependency('gstreamer-1.0', required : true) +gstreamer_test_args = [] + +if asan_enabled + gstreamer_test_args += ['-D', 'HAVE_ASAN=1'] +endif + foreach test : gstreamer_tests exe = executable(test['name'], test['sources'], 'gstreamer_test.cpp', + cpp_args : gstreamer_test_args, dependencies : [libcamera_private, gstreamer_dep], link_with : test_libraries, include_directories : test_includes_internal) From patchwork Mon Jun 24 19:29:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20377 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 A212ABD87C for ; Mon, 24 Jun 2024 19:30:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4F417654B5; Mon, 24 Jun 2024 21:30:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="N/FBfViG"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 67D7E654B9 for ; Mon, 24 Jun 2024 21:30:17 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6035218ED; Mon, 24 Jun 2024 21:29:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719257395; bh=Z3r9SES2UEEA3C8Cg/pEsSQX92UQ+zuwr5bUSK9kb0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N/FBfViGCIlLMRvPjpJC1petsxDNr4Jm04CzQNi6k/aJ7mGloq3z+rE/2GSkBA3LF oc20YY4xkEbsnfnov4Oq/m0tD0XyM0p2AfpUcz26/9Qk1Km/AMYpAGAQfiPwBScdoj pVA3eAhwS5evXdXcusISg6iUf15Q1JkiS4q5ojsk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH 10/10] meson: Enable warnings to flag missing declarations Date: Mon, 24 Jun 2024 22:29:41 +0300 Message-ID: <20240624192941.22943-11-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> References: <20240624192941.22943-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" A recently introduced typo resulted in a function definition not matching its declaration. As the problem occurred in libipa, and IPA modules are loaded dynamically and are linked with lazy symbol resolution, the problem wasn't caught at build time. To try and catch future similar issues, enable the -Wmissing-declarations warning. Suggested-by: Barnabás Pőcze Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 0ef4cdaafd76..2acd8c3e8cfe 100644 --- a/meson.build +++ b/meson.build @@ -95,6 +95,7 @@ if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOUR endif common_arguments = [ + '-Wmissing-declarations', '-Wshadow', '-include', meson.current_build_dir() / 'config.h', ]