From patchwork Thu Jan 19 10:45:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18148 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 47CC6BD87C for ; Thu, 19 Jan 2023 10:45:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1C393625E7; Thu, 19 Jan 2023 11:45:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1674125154; bh=IXkxGlUqTtOMJ2wuoL0zO+3+wFcKh3gVYaXlmwkDeGU=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=NrTPPBSnmp42CDPNHVRWiWgJdqkZKfXdy9XgbFr/hrpL9Yvp1wy792faq5/02N/JY ZzOozEss/5LOMyaDiYojchwULESWlWG7fG7MttER1zoFuDpVkydhV4FeiFoqEnVtoK xHnqkkxFTFSrHKCCU6feIu/SLdp4SfvAyBoZ1M4aYDosmu0B/+4v9ioCZ9olGxt/SB GYnbUkvQWhv8i9dPcNgtJJFxB2eVVSKGvFVuFDa7Lr3BoHvVxjdeZss+EjdjcwMY17 yKLdFF5b83QlcblqpHEnrvQLo1BE31+uGFFIekGvFuztk6/oNIJ2AU9UfVPdoGnhwY rk1nasigbiSfg== Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 712BC61EFC for ; Thu, 19 Jan 2023 11:45:52 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="OppftciF"; dkim-atps=neutral Received: by mail-wm1-x32b.google.com with SMTP id f19-20020a1c6a13000000b003db0ef4dedcso3251004wmc.4 for ; Thu, 19 Jan 2023 02:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XAdyN7hkQitH4LCcTCM77EYjX8uRUfV+Nlz/b1RI/90=; b=OppftciFdt/Tpo97gwSR0nAuaZGPag5XxDjIm6xdFOFc7yMAvMIL6utkWQpleOddws CDLGWbGWGVmDL5aCrUk8yhHuEHmTfvvY/6Hexdd1eGsV3bNDkK3DIf/yRm3YonKmD+FI TCm/QRhNQw0RSGIR0LFG8ae1xkr6sp/aycMNkg1C1IzppnAgMXItJijgOmnhtEyiOHyQ Bm7meLhTcdpu1Bmd81aY/2f6NV/DOA+UUw3g2xczn216rhIVVNMwRjKjaz/CJMKV347v +AMgDTpLDVA8TkGpqfUbORA6/mE3A84I9/m/33+IDji5FoziEyJhicO/ntrWU+kXk+h9 s4Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XAdyN7hkQitH4LCcTCM77EYjX8uRUfV+Nlz/b1RI/90=; b=qmfuhCnIppeUMXT/ChmGZllGf8ELUP7FlP46XeNkiglyBHGebvZyC0v+AEFuDpWW4R gUM6YIdQ/CD3IpzN5fre0trnSiePDzifRXWV6euOVxnECo9G+7Az4RpeMiTAnuZlJSq3 +oo/mGgf29YMJCbJExixhAP0WiWsOtREeIkA6UATTFozXySGQ7NSYhETEIysFqTUgJ3g a1nOMZ15lHlB9kATyocuAOPOqLc0weV457402X1e8IXz5W8c9CeTxmS0LxT1oziI7O+M 2YI1S6in8LrZRjx0QTnvFUmlS3hxRH/PVLBWbwDf3f3nNIaQYNcx/WOWGOubNGu/UjIb DWZg== X-Gm-Message-State: AFqh2krzm+Y2E3trSf9rK3Cp6s4cxcmx0ndppDKuRumkPNUGA+AETt/V dk4NAqaWK19WXtB+ETPWuz6MG2Gv3XtD7RCWjQ0= X-Google-Smtp-Source: AMrXdXsf0nDgd00HdRxX0Gjn+M5uLFtaUhpW2hVaM7o20enJWYQS+Mk9eRTkq+Vn9TeMN7wzwN6TUA== X-Received: by 2002:a05:600c:4256:b0:3da:1d51:ef9e with SMTP id r22-20020a05600c425600b003da1d51ef9emr9713803wmm.17.1674125151678; Thu, 19 Jan 2023 02:45:51 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id be12-20020a05600c1e8c00b003db06224953sm5332029wmb.41.2023.01.19.02.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 02:45:51 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Thu, 19 Jan 2023 10:45:30 +0000 Message-Id: <20230119104544.9456-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 00/14] Raspberry Pi: Camera Module 3 support 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-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This series adds support for the Raspberry Pi Camera Module 3 (IMX708). A new hybrid PDAF/CDAF autofocus algorithm has been implemented to drive the autofocus mechanism available on this module. All libcamera focus related controls are now hanled by the IPA. Camera Module 3 is available either with an IR or without an IR (NoIR) filter, and a normal or wide angle lens. This makes a total of 4 possible variants. Detection of the variant is done through an OTP on the module, and signalled back to userland through changing the suffix on the device entity name. As such, we have 4 different tuning files and 4 duplicate instances of camera helpers and sensor properties entires. There is a single HDR sensor mode available in the sensor. Because of current limitations, this needs to be switched on/off externally before running libcamera: v4l2-ctl --set-ctrl wide_dynamic_range=[0|1] -d /dev/v4l-subdev0 in order for the CameraSensor class to cache the correct sensor mode. In our libcamera-apps, you can simply use the --hdr argument to switch this on. This is only a temporary measure, and we need to work on a more permanent solution by adding HDR pixel formats into V4L2. Thanks, Naush Naushir Patuck (7): pipeline: ipa: raspberrypi: Check if lens actuator is available pipeline: ipa: raspberrypi: Remove unused streamConfig pipeline: ipa: raspberrypi: Replace entityControls pipeline: ipa: raspberrypi: Validate lens controls ipa: raspberrypi: Reorder header file inclusion ipa: raspberrypi: Include autofocus controls in the IPA ControlInfoMap ipa: raspberrypi: Add lens position to DeviceStatus Nick Hollinghurst (7): ipa: mojom: raspberrypi: Add setLensControls() function ipa: raspberrypi: Add autofocus algorithm interface headers ipa: raspberrypi: Handle autofocus controls ipa: raspberrypi: Handle autofocus algorithm results ipa: raspberrypi: First version of autofocus algorithm using PDAF libcamera: camera_sensor: Add Sony IMX708 sensor properties ipa: raspberrypi: Add support for the Sony IMX708 sensor include/libcamera/ipa/raspberrypi.mojom | 10 +- src/ipa/raspberrypi/cam_helper_imx708.cpp | 350 ++++++++ src/ipa/raspberrypi/controller/af_algorithm.h | 76 ++ src/ipa/raspberrypi/controller/af_status.h | 35 + .../raspberrypi/controller/device_status.h | 4 +- src/ipa/raspberrypi/controller/pdaf_data.h | 21 + src/ipa/raspberrypi/controller/rpi/af.cpp | 755 ++++++++++++++++++ src/ipa/raspberrypi/controller/rpi/af.h | 153 ++++ src/ipa/raspberrypi/data/imx708.json | 559 +++++++++++++ src/ipa/raspberrypi/data/imx708_noir.json | 559 +++++++++++++ src/ipa/raspberrypi/data/imx708_wide.json | 462 +++++++++++ .../raspberrypi/data/imx708_wide_noir.json | 462 +++++++++++ src/ipa/raspberrypi/data/meson.build | 4 + src/ipa/raspberrypi/meson.build | 2 + src/ipa/raspberrypi/raspberrypi.cpp | 267 ++++++- src/libcamera/camera_sensor_properties.cpp | 16 + .../pipeline/raspberrypi/raspberrypi.cpp | 35 +- 17 files changed, 3729 insertions(+), 41 deletions(-) create mode 100644 src/ipa/raspberrypi/cam_helper_imx708.cpp create mode 100644 src/ipa/raspberrypi/controller/af_algorithm.h create mode 100644 src/ipa/raspberrypi/controller/af_status.h create mode 100644 src/ipa/raspberrypi/controller/pdaf_data.h create mode 100644 src/ipa/raspberrypi/controller/rpi/af.cpp create mode 100644 src/ipa/raspberrypi/controller/rpi/af.h create mode 100644 src/ipa/raspberrypi/data/imx708.json create mode 100644 src/ipa/raspberrypi/data/imx708_noir.json create mode 100644 src/ipa/raspberrypi/data/imx708_wide.json create mode 100644 src/ipa/raspberrypi/data/imx708_wide_noir.json