From patchwork Fri Nov 6 15:49:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10387 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 46D30BDB89 for ; Fri, 6 Nov 2020 15:49:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5FF6962D30; Fri, 6 Nov 2020 16:49:54 +0100 (CET) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AAF65622AA for ; Fri, 6 Nov 2020 16:49:52 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 5AEB84000A for ; Fri, 6 Nov 2020 15:49:52 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Nov 2020 16:49:43 +0100 Message-Id: <20201106154947.261132-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/4] libcamera: Collect pixel array 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This has been floating around for quite some time never really got to the bottom of it as it required to make V4L2, libcamera and android properties get along with each other. To summarize my understanding: V4L2: - NATIVE: size of the pixel array matrix (readable and not readable) - BOUNDS: readable pixels (valid and non valid); defined in respect to NATIVE - CROP_DEFAULT: active pixels; defined in respect to NATIVE Libcamera: - PixelArraySize: Size of the readable area - PixelArrayActiveAreas: Active areas, defined in respect to PixelArray PixelArraySize = { BOUNDS.width, BOUNDS.heigh } PixelArrayActiveAreas = { CROP_DEFAULT.x - BOUNDS.x, CROP_DEFAULT.y - BOUNDS.y, CROP_DEFAULT.width, CROP_DEFAULT.height } When it comes to map to Android : android.sensor.info.pixelArraySize = "Dimensions of the full pixel array, possibly including black calibration pixels" android.sensor.info.activeArraySize = "The area of the image sensor which corresponds to active pixels after any geometric distortion correction has been applied." -> defined in respect to pixelArarySize pixelArraySize = libcamera::properties::PixelArraySize activeAreasSize = libcamera::properties::PixelArrayActiveAreas The first patch on the series adjusts the CameraSensorInfo analog rectangle to match the V4L2 target definitions, and requires the mainline imx219 driver to be fixed accordingly, and the in-work ov5647 to complete upstreaming. As CameraSensorInfo is used by the RaspberryPi IPA, downstream kernel drivers should be fixed as well. Currently the sensor drivers for the Soraka device do not support G_SELECTION so no properties are registered in Android for CrOS on Soraka. All in all, take this series with a grain of salt, as it will break a few things if merged :) Thanks j Jacopo Mondi (4): libcamera: camera_sensor: Adjust CameraSensorInfo::analogCrop libcamera: camera_sensor: Break out properties initialization libcamera: camera_sensor: Initialize PixelArray properties android: camera_device: Initialize pixel array properties include/libcamera/internal/camera_sensor.h | 1 + src/android/camera_device.cpp | 38 +++++--- src/libcamera/camera_sensor.cpp | 102 ++++++++++++++------- 3 files changed, 99 insertions(+), 42 deletions(-) --- 2.29.1