From patchwork Thu Dec 12 18:16: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: 22301 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 6F1A3C32EA for ; Thu, 12 Dec 2024 18:17:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8FB8767EE0; Thu, 12 Dec 2024 19:17:01 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ETYbimQJ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D8A7608B6 for ; Thu, 12 Dec 2024 19:16:59 +0100 (CET) Received: from pb-laptop.local (185.221.143.90.nat.pool.zt.hu [185.221.143.90]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 55BFA316 for ; Thu, 12 Dec 2024 19:16:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734027385; bh=1fL6unuFezKYgYDN6MVHfMORST1I5wftvaBVl1cybYs=; h=From:To:Subject:Date:From; b=ETYbimQJMSxn5lF1DvYCsi+lKYKJn6Hm12yEk8DdRW+Wvz0rUeVyvZAj9AEQEDF3m gCgjgfpI2deT+gsWUHthYAPjFSzBC7rEU7DvaGdpzW7naPFqNwz1dQWE1H9Na9GNJf d7rAJLwqBlCCofLj+YwnA0ml0BafsIQUrbpqFEwc= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 1/3] Enable `UDMABUF` in the kernel Date: Thu, 12 Dec 2024 19:16:53 +0100 Message-ID: <20241212181655.112958-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(-) 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 c78235e..8bc8bc2 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -64,7 +64,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 Thu Dec 12 18:16:54 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: 22302 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 DE514C32EA for ; Thu, 12 Dec 2024 18:17:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B5B3867EE3; Thu, 12 Dec 2024 19:17:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Aqq0ggnY"; 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 75AE267ED9 for ; Thu, 12 Dec 2024 19:16:59 +0100 (CET) Received: from pb-laptop.local (185.221.143.90.nat.pool.zt.hu [185.221.143.90]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 92D6DA2F for ; Thu, 12 Dec 2024 19:16:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734027385; bh=yZ8nZU7xzMKShnGGc99l0UHvn1p389jHCOzXshUly7Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Aqq0ggnYMxPXwsJjSKLZjmfwXCUZB3twLRInv4M0E5NNnhCBvhO+exJHKkB51HJVm 90Yc/RjiaeYOVscHCmbk4oFu2KOtwTO4hNOPEZPGO01F7YVI7fz9X9LJQEb5PeXlL8 0meBzfN+UaisF2QtRVAdoawDCZ7yX/jjdgY29o4w= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v1 2/3] Separate the building and running of unit tests Date: Thu, 12 Dec 2024 19:16:54 +0100 Message-ID: <20241212181655.112958-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212181655.112958-1-barnabas.pocze@ideasonboard.com> References: <20241212181655.112958-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" The built artifacts will be reused in a later job, so split the "test-unit" into the "build-test" and "test-unit" jobs. The `libevent` development package cannot be installed in the container directly because it is not multiarch compatible. It is, however, installed in the architecture specific build jobs, right before building. To ensure that the it is available for already built executables in different jobs, install just the libraries in the container. Signed-off-by: Barnabás Pőcze --- .gitlab-ci/setup-container.sh | 3 +++ gitlab-ci.yml | 42 +++++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 14 deletions(-) -- 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 8bc8bc2..c7448b8 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -64,7 +64,7 @@ include: .libcamera-ci.debian:12: variables: FDO_DISTRIBUTION_VERSION: 'bookworm' - FDO_DISTRIBUTION_TAG: '2024-12-12.1' + FDO_DISTRIBUTION_TAG: '2024-12-12.2' .libcamera-ci.debian:13: variables: @@ -363,28 +363,18 @@ test-soraka: script: - submit .gitlab-ci/lava/soraka-camera-test.yml -# Run the unit tests in a virtual machine. Enable only the options exercised by -# the unit tests. -test-unit: +# Enable only the options exercised by the unit tests. +build-test:debug: extends: - .fdo.distribution-image@debian - .libcamera-ci.debian:12 - .libcamera-ci.scripts - stage: test + stage: build needs: - job: container-debian:12 artifacts: false - tags: - - kvm script: - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh - - $CI_PROJECT_DIR/.gitlab-ci/test-libcamera-qemu.sh - artifacts: - name: libcamera-unit-tests-${CI_COMMIT_SHA} - when: always - expire_in: 1 week - paths: - - build/meson-logs/ variables: BUILD_TYPE: debug MESON_OPTIONS: >- @@ -399,6 +389,30 @@ test-unit: -D qcam=disabled -D test=true -D v4l2=true + artifacts: + paths: + - build/ + expire_in: 1 day + +# Run the unit tests in a virtual machine. +test-unit: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:12 + - .libcamera-ci.scripts + stage: test + needs: + - job: build-test:debug + tags: + - kvm + script: + - $CI_PROJECT_DIR/.gitlab-ci/test-libcamera-qemu.sh + artifacts: + name: libcamera-unit-tests-${CI_COMMIT_SHA} + when: always + expire_in: 1 week + paths: + - build/meson-logs/ # meson prior to 1.2.0 doesn't correctly escape non-printable characters # when generating the testlog XML. This results in an unparseable file. From patchwork Thu Dec 12 18:16:55 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: 22303 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 4A7B9C32EA for ; Thu, 12 Dec 2024 18:17:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E891467EDE; Thu, 12 Dec 2024 19:17:03 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="eAd5GoMz"; 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 A46CE67EDA for ; Thu, 12 Dec 2024 19:16:59 +0100 (CET) Received: from pb-laptop.local (185.221.143.90.nat.pool.zt.hu [185.221.143.90]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CF22E316 for ; Thu, 12 Dec 2024 19:16:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734027385; bh=AwhueC/jxcCrfvDFKEW3e7iX5VorJwlmYijEHVXBma4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eAd5GoMzemo07LAC1ZwnqTFaCKEC4OvVO2s1VNzx77gpVDKg393r57N60IS3CXum8 rzKBwHBLGyj1O5r41mbUth/edowPlabYVgwFeyG62gfEpl198+JUGNV/3DL3T0/Irn r8tA/2hhI/s/uCIAGUwgterOVemkLdwgIrFsahUQ= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v1 3/3] Add job to run lc-compliance on the virtual pipeline handler Date: Thu, 12 Dec 2024 19:16:55 +0100 Message-ID: <20241212181655.112958-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212181655.112958-1-barnabas.pocze@ideasonboard.com> References: <20241212181655.112958-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 "lc-compliance:virtual" that uses the build artifacts produced by the "build-test:debug" job to run lc-compliance in a virtual machine on the "Virtual0" camera. The `force_fallback_for=gtest` option is needed because `cpp_debustl` makes ABI incompatible changes in the STL containers, so googletest also needs to be compiled with these changes. Signed-off-by: Barnabás Pőcze --- .gitlab-ci/test-lc-compliance.sh | 27 +++++++++++++++++++++++++++ gitlab-ci.yml | 18 ++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100755 .gitlab-ci/test-lc-compliance.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..e6697a6 --- /dev/null +++ b/.gitlab-ci/test-lc-compliance.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +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 ./build/src/apps/lc-compliance/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.yml b/gitlab-ci.yml index c7448b8..5e9e309 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -382,9 +382,10 @@ build-test:debug: -D cam=disabled -D cpp_debugstl=true -D documentation=disabled + -D force_fallback_for=gtest -D gstreamer=enabled - -D lc-compliance=disabled - -D pipelines=[] + -D lc-compliance=enabled + -D pipelines=virtual -D pycamera=enabled -D qcam=disabled -D test=true @@ -420,3 +421,16 @@ test-unit: # artifacts: # reports: # junit: build/meson-logs/testlog.junit.xml + +lc-compliance:virtual: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:12 + - .libcamera-ci.scripts + stage: test + needs: + - job: build-test:debug + tags: + - kvm + script: + - $CI_PROJECT_DIR/.gitlab-ci/test-lc-compliance.sh