From patchwork Thu Jun 9 06:03:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 16184 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 3FC5CBD160 for ; Thu, 9 Jun 2022 06:03:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 624C065634; Thu, 9 Jun 2022 08:03:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654754595; bh=grtJKgB7YUDWa8GAG7j5tvkD+K/siOHqSX3PoHHe1qY=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=SHKGfIljnxsyoyRtJ++PPoO+eocKCDU6Qp9l+JSKNmXQqklgEiWMh+r9a1+DOlAYH AaKUp4jEVU/U4bM08tjppB3Zp9zqtqJxJoCpho5CHfkWpuGdOTWRPtcr4oRASotkZb zaDirWjUbaHxL3A2qtTXjiv06D2sfZjXQFpFcOVDaFdlZLiVsShvK0oXke00YgetiV jQczbSfwFdu7vb6c5qhe6tDmAis/9ekEUmSyZu4Cb1byzm2V4zaKDwnHVRLJEQsX0c mktOkI7tfXmHkJa33CTkO7kEp/CmJJv4/ymg5m7SeWL3YGWQreP7D5eEdu4QT3r4i0 Ifpstuufnn5rw== 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 4556F601F0 for ; Thu, 9 Jun 2022 08:03:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rzPAOUuz"; dkim-atps=neutral Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:ae94:9dc3:50ea:aee6]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DDDF66CF; Thu, 9 Jun 2022 08:03:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654754592; bh=grtJKgB7YUDWa8GAG7j5tvkD+K/siOHqSX3PoHHe1qY=; h=From:To:Cc:Subject:Date:From; b=rzPAOUuz9AOisWG2zDipqwMWmCQfVkMvNYY5TYyFIBWSSZbzkiQR0v8ozocueOXuw vyvGftX4LfYPkVhQa9Ji03KL5WLp3ml4xU/ToxBtvQIiQ1TRehZSr/hzJhZWZc2pD2 cCIn1ag6eRkhQCkhlUGerDyZB2zTgP1/Z9jWKlFQ= To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Jun 2022 08:03:02 +0200 Message-Id: <20220609060306.57953-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 0/4] Introduce camera lens properties 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: Jean-Michel Hautbois via libcamera-devel From: Jean-Michel Hautbois Reply-To: Jean-Michel Hautbois Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series introduces a camera lens properties database in the same way we have a camera sensor properties one. The idea is to be able to provide to the pipeline handler (and thus, the IPAs) any useful property defining a tuned lens. This series is a RFC as it is not really clear, for instance, which properties may be useful (a macroRange and a FullRange sound like something useful for instance ?) and which units should be used for hyperfocale. I don't have a tuned sensor (and indeed, I really wish I could have a way to tune it properly :-)) so the values here must be used as examples only. Patch 3/4 is a specific property, in order to address one of the AfControls series "todo". Currently, we may use a range as large as the one reported by the V4L2_CID_FOCUS_ABSOLUTE call, but all may not be valid. For instance, some drivers can set 10 bits values, but only the first 9 are relevant, as the macro mode is limited by the lens properties. We may want to have multiple ranges in a near future (macro, full, limited ?) and for the ease the range is returned as a libcamera::Size object, as I don't really know what would be better yet ;-). Patch 4/4 is the hyperfocale value, expressed in millimeters. Is it the correct unit is a question too :-). Thanks ! JM Jean-Michel Hautbois (4): libcamera: Add a camera lens properties database libcamera: lens: Grab the static properties at init time libcamera: lens: Add a helper to get the fixed range lens values libcamera: lens: Add the hyperfocale property support include/libcamera/internal/camera_lens.h | 5 ++ .../internal/camera_lens_properties.h | 25 +++++++ src/libcamera/camera_lens.cpp | 24 ++++++- src/libcamera/camera_lens_properties.cpp | 70 +++++++++++++++++++ src/libcamera/meson.build | 1 + 5 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 include/libcamera/internal/camera_lens_properties.h create mode 100644 src/libcamera/camera_lens_properties.cpp