From patchwork Tue Dec 17 15:31:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22380 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 881AEC32F6 for ; Tue, 17 Dec 2024 15:31:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B8D6167FDE; Tue, 17 Dec 2024 16:31:58 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SSO/tV99"; 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 66A2A67F0D for ; Tue, 17 Dec 2024 16:31:56 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DBAC83E; Tue, 17 Dec 2024 16:31:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734449479; bh=xvs8tRgIUlKtM8w4KWlWl3txd5DLK4YPHmsjgQl+i58=; h=From:To:Cc:Subject:Date:From; b=SSO/tV999jz5CVpm7b2Dd/HlzeiarZEGcuTC6jdsrkasdb9ESG+xmPbo11wUGxUPo BSRE8breFQcwVwwFCQAF4G3Ou/11jupGCNUGWEInHUW0qPEut2JzE0SF3l8aIRWpw7 i1Gvg/8lzYtosjRLaZmlRi4MnaX1efRg20Cksxd0= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart Subject: [libcamera-ci] [RFC PATCH v3 1/4] Enable `UDMABUF` in the kernel Date: Tue, 17 Dec 2024 16:31:50 +0100 Message-ID: <20241217153153.140417-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 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" This is necessary to test `DmaBufAllocator`, as well as the "virtual" pipeline handler since it uses the former to allocate buffers in `PipelineHandler::exportFrameBuffers()`. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- .gitlab-ci/build-kernel.sh | 1 + gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.47.1 diff --git a/.gitlab-ci/build-kernel.sh b/.gitlab-ci/build-kernel.sh index f413693..569f3db 100755 --- a/.gitlab-ci/build-kernel.sh +++ b/.gitlab-ci/build-kernel.sh @@ -51,6 +51,7 @@ kernel_config() { VIDEO_VIM2M VIDEO_VIMC VIDEO_VIVID + UDMABUF ) ./scripts/config ${disable[@]/#/--disable } diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 601759c..6d26680 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -65,7 +65,7 @@ include: .libcamera-ci.debian:12: variables: FDO_DISTRIBUTION_VERSION: 'bookworm' - FDO_DISTRIBUTION_TAG: '2024-11-05.1' + FDO_DISTRIBUTION_TAG: '2024-12-12.1' .libcamera-ci.debian:13: variables: From patchwork Tue Dec 17 15:31:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22381 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 643CEC32F6 for ; Tue, 17 Dec 2024 15:32:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1BDCB67FE0; Tue, 17 Dec 2024 16:32:00 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oHr9aig1"; 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 9B6D867FD3 for ; Tue, 17 Dec 2024 16:31:56 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2D2BD4C7; Tue, 17 Dec 2024 16:31:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734449479; bh=pU18mA0zXGfmF5O9BtzrneXQZrg8LcQfa8tCIYzpn0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oHr9aig13RTTaO+/BIvIC9A1SMRvsM2ZqG/smg8pS13baxvyrP55eDwYmK7tkjPrY 1sNs7CY9eQIEBWe0dw/kwps1fTpCWnrJJtFH7MKtOvm8c+s7jQf429diW92hab0LqE NBtMfBdrb9GWnWPGZeUaoAj0JbNJZpatjz90DyUc= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart Subject: [libcamera-ci] [RFC PATCH v3 2/4] Add `libevent` runtime libraries to the container Date: Tue, 17 Dec 2024 16:31:51 +0100 Message-ID: <20241217153153.140417-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241217153153.140417-1-barnabas.pocze@ideasonboard.com> References: <20241217153153.140417-1-barnabas.pocze@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" `libevent` is needed for some components, specifically `cam` and `lc-compliance`. Installing `libevent-dev` would be more convenient, but it is not doable at the moment because that package is not multiarch compatible. So only install the necessary runtime libraries. Build jobs already install `libevent-dev` when necessary before building libcamera, but this change enables the aforementioned components to be usable in different jobs as well. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- .gitlab-ci/setup-container.sh | 3 +++ gitlab-ci.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.47.1 diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh index d2909c7..0658368 100755 --- a/.gitlab-ci/setup-container.sh +++ b/.gitlab-ci/setup-container.sh @@ -103,6 +103,9 @@ case $FDO_DISTRIBUTION_VERSION in 'bookworm') # libclang-rt-dev for the clang ASan runtime. PKGS_LIBCAMERA_RUNTIME_MULTIARCH+=( libclang-rt-dev ) + # For cam and lc-compliance + # libevent-dev cannot be used here, see build-libcamera-common.sh + PKGS_LIBCAMERA_RUNTIME_MULTIARCH+=( libevent-2.1-7 libevent-pthreads-2.1-7 ) ;; 'trixie') # gcc 13 to expand compilation testing coverage. diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 6d26680..f679d6e 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -65,7 +65,7 @@ include: .libcamera-ci.debian:12: variables: FDO_DISTRIBUTION_VERSION: 'bookworm' - FDO_DISTRIBUTION_TAG: '2024-12-12.1' + FDO_DISTRIBUTION_TAG: '2024-12-16.1' .libcamera-ci.debian:13: variables: From patchwork Tue Dec 17 15:31:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22382 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 E4FEAC32F6 for ; Tue, 17 Dec 2024 15:32:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3296367FDB; Tue, 17 Dec 2024 16:32:01 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JWVuuJTp"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BBB5967FD5 for ; Tue, 17 Dec 2024 16:31:56 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 726A475A for ; Tue, 17 Dec 2024 16:31:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734449479; bh=Kx0F2w3oJr0kLBSQxrNc07jkHZ2lfuYTkoYzo/6JJTk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JWVuuJTp1VE8CM7WtWVmeXrQ1PqCOLPN6ucb+Cb/85FXQNAjw6ULm2vJljcjIfa7P icaVZgrG5XGmX186JJ+yUqpEBNGwnt9uTYfxo7BQ4EJoNwai4B5Ij+mk508Selu2JL pP89vTrIRJB7E/bg75r3pi8pTL03uuiiyVXousAI= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v3 3/4] Add `build-package:debug` job Date: Tue, 17 Dec 2024 16:31:52 +0100 Message-ID: <20241217153153.140417-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241217153153.140417-1-barnabas.pocze@ideasonboard.com> References: <20241217153153.140417-1-barnabas.pocze@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" Convert `build-package:arm64` into a `parallel:matrix` job that compiles libcamera for amd64 and arm64 with debugging additions (ASAN, UBSAN, STL debugging) and then publishes the resulting package as an artifact for other jobs to use. Note the `force_fallback_for=gtest` option, which is needed because the googletest library, a dependency of `lc-compliance`, uses STL types in its API, and `cpp_debugstl=true` changes the ABI of these types, so it has to be compiled with the same options from source. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- Changes in v3: * extend `build-package:arm64` instead of creating a new job --- gitlab-ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) -- 2.47.1 diff --git a/gitlab-ci.yml b/gitlab-ci.yml index f679d6e..205c6ff 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -248,7 +248,7 @@ build-history: # real hardware. Enable only the options needed by the tests. # -build-package:arm64: +build-package:debug: extends: - .fdo.distribution-image@debian - .libcamera-ci.debian:12 @@ -261,27 +261,28 @@ build-package:arm64: - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh - $CI_PROJECT_DIR/.gitlab-ci/package-libcamera.sh artifacts: - name: libcamera-arm64-${CI_COMMIT_SHA} + name: libcamera-debug-${ARCH}-${CI_COMMIT_SHA} when: always expire_in: 1 week paths: - build/meson-logs/ - libcamera-${CI_COMMIT_SHA}.tar.xz variables: - ARCH: arm64 BUILD_TYPE: debug MESON_OPTIONS: >- - -D cam=disabled - -D documentation=disabled - -D gstreamer=disabled - -D lc-compliance=enabled + -D b_sanitize=address,undefined + -D cpp_debugstl=true + -D force_fallback_for=['gtest'] -D pipelines=['auto'] - -D pycamera=disabled - -D qcam=disabled + -D auto_features=disabled + -D lc-compliance=enabled -D test=false -D tracing=enabled - -D udev=disabled -D v4l2=false + parallel: + matrix: + - ARCH: amd64 + - ARCH: arm64 # # Build and package libcamera for Chrome OS, for the purpose of running tests From patchwork Tue Dec 17 15:31:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22383 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 B13C0C3302 for ; Tue, 17 Dec 2024 15:32:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3D7C867FE4; Tue, 17 Dec 2024 16:32:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VTGMIQgn"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F20E567FD6 for ; Tue, 17 Dec 2024 16:31:56 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AE48C3E for ; Tue, 17 Dec 2024 16:31:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734449479; bh=8mi7ue6C0vJSGTHux8ZZnItwqAkIwnXmd2/CM9XtRvY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VTGMIQgnYc65bYvFO5XjXWHztj/9lYyNpnmTmTFWRB+Q5BmnA7wU6u6BI2U6DryrY lzkKIYBllX39hLqSYNjYrJvWFnGc+8kZl/GpN4nC7IfZlR9Q4WTdxqh7TQiF1D5b75 qDZg62yp3WIf/sNH6PlolqBDzWBBmKObn+moLBFw= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v3 4/4] Add job to run lc-compliance on the virtual pipeline handler Date: Tue, 17 Dec 2024 16:31:53 +0100 Message-ID: <20241217153153.140417-4-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241217153153.140417-1-barnabas.pocze@ideasonboard.com> References: <20241217153153.140417-1-barnabas.pocze@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" Add a new job named `test-lc-compliance:virtual` that uses the build artifacts created by the `build-package:debug` job on amd64 to run `lc-compliance` on the "Virtual0" camera in a virtual machine. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- This needs libcamera changes to work and to run in reasonable time: * https://patchwork.libcamera.org/project/libcamera/list/?series=4874 * https://patchwork.libcamera.org/patch/22379/ * https://gitlab.freedesktop.org/pobrn/libcamera/-/commit/ed4b5bc179ea405f2f01b85b4114720f67ce3595 Changes in v2: * publish lc-compliance results to gitlab * add and use script to install libcamera binary package --- .gitlab-ci/test-lc-compliance.sh | 37 +++++++++++++++++++++++++++++++ .gitlab-ci/unpackage-libcamera.sh | 17 ++++++++++++++ gitlab-ci.yml | 22 +++++++++++++++++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100755 .gitlab-ci/test-lc-compliance.sh create mode 100755 .gitlab-ci/unpackage-libcamera.sh -- 2.47.1 diff --git a/.gitlab-ci/test-lc-compliance.sh b/.gitlab-ci/test-lc-compliance.sh new file mode 100755 index 0000000..8c726fa --- /dev/null +++ b/.gitlab-ci/test-lc-compliance.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2024 Google Inc. + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_compliance() { + echo "Running libcamera compliance tests in a qemu VM" + + virtme-ng \ + --verbose \ + --skip-modules \ + --force-9p \ + --rwdir "$PWD/build" \ + --run /opt/linux/bzImage \ + --exec " \ + LIBCAMERA_LOG_LEVELS=*:DEBUG \ + ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 \ + UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 \ + GTEST_OUTPUT=xml:./build/lc-compliance-report.xml \ + lc-compliance -c Virtual0; \ + echo \\\$? > ./build/.test-status; \ + " + + local status=$(cat build/.test-status) + echo "Test result exit state: $status" + rm build/.test-status + + if [[ $status != 0 ]] ; then + exit $status + fi +} + +run libcamera_compliance diff --git a/.gitlab-ci/unpackage-libcamera.sh b/.gitlab-ci/unpackage-libcamera.sh new file mode 100755 index 0000000..9eb3192 --- /dev/null +++ b/.gitlab-ci/unpackage-libcamera.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2024 Google Inc. + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_unpackage() { + echo "Unpackage libcamera binaries" + + tar -xvf libcamera-${CI_COMMIT_SHA}.tar.xz -C / + ldconfig -v +} + +run libcamera_unpackage diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 205c6ff..701d02f 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -273,7 +273,7 @@ build-package:debug: -D b_sanitize=address,undefined -D cpp_debugstl=true -D force_fallback_for=['gtest'] - -D pipelines=['auto'] + -D pipelines=['auto','virtual'] -D auto_features=disabled -D lc-compliance=enabled -D test=false @@ -408,3 +408,23 @@ test-unit: # artifacts: # reports: # junit: build/meson-logs/testlog.junit.xml + +test-lc-compliance:virtual: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:12 + - .libcamera-ci.scripts + stage: test + needs: + - job: build-package:debug + parallel: + matrix: + - ARCH: amd64 + tags: + - kvm + script: + - $CI_PROJECT_DIR/.gitlab-ci/unpackage-libcamera.sh + - $CI_PROJECT_DIR/.gitlab-ci/test-lc-compliance.sh + artifacts: + reports: + junit: build/lc-compliance-report.xml