{"id":8612,"url":"https://patchwork.libcamera.org/api/1.1/patches/8612/?format=json","web_url":"https://patchwork.libcamera.org/patch/8612/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200704005227.21782-9-laurent.pinchart@ideasonboard.com>","date":"2020-07-04T00:52:23","name":"[libcamera-devel,v2,08/12] libcamera: pipeline: raspberrypi: Set sensor flip based on rotation","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"2a24328491e612deafab4c3127f145ce6c462764","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8612/mbox/","series":[{"id":1081,"url":"https://patchwork.libcamera.org/api/1.1/series/1081/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1081","date":"2020-07-04T00:52:15","name":"Support passing custom data to IPA configure()","version":2,"mbox":"https://patchwork.libcamera.org/series/1081/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8612/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8612/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 53EABBE905\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  4 Jul 2020 00:52:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0650E60DC9;\n\tSat,  4 Jul 2020 02:52:44 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 260B660DD5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Jul 2020 02:52:40 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A03B551B;\n\tSat,  4 Jul 2020 02:52:39 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Kws3mbSC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593823959;\n\tbh=tZYYYN9GGqLxNhRtKTABpQS2zLJTgxUqy6Y4dv2qgyw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Kws3mbSC3Jfi6SrNyEot8+KJHMI1KRnJNwYzIMGOKIsj+QSdaxeADZtn45S1yCgtV\n\tTRhgWaioS16bnDKExKI7acU52jDkHjUTA5Kl11Qs+Ztrr4ksE118UInG8p/Cegv10A\n\tD1v96jlyT6450zhqLIhdw4zrr0KEraEXP8jBkEBw=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat,  4 Jul 2020 03:52:23 +0300","Message-Id":"<20200704005227.21782-9-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 08/12] libcamera: pipeline:\n\traspberrypi: Set sensor flip based on rotation","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Instead of receiving sensor orientation configuration from the IPA,\nretrieve it from the CameraSensor Rotation property, and configure the\nHFLIP and VFLIP controls accordingly.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 74bee6895dcd..fda6831e6a7e 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -16,6 +16,7 @@\n #include <libcamera/formats.h>\n #include <libcamera/ipa/raspberrypi.h>\n #include <libcamera/logging.h>\n+#include <libcamera/property_ids.h>\n #include <libcamera/request.h>\n #include <libcamera/stream.h>\n \n@@ -1174,6 +1175,13 @@ int RPiCameraData::configureIPA()\n \tipa_->configure(sensorInfo, streamConfig, entityControls, ipaConfig,\n \t\t\tnullptr);\n \n+\t/* Configure the H/V flip controls based on the sensor rotation. */\n+\tControlList ctrls(unicam_[Unicam::Image].dev()->controls());\n+\tint32_t rotation = sensor_->properties().get(properties::Rotation);\n+\tctrls.set(V4L2_CID_HFLIP, static_cast<int32_t>(!!rotation));\n+\tctrls.set(V4L2_CID_VFLIP, static_cast<int32_t>(!!rotation));\n+\tunicam_[Unicam::Image].dev()->setControls(&ctrls);\n+\n \treturn 0;\n }\n \n@@ -1202,10 +1210,6 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData\n \t\t\t\t\t      { V4L2_CID_EXPOSURE, action.data[1] } });\n \t\t\tsensorMetadata_ = action.data[2];\n \t\t}\n-\n-\t\t/* Set the sensor orientation here as well. */\n-\t\tControlList controls = action.controls[0];\n-\t\tunicam_[Unicam::Image].dev()->setControls(&controls);\n \t\treturn;\n \t}\n \n","prefixes":["libcamera-devel","v2","08/12"]}