From patchwork Sat Jan 14 19:47:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18111 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 C6939C3240 for ; Sat, 14 Jan 2023 19:47:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CE517625ED; Sat, 14 Jan 2023 20:47:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1673725646; bh=GU3R3jauzVZ5xdq3G0R5rx6X72Z/CzVZMHD+2HMEzls=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=wlY44gXEnW5UfugjX8qMotsEvPEF5oOWgeYHn0itqwoazfGp4/f/4zqCruY9bYXhi O2riqTviSGu+jFbZ+jKy0m6g6pWZSNr7kMGDzAbQqXc2nXWEMP80R85Sc2azCBI7e3 Umkg2MM6bkEBTR3sg2hA7Un650/Pn02znVVegksUhg1rymtQcZxGjeprYo6wetWkS/ ka6RiEF00pmFUqohwf8JPhhTtSztk0mX56gWWy/2+rlDW56zIt+EDsPTffH8Vn1vx2 x8CCs36YG0e/JxYFjdIvczoVGL9muLcxD4a9dhu7q/aXhs7Na2AX6Z1XHfc0Aovmkm 7x12pE+/xWN+Q== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4AD8C625D0 for ; Sat, 14 Jan 2023 20:47:24 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Y93uRU+g"; dkim-atps=neutral Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 61AB44D4; Sat, 14 Jan 2023 20:47:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1673725643; bh=GU3R3jauzVZ5xdq3G0R5rx6X72Z/CzVZMHD+2HMEzls=; h=From:To:Cc:Subject:Date:From; b=Y93uRU+gp4JsHw2Nv6SQtEo5ebS2a3uhxoasyBDF5a/ViELQtZbzqWnc4CuZHl+Ua 0PwviL1mVWFgINsbgx/vjmQ2pX8FgcesPMMPseGhGOK/P858UWeMMC0qQtvZlkMbFP NcZMa8eDxJxNNW7kEl2SOLxhxYp0qaYDrToX/M+0= To: libcamera-devel@lists.libcamera.org Date: Sat, 14 Jan 2023 20:47:07 +0100 Message-Id: <20230114194712.23272-1-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/5] libcamera: camera_sensor: Centralize flips handling 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: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" As the previous series [PATCH 0/9] libcamera: camera_sensor: Centralize flips handling as still some pending issue on the semantic of the rotation handling, I decided to centralize the sensor's flips handling, so whatever decision is made, it will have to be implemented in one place only (at least initially). As a bonus point (which is where I actually started from) add support for Transform to the RkISP1 pipeline handler. An extrac from the previous cover letter The CameraSensor class is extended with: 1) Validate Transform: The same logic as implemented in the IPU3/RPi PH is moved in the CameraSensor class. 2) Apply flips at CameraSensor::setFormat() time Before applying a format, flips are operated according to the requested Transform. Applying flips before setting a format is crucial to obtain an up to data Bayer pattern order. In order to simplify setting a Transform on the camera sensor, a new "transform" member is added to V4L2SubdeviceFormat. No functional changes intended for the RPi and the IPU3 pipeline handlers. Jacopo Mondi (5): libcamera: camera_sensor: Verify flips support libcamera: camera_sensor: Validate Transform libcamera: camera_sensor: Apply flips at setFormat() libcamera: rkisp1: Add support for Transform documentation: sensor_drivers: Document H/V flip Documentation/sensor_driver_requirements.rst | 12 ++ include/libcamera/internal/camera_sensor.h | 5 + include/libcamera/internal/v4l2_subdevice.h | 2 + src/libcamera/camera_sensor.cpp | 106 +++++++++++++++++- src/libcamera/pipeline/ipu3/cio2.cpp | 6 +- src/libcamera/pipeline/ipu3/cio2.h | 4 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 73 ++---------- .../pipeline/raspberrypi/raspberrypi.cpp | 86 +++----------- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 16 ++- src/libcamera/v4l2_subdevice.cpp | 7 ++ 10 files changed, 172 insertions(+), 145 deletions(-) --- 2.39.0