From patchwork Sun Mar 8 00:04:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3052 Return-Path: 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 D1290628F0 for ; Sun, 8 Mar 2020 01:04:42 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7388724B for ; Sun, 8 Mar 2020 01:04:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583625882; bh=8kxyd005ARWtlJ/21kzYQJgWKN/5d6J4zzH+XdfH3Oo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fRhMwp4JGSMlRpt0Dqv+HYAzu20znV7c1tlpJdD/REfl4TvFNaYb/M1fwcPhf7Bdm 7F5hjD0v2z5Zo7ta+5azbEBmEjfwnJqbtft2pm3/8uY3gK50zAExmIwoc+borLpaV0 cBF0z44tFzwCoxsonB5n9HfJACLAHtJNlICDUg0w= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 8 Mar 2020 02:04:28 +0200 Message-Id: <20200308000433.2917-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> References: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/6] include: libcamera: Improve automation of libcamera.h generation 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-List-Received-Date: Sun, 08 Mar 2020 00:04:43 -0000 The gen-header.sh script that generates libcamera.h takes all .h files in the include/libcamera/ directory, and manually adds the generated control_ids.h and version.h. This is fragile, as shown by the failure to add property_ids.h to the list in commit f870591a9bf5 ("libcamera: properties: Add location property"). To avoid future omissions, take all the .h.in files into account to generate libcamera.h. This also fixes the missing property_ids.h. Fixes: f870591a9bf5 ("libcamera: properties: Add location property") Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- include/libcamera/gen-header.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/libcamera/gen-header.sh b/include/libcamera/gen-header.sh index 7f7816c9f879..fcb9c5e16d07 100755 --- a/include/libcamera/gen-header.sh +++ b/include/libcamera/gen-header.sh @@ -16,10 +16,11 @@ cat < "$dst_file" EOF -headers=$(for header in "$src_dir"/*.h ; do +headers=$(for header in "$src_dir"/*.h "$src_dir"/*.h.in ; do header=$(basename "$header") + header="${header%.in}" echo "$header" -done ; echo "control_ids.h" ; echo "version.h" | sort) +done | sort) for header in $headers ; do echo "#include " >> "$dst_file" From patchwork Sun Mar 8 00:04:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3053 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 482B660424 for ; Sun, 8 Mar 2020 01:04:43 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CC60F5F; Sun, 8 Mar 2020 01:04:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583625883; bh=jZ/kP3uIB2vXSgpE39CJ4oFTiU3Uf96zgAJkmWdQR3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rg5j1lrlWa60b623H3j+DJyW04ha7urQ/eJFw8stPHQAt57xfniRP84N4dnaW1nE0 P7BnLJbT2tWqgaw3bTlhG8xJ1gjtR6GL0unHxZSAwJwRd8Y1zvYMPZSUdKFToIVzRq 7ip+YVByZ6AXwownt2bMrOkASQWSdOGD9liRgudw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 8 Mar 2020 02:04:29 +0200 Message-Id: <20200308000433.2917-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> References: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 2/6] include: libcamera: meson: Add control headers to the libcamera_api array 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-List-Received-Date: Sun, 08 Mar 2020 00:04:44 -0000 From: Kieran Bingham The libcamera_api array is meant to contain all the headers from the libcamera public API, for the purpose of generating documentation and creating the libcamera_dep dependency. The generated control headers are part of the libcamera public API, and used to be included in the libcamera_api array until commit f870591a9bf5 ("libcamera: properties: Add location property") inadvertently removed them. Add them back. Fixes: f870591a9bf5 ("libcamera: properties: Add location property") Signed-off-by: Kieran Bingham [Split the change out and reworded the commit message] Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- include/libcamera/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index f47c583cbbc0..88edf620f69e 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -44,6 +44,8 @@ foreach header : control_source_files install_dir : join_paths('include', include_dir)) endforeach +libcamera_api += control_headers + gen_header = files('gen-header.sh') libcamera_h = custom_target('gen-header', From patchwork Sun Mar 8 00:04:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3054 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AABD66291B for ; Sun, 8 Mar 2020 01:04:43 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3DC8824B for ; Sun, 8 Mar 2020 01:04:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583625883; bh=SL+A2mfSf0h1QwJD1G2aCLVHqDx9iDzWf88Tce0Dico=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PiRJyu4nr943DMZtGKqf7LbJ0C6NdfD8loc/eGtMV8CGpuX/HY86PcvDYa6Mn07Kz i5Os3JYogMdrK3mDhrMCgNA8GjVUdyk6DqZiaEKvk3aPi2GgsjRR4IiWe8Xaeoml3A DgQinheNhNA4U9/NgKhQoVCq5MlJ9n3hlXWOyF0E= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 8 Mar 2020 02:04:30 +0200 Message-Id: <20200308000433.2917-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> References: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 3/6] include: libcamera: meson: Add libcamera.h to the libcamera_api array 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-List-Received-Date: Sun, 08 Mar 2020 00:04:44 -0000 The libcamera_api array is meant to contain all the headers from the libcamera public API, for the purpose of generating documentation and creating the libcamera_dep dependency. libcamera.h is part of the libcamera public API, add it to the array. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- include/libcamera/meson.build | 2 ++ src/libcamera/meson.build | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 88edf620f69e..23c01d3837ba 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -55,6 +55,8 @@ libcamera_h = custom_target('gen-header', install : true, install_dir : join_paths('include', include_dir)) +libcamera_api += libcamera_h + version = libcamera_version.split('.') libcamera_version_config = configuration_data() libcamera_version_config.set('LIBCAMERA_VERSION_MAJOR', version[0]) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 88658ac563f7..1b69bc0dee54 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -120,7 +120,7 @@ libcamera = shared_library('camera', build_rpath : '/', dependencies : libcamera_deps) -libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_ipa_api, libcamera_h], +libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_ipa_api], include_directories : libcamera_includes, link_with : libcamera) From patchwork Sun Mar 8 00:04:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3055 Return-Path: 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 166D66290B for ; Sun, 8 Mar 2020 01:04:44 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A7A35F for ; Sun, 8 Mar 2020 01:04:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583625883; bh=Xr/8CBqTGieD+ntHJqYWs0pLWt229d1lqcTQ91nj2Cg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JbffzMg47DQBBo/0Mat153CBKs22MM7OoyVhkXIK1vniisI9mJ4Q1qfXsV3lJs3se AzMk4brZXbGR460vsVFqQ+o3Jf8NLhnElxzDB7U7OvKnq3KdaF1vcDSOd/PemvjT8h q5zE2stDyIcYMD/wGk9wNZ+ht0Q7ggRVVeG+C8Lw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 8 Mar 2020 02:04:31 +0200 Message-Id: <20200308000433.2917-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> References: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 4/6] libcamera: meson: Make libatomic and libdl dependencies reusable 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-List-Received-Date: Sun, 08 Mar 2020 00:04:45 -0000 libcamera.so links against libatomic and libdl, and handles those dependencies directly in the shared_object() call. More components within libcamera will need those dependencies, extract them to named variables to make them reusable. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 1b69bc0dee54..87fa09cde63d 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -58,6 +58,8 @@ includes = [ subdir('pipeline') subdir('proxy') +libatomic = cc.find_library('atomic', required : false) +libdl = cc.find_library('dl') libudev = dependency('libudev', required : false) if libudev.found() @@ -93,8 +95,8 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()], libcamera_sources += version_cpp libcamera_deps = [ - cc.find_library('atomic', required: false), - cc.find_library('dl'), + libatomic, + libdl, libudev, dependency('threads'), ] From patchwork Sun Mar 8 00:04:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3056 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 64D56628DF for ; Sun, 8 Mar 2020 01:04:44 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 085909CC for ; Sun, 8 Mar 2020 01:04:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583625884; bh=pHa8tQWZeIEz1py0Ab+HVvUv2Xz89jhlU+ExwP0/Iow=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d9iNfUBvVOzlr/2KxE2kQJLORekGWONajgKgbCN+TG10YE2mgUjiMPWNXfmZLTDN+ 49dGKjOTuCK4fbtwaMWoNMqn+277Q4+z6EwXfB/FeK5XBl/lFXqp47FFLljG45wkvq vg2+NrlrGJfGsgb6yRdIuxPPQC+txGuFQlotYXqg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 8 Mar 2020 02:04:32 +0200 Message-Id: <20200308000433.2917-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> References: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 5/6] cam: Link against libatomic if needed 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-List-Received-Date: Sun, 08 Mar 2020 00:04:45 -0000 The cam application makes use if std::atomic<>, link against libatomic if needed. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- Changes since v3: - Use the libatomic dependency object --- src/cam/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cam/meson.build b/src/cam/meson.build index 478346c59590..2419d648bc17 100644 --- a/src/cam/meson.build +++ b/src/cam/meson.build @@ -7,5 +7,5 @@ cam_sources = files([ ]) cam = executable('cam', cam_sources, - dependencies : libcamera_dep, + dependencies : [ libatomic, libcamera_dep ], install : true) From patchwork Sun Mar 8 00:04:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3057 Return-Path: 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 C7A5E60424 for ; Sun, 8 Mar 2020 01:04:44 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6075A5F for ; Sun, 8 Mar 2020 01:04:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583625884; bh=U9QS9lGGWSFk58zJoiLV/mtAfcTAQe2TccFXrPSQbGE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VaGV/ILPdTdxHNDHpsDFw+SoLfG5WU56SIpWauIjr6mzsnevo0lW0nz3g9CvRaq15 R8dNTdB1RubCPwjL/aOTRb5EtyuYwuiNSZfmnQeyMobagJe/+gct9IoC9yAN0vKSCJ fb+Jv/eoP8sVC1l1iJwS93nEbVGc0lJuzipNgnKk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 8 Mar 2020 02:04:33 +0200 Message-Id: <20200308000433.2917-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> References: <20200308000433.2917-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 6/6] v4l2: v4l2_compat: Use correct libcamera_dep dependency 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-List-Received-Date: Sun, 08 Mar 2020 00:04:45 -0000 The v4l2-compat shared library is declared as depending on libcamera_deps. This is not correct, as libcamera_deps contains the dependencies of libcamera itself. The correct dependency for users of libcamera is libcamera_dep. Fixing this allows dropping libcamera_includes from the list of includes required by v4l2-compat, and libcamera from the link_with list, as they are already contained in libcamera_dep. We however need to add an explicit dependency on libdl which was previously provided by libcamera_deps. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- Changes since v3: - Inline v4l2_compat_deps and v4l2_compat_includes - Use the libdl dependency object --- src/v4l2/meson.build | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build index 14ee3594747d..efab968f7729 100644 --- a/src/v4l2/meson.build +++ b/src/v4l2/meson.build @@ -5,11 +5,6 @@ v4l2_compat_sources = files([ 'v4l2_compat_manager.cpp', ]) -v4l2_compat_includes = [ - libcamera_includes, - libcamera_internal_includes, -] - v4l2_compat_cpp_args = [ # Meson enables large file support unconditionally, which redirect file # operations to 64-bit versions. This results in some symbols being @@ -25,7 +20,6 @@ v4l2_compat = shared_library('v4l2-compat', v4l2_compat_sources, name_prefix : '', install : true, - link_with : libcamera, - include_directories : v4l2_compat_includes, - dependencies : libcamera_deps, + include_directories : libcamera_internal_includes, + dependencies : [ libcamera_dep, libdl ], cpp_args : v4l2_compat_cpp_args)