From patchwork Tue Aug 20 16:23:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 20967 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 5C2E6C323E for ; Tue, 20 Aug 2024 17:22:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2D49A633CE; Tue, 20 Aug 2024 19:22:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FKk3PT5a"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 30F5C633B2 for ; Tue, 20 Aug 2024 19:22:14 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-371b015572cso2650685f8f.1 for ; Tue, 20 Aug 2024 10:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724174533; x=1724779333; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=X0F9THL9Cp/tA+tfC0hZqUUHw5CXF2w3TFFeGiKFJdo=; b=FKk3PT5aa3+LR7Oplkzy8pUzMQkfBbLISLmu6VraVrUdqjmzQPo/ZNZgXyINq0pIYl 6TiMThLkI6JRu7sxcoDf9jYtJ69kHJtpoUCADXXfmWLGLNIJi8he0D2XGvOUxFAMWij0 lvdyZqRklV3zBqN5oxkvXtvMrQdTAg1YbZdrs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724174533; x=1724779333; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X0F9THL9Cp/tA+tfC0hZqUUHw5CXF2w3TFFeGiKFJdo=; b=qhOQaEAoqoJk5HJn9sO7JeU/wyfHNeT224YUFV5pK6UwbbvxfL2GLINYTL2H9g1nRI Oo5tk+hTmnr1FZnpOcZXqa9D3P7vInGnuneNZnbkYIrGYO/PQTYLPdwoxfI7zvuhGUS9 oy6UnNUdGL+raXT7UIoKFgMp2CRwn0Jz02OYn1mn340K+tHPwteSPg8drI5k4QRU9/FL yhCqG9TQYGj5B1chX2YWQpW7nh3QEwAArmIW2yPSxIDX5dESlbFHAyqosIsGTrfeU97/ nag31RB7JqKqGzZBnQnOnSuxWYM5SeeGohOwhODoItPHyXx0ONPn0t0snrVimVQRwE7W ZFsw== X-Gm-Message-State: AOJu0YzE3ZharlDlnfco/TTn56xD60EaZcHdbp6pV7bEcuDQh/IVL7+z CKLKT+u3JdAcvSa1YcoVBWjNGXPdBJmGjHIuGSPcSADrlJsVDpXyVX1PLecs4qzivRHEZbRflxj nGsxMrOk= X-Google-Smtp-Source: AGHT+IGlqyh27OGuaeCw8Eo1vf5c+pfr8qiq2tRHVlmVKS8jEoJILj85Y/FnWxDhfnZbrbRwn/Avgg== X-Received: by 2002:a5d:5545:0:b0:366:ee01:30d6 with SMTP id ffacd0b85a97d-3719469ff15mr11975771f8f.49.1724174533324; Tue, 20 Aug 2024 10:22:13 -0700 (PDT) Received: from chenghaoyang-germany.c.googlers.com.com (161.126.77.34.bc.googleusercontent.com. [34.77.126.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ab6e90db5sm30328575e9.0.2024.08.20.10.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 10:22:12 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v9 0/8] Add VirtualPipelineHandler Date: Tue, 20 Aug 2024 16:23:31 +0000 Message-ID: <20240820172202.526547-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog 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" Hi all, This series adds virtual pipeline handler, which doesn't depend on any hardware, like camera sensor or ISP. Currently the configuration supports test patterns and images. It passed the gitlab pipeline: https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1253511 , with only merge-check warnings remaining. Update in v9: Allocate contiguous memory for planes in the same FrameBuffer. BR, Harvey Harvey Yang (4): libcamera: add DmaBufAllocator::exportBuffers() libcamera: Remove PipelineHandler Fatal check of non-empty MediaDevices libcamera: pipeline: Add VirtualPipelineHandler libcamera: software_isp: Refactor SoftwareIsp to use DmaBufAllocator::exportBuffers Konami Shu (4): libcamera: pipeline: Add test pattern for VirtualPipelineHandler libcamera: pipeline: Read config and register cameras based on the config libcamera: pipeline: Shift test pattern by 1 pixel left every frame libcamera: pipeline: Load images .../libcamera/internal/dma_buf_allocator.h | 12 + meson.build | 1 + meson_options.txt | 3 +- src/libcamera/dma_buf_allocator.cpp | 64 +++- src/libcamera/pipeline/virtual/README.md | 76 +++++ .../pipeline/virtual/common_functions.cpp | 27 ++ .../pipeline/virtual/common_functions.h | 18 ++ .../pipeline/virtual/data/virtual.yaml | 49 +++ .../pipeline/virtual/frame_generator.h | 33 ++ .../virtual/image_frame_generator.cpp | 154 ++++++++++ .../pipeline/virtual/image_frame_generator.h | 65 ++++ src/libcamera/pipeline/virtual/meson.build | 32 ++ src/libcamera/pipeline/virtual/parser.cpp | 243 +++++++++++++++ src/libcamera/pipeline/virtual/parser.h | 48 +++ .../virtual/test_pattern_generator.cpp | 148 +++++++++ .../pipeline/virtual/test_pattern_generator.h | 58 ++++ src/libcamera/pipeline/virtual/virtual.cpp | 287 ++++++++++++++++++ src/libcamera/pipeline/virtual/virtual.h | 96 ++++++ src/libcamera/pipeline_handler.cpp | 11 +- src/libcamera/software_isp/software_isp.cpp | 20 +- 20 files changed, 1420 insertions(+), 25 deletions(-) create mode 100644 src/libcamera/pipeline/virtual/README.md create mode 100644 src/libcamera/pipeline/virtual/common_functions.cpp create mode 100644 src/libcamera/pipeline/virtual/common_functions.h create mode 100644 src/libcamera/pipeline/virtual/data/virtual.yaml create mode 100644 src/libcamera/pipeline/virtual/frame_generator.h create mode 100644 src/libcamera/pipeline/virtual/image_frame_generator.cpp create mode 100644 src/libcamera/pipeline/virtual/image_frame_generator.h create mode 100644 src/libcamera/pipeline/virtual/meson.build create mode 100644 src/libcamera/pipeline/virtual/parser.cpp create mode 100644 src/libcamera/pipeline/virtual/parser.h create mode 100644 src/libcamera/pipeline/virtual/test_pattern_generator.cpp create mode 100644 src/libcamera/pipeline/virtual/test_pattern_generator.h create mode 100644 src/libcamera/pipeline/virtual/virtual.cpp create mode 100644 src/libcamera/pipeline/virtual/virtual.h