From patchwork Wed Feb 9 07:19:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 15344 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 09688BDCBF for ; Wed, 9 Feb 2022 07:19:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5D3D7610AD; Wed, 9 Feb 2022 08:19:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="nDFzp+Y8"; dkim-atps=neutral Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 68DB060202 for ; Wed, 9 Feb 2022 08:19:26 +0100 (CET) Received: by mail-pf1-x430.google.com with SMTP id i30so2750869pfk.8 for ; Tue, 08 Feb 2022 23:19:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m8zrYwsxrIyy49EVZPdSHFcOVjdQm3wrSjne+fEGZrE=; b=nDFzp+Y8YOF+zL4zB96tOi3+jsQl+iUOALHT26ZtBIpnvAJyhQPSM95fQvEvySbsY5 pTrZcP46pyqWsRnt7Ny+agjRm33UP0vFHqFKh6KTuZFcp2BvdRIGDGBnYanVEzQDIWSK lU97a3XgnUNKFIH14Y5f74/9lQtK41EfVEMhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m8zrYwsxrIyy49EVZPdSHFcOVjdQm3wrSjne+fEGZrE=; b=6J/1BE1v1QfkhBavafB56D0Wq35XslU7lirmgmKjMhKdR8Gx2rpUOVwgDckAlqTsxx WkQCfhqOLXc9pGdf1FMc+aFaXNygVb8ofGCKmURIU36qCSAtOpVFmgX+s8p5yo7SVWgI qUAA66FcAwNRRg/f61MwvbXOPCnUyIpSK4e0GLD0cSyv++YntStXL56A+YEooOs6+Rpr xi66z1POBy5qFZfMfEEOjA0d81CcjuGcfWhozxBdG+lNK0etBGzshWvrr2oVkoHT++MS 7CwrCb3JwykqAAw15shMTj1RFIQPx4craQr1jMajN7i3tpYnhqW3sA+9fkcczHmjmeV+ fqlQ== X-Gm-Message-State: AOAM530T+fXzvRSbfAiUCZszzZnXnbEG1hXU/NayNzjT8W7VES6d3dug n9od8UKE0PJ+FB7dZv4GnMr7bSul5DkMfQ== X-Google-Smtp-Source: ABdhPJwPWLoJ7OnGXrneJojHqaQocdIp9sADBUroYPAtMI0F6Dul+X7X8ialPFZQGF+8qYg+egHNiQ== X-Received: by 2002:a63:2a02:: with SMTP id q2mr833683pgq.519.1644391164379; Tue, 08 Feb 2022 23:19:24 -0800 (PST) Received: from localhost ([2401:fa00:1:10:a5cf:9a43:1c6d:824]) by smtp.gmail.com with UTF8SMTPSA id j7sm17034409pfa.36.2022.02.08.23.19.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 23:19:24 -0800 (PST) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Wed, 9 Feb 2022 15:19:08 +0800 Message-Id: <20220209071917.559993-1-hanlinchen@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/9] Introduce Pipeline configuration preference for IPU3 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" Hello, This patch series is to introduce the pipeline configuration preference for IPU3. Before the series, IPU3 calculates the ImgU configuration based on the algorithm from Intel: https://github.com/intel/intel-ipu3-pipecfg However, IPU3 seems not well defined with the limitation on ImgU and leading to configuration failure in some cases. See: https://bugs.libcamera.org/show_bug.cgi?id=67 Due to this, on ChromeOS, Intel made manual adjusts on the validated setting for each camera module. The patch series is to introduce the feature for IPU3, and possibly other platforms with similar issues. The patch 1-2 is to introduce Option control for user to enable features which need to be selected before querying capabilities of a camera. The patch 3 Adds helper class to wrap libyaml for easier reading yaml files. The patch 4-9 Supports the Pipeline configuration preference of IPU3 and default to be enabled on ChromeOS is it's specified on hal_config.yaml. Han-Lin Chen (9): libcamera: Introduce option to customize behavior for a camera module libcamera: Add options() and setOptions() operations to Camera libcamera: Introduce YamlParser as a helper to parse yaml files android: camera_hal_config: Use YamlParser to parse android hal config android: Add pipeline_config_file parameter for camera_hal.yaml android: Set PipelineConfigFile option if it's supported by the camera libcamera: ipu3: Add helper class PipeConfigPreference libcamera: ipu3: Support PipelineConfigFile option android: Elevate min duration to 30 FPS if it's lower within 2% README.rst | 2 +- include/libcamera/camera.h | 3 + include/libcamera/geometry.h | 4 + include/libcamera/internal/camera.h | 2 + include/libcamera/internal/meson.build | 1 + include/libcamera/internal/pipeline_handler.h | 2 + include/libcamera/internal/yaml_parser.h | 82 ++ include/libcamera/ipa/ipa_controls.h | 1 + include/libcamera/meson.build | 3 +- include/libcamera/option_ids.h.in | 36 + src/android/camera_capabilities.cpp | 31 +- src/android/camera_device.cpp | 19 + src/android/camera_hal_config.cpp | 344 ++------ src/android/camera_hal_config.h | 1 + src/android/data/nautilus/camera_hal.yaml | 2 + src/android/data/nautilus/imx258.yaml | 248 ++++++ src/android/data/soraka/camera_hal.yaml | 2 + src/android/data/soraka/ov13858.yaml | 236 ++++++ src/android/data/soraka/ov5670.yaml | 242 ++++++ src/libcamera/camera.cpp | 59 ++ src/libcamera/control_serializer.cpp | 12 + src/libcamera/geometry.cpp | 20 + src/libcamera/meson.build | 3 + src/libcamera/option_ids.cpp.in | 58 ++ src/libcamera/option_ids.yaml | 16 + src/libcamera/pipeline/ipu3/ipu3.cpp | 215 ++++- src/libcamera/pipeline/ipu3/meson.build | 1 + .../pipeline/ipu3/pipe_config_pref.cpp | 285 +++++++ .../pipeline/ipu3/pipe_config_pref.h | 80 ++ src/libcamera/pipeline_handler.cpp | 26 + src/libcamera/yaml_parser.cpp | 796 ++++++++++++++++++ 31 files changed, 2563 insertions(+), 269 deletions(-) create mode 100644 include/libcamera/internal/yaml_parser.h create mode 100644 include/libcamera/option_ids.h.in create mode 100644 src/android/data/nautilus/imx258.yaml create mode 100644 src/android/data/soraka/ov13858.yaml create mode 100644 src/android/data/soraka/ov5670.yaml create mode 100644 src/libcamera/option_ids.cpp.in create mode 100644 src/libcamera/option_ids.yaml create mode 100644 src/libcamera/pipeline/ipu3/pipe_config_pref.cpp create mode 100644 src/libcamera/pipeline/ipu3/pipe_config_pref.h create mode 100644 src/libcamera/yaml_parser.cpp