From patchwork Sat Jul 4 00:52:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 8613 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 B0382C2E69 for ; Sat, 4 Jul 2020 00:52:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 79E1C60DD7; Sat, 4 Jul 2020 02:52:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mMB/UJi3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 81B2A60DD5 for ; Sat, 4 Jul 2020 02:52:40 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 123BB29E; Sat, 4 Jul 2020 02:52:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593823960; bh=jY8vG4dyLHvHcEtgAxUiSJRn+TA/2dEmMNXPVbuI9lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mMB/UJi3EoX16I0wCqHBLo8o78GSYM802lxnHM1CH3Ho6enncOWLgnNetDyb3P19D gCmuXTTd5Q8GBJ/hGe61Ia6xf8gsAJ4f1hcLrsRlrG3/6Z+AgCO4HWfDJIf1uclqe5 NwpGASCI2EtKcmEZk0ixWBtf6F06U9WL4/OXFgZ0= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jul 2020 03:52:24 +0300 Message-Id: <20200704005227.21782-10-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200704005227.21782-1-laurent.pinchart@ideasonboard.com> References: <20200704005227.21782-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 09/12] ipa: raspberrypi: Drop CameraHelper::GetOrientation() 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" The camera sensor orientation is now handled by the pipeline handler. Drop hardcoded per-sensor orientations from the IPA. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Naushir Patuck --- src/ipa/raspberrypi/cam_helper.cpp | 6 ------ src/ipa/raspberrypi/cam_helper.hpp | 7 ------- src/ipa/raspberrypi/cam_helper_imx219.cpp | 7 ------- src/ipa/raspberrypi/cam_helper_imx477.cpp | 7 ------- src/ipa/raspberrypi/raspberrypi.cpp | 6 ------ 5 files changed, 33 deletions(-) diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index a0c73f99390f..b1343eb2cf4e 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -106,12 +106,6 @@ unsigned int CamHelper::MistrustFramesModeSwitch() const return 0; } -CamTransform CamHelper::GetOrientation() const -{ - /* Most sensors will be mounted the "right" way up? */ - return CamTransform_IDENTITY; -} - RegisterCamHelper::RegisterCamHelper(char const *cam_name, CamHelperCreateFunc create_func) { diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp index 6877f4735031..97ce3e92ac2f 100644 --- a/src/ipa/raspberrypi/cam_helper.hpp +++ b/src/ipa/raspberrypi/cam_helper.hpp @@ -58,12 +58,6 @@ namespace RPi { // (other than start-up), for which control algorithms should not run // (for example, metadata may be unreliable). -// Bitfield to represent the default orientation of the camera. -typedef int CamTransform; -static constexpr CamTransform CamTransform_IDENTITY = 0; -static constexpr CamTransform CamTransform_HFLIP = 1; -static constexpr CamTransform CamTransform_VFLIP = 2; - class CamHelper { public: @@ -82,7 +76,6 @@ public: virtual unsigned int HideFramesModeSwitch() const; virtual unsigned int MistrustFramesStartup() const; virtual unsigned int MistrustFramesModeSwitch() const; - virtual CamTransform GetOrientation() const; protected: MdParser *parser_; CameraMode mode_; diff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp index 35c6597c2016..1b9ce382f330 100644 --- a/src/ipa/raspberrypi/cam_helper_imx219.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp @@ -49,7 +49,6 @@ public: double Gain(uint32_t gain_code) const override; unsigned int MistrustFramesModeSwitch() const override; bool SensorEmbeddedDataPresent() const override; - CamTransform GetOrientation() const override; }; CamHelperImx219::CamHelperImx219() @@ -86,12 +85,6 @@ bool CamHelperImx219::SensorEmbeddedDataPresent() const return ENABLE_EMBEDDED_DATA; } -CamTransform CamHelperImx219::GetOrientation() const -{ - /* Camera is "upside down" on this board. */ - return CamTransform_HFLIP | CamTransform_VFLIP; -} - static CamHelper *Create() { return new CamHelperImx219(); diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp index 695444567bb2..a53b47c013cb 100644 --- a/src/ipa/raspberrypi/cam_helper_imx477.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp @@ -38,7 +38,6 @@ public: uint32_t GainCode(double gain) const override; double Gain(uint32_t gain_code) const override; bool SensorEmbeddedDataPresent() const override; - CamTransform GetOrientation() const override; }; CamHelperImx477::CamHelperImx477() @@ -61,12 +60,6 @@ bool CamHelperImx477::SensorEmbeddedDataPresent() const return true; } -CamTransform CamHelperImx477::GetOrientation() const -{ - /* Camera is "upside down" on this board. */ - return CamTransform_HFLIP | CamTransform_VFLIP; -} - static CamHelper *Create() { return new CamHelperImx477(); diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 860be22ddb5d..b40ca9e44776 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -215,7 +215,6 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo, int gainDelay, exposureDelay, sensorMetadata; helper_->GetDelays(exposureDelay, gainDelay); sensorMetadata = helper_->SensorEmbeddedDataPresent(); - RPi::CamTransform orientation = helper_->GetOrientation(); IPAOperationData op; op.operation = RPI_IPA_ACTION_SET_SENSOR_CONFIG; @@ -223,11 +222,6 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo, op.data.push_back(exposureDelay); op.data.push_back(sensorMetadata); - ControlList ctrls(unicam_ctrls_); - ctrls.set(V4L2_CID_HFLIP, (int32_t) !!(orientation & RPi::CamTransform_HFLIP)); - ctrls.set(V4L2_CID_VFLIP, (int32_t) !!(orientation & RPi::CamTransform_VFLIP)); - op.controls.push_back(ctrls); - queueFrameAction.emit(0, op); }