From patchwork Thu Nov 24 12:12:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 17894 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 885BABDE6B for ; Thu, 24 Nov 2022 12:12:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 45F1863325; Thu, 24 Nov 2022 13:12:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669291957; bh=UGOOsJM9Ac1SccGfvBu28Xir5AaMsbXHKUYraf86zNY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ChfrGvrQzxYCiaSstYQJksiFXBn52m3VC6isYfhLrztB6V1RNoZWAagzflTavUVi0 kV5KLj08kAD+JaWUs6FAcDWvH47Xe2s1WEq6EU8k1ANx+/piiJWDTg+CZqoNuGtb8A u1RHKlicTAsJL12K+k76YaJOWk4i6hDVPYh8gTDFjDfMkgEkIBqwRUCzCF91xYK6GE 2O2KCZ5j7csGrVNTGOH21nm8qZgXx6URWn12c7I6zWyJd1K7WDFXLYtuy2f7E2I6hH xWW1CozK55ZMlQssg0H23IJMHJ74JoYiGTrz7EhSiladQ8HcLWAmp5A28jteRToeR4 4mwa8awa4nrZw== Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AD8AF63327 for ; Thu, 24 Nov 2022 13:12:34 +0100 (CET) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id D701E4000C; Thu, 24 Nov 2022 12:12:33 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Nov 2022 13:12:19 +0100 Message-Id: <20221124121220.47000-9-jacopo@jmondi.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221124121220.47000-1-jacopo@jmondi.org> References: <20221124121220.47000-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 8/9] 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 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 --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 14741e73e050..41afc98ae2b2 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -430,17 +431,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; + /* * If there are more than one stream in the configuration figure out the * order to evaluate the streams. The first stream has the highest @@ -529,6 +530,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate() if (sensorFormat_.size.isNull()) sensorFormat_.size = sensor->resolution(); + sensorFormat_.transform = combined; + return status; }