From patchwork Sat Jan 14 19:47:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18115 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 0602CC3294 for ; Sat, 14 Jan 2023 19:47:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3A15A625DD; Sat, 14 Jan 2023 20:47:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1673725650; bh=BKsSbLfnR3Agv3+/w4J99xXG8aa2GLCFMdmlQ3kkPOo=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=T/PfXCuUYuAjuSh4+rhKvQH8xUqT+toaz01776RZqVW0PoOJd37HefmCy4YksvjTE LTZXS79LOyMXXkNHvSSIU5bPymEW6wil2axSJoeppepORNpkSG6Om1mnnmBULxkZRm ItID4zaijj3LciJat6ZQT28GPoK2do/gjN9ifQTVJvOxYWglYmoPf3oN4iPDMeN9FI pvMph9gxrMJZLGAFl4a3FUDezu3C4odxFdihRu2nJuHEtrgfxYp9hu2oIEUvDcRnoZ VR1Cd3qIjfVNdPhzbqdZZzhMOXiRxdewh+2R2WHi6aoSfbSAhJEL2cDOYEQDbCuL/3 xI4NrXXew3l8g== 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 86C9D625DD for ; Sat, 14 Jan 2023 20:47:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cjt5Lnq7"; 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 EE35C4D4; Sat, 14 Jan 2023 20:47:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1673725646; bh=BKsSbLfnR3Agv3+/w4J99xXG8aa2GLCFMdmlQ3kkPOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjt5Lnq7+ltt1q+Io1Nj5GIYkeQ493K7qry/DZkBM2kVgxgkd9mXsqvuA90u/DoR1 Of8PrQnKVUmN18VBdL5+enIi1rqeLT7Jr3o2n4LFTDq8vEFcZrg7x9hW0O91wuxUDa yFG/C+/B+7eCYumRI1CrDT3qKexnZbNkRb6D37vo= To: libcamera-devel@lists.libcamera.org Date: Sat, 14 Jan 2023 20:47:11 +0100 Message-Id: <20230114194712.23272-5-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230114194712.23272-1-jacopo.mondi@ideasonboard.com> References: <20230114194712.23272-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/5] libcamera: rkisp1: Add support for Transform 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" Add support for Transform to the RkISP1 pipeline handler. The pipeline rotates using the sensor's V/H flips, hence use the CameraSensor helpers to handle transformation requests from applications. Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index c27b3ef9bd8e..b81ad647be79 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -23,6 +23,10 @@ #include #include #include +#include +#include +#include + #include #include #include @@ -469,17 +473,17 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate() status = validateColorSpaces(ColorSpaceFlag::StreamsShareColorSpace); - if (transform != Transform::Identity) { - transform = Transform::Identity; - status = Adjusted; - } - /* Cap the number of entries to the available streams. */ if (config_.size() > pathCount) { config_.resize(pathCount); status = Adjusted; } + Transform requestedTransform = transform; + Transform combined = sensor->validateTransform(&transform); + if (transform != requestedTransform) + status = Adjusted; + /* * Simultaneous capture of raw and processed streams isn't possible. If * there is any raw stream, cap the number of streams to one. @@ -589,6 +593,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate() if (sensorFormat_.size.isNull()) sensorFormat_.size = sensor->resolution(); + sensorFormat_.transform = combined; + return status; }