From patchwork Tue Jul 21 09:23:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 8902 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 693EBC0109 for ; Tue, 21 Jul 2020 09:23:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F381B60554; Tue, 21 Jul 2020 11:23:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="SuVMnVwK"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 00C2F60554 for ; Tue, 21 Jul 2020 11:23:13 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id y3so3111754wrl.4 for ; Tue, 21 Jul 2020 02:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=p2wlddraVn76v/Wg72ysvhuN3i4GO4rEQJQDS25MEqw=; b=SuVMnVwKRAFH0sFoVAapNQ+yvZgEfjHzWo7izkMMT1/zBQGMNdhgMRp5a2ly6pKxqO wekA8/DrQFix5NxZjj5ht3VxKcbJxowLPOGYDkJ1TKreQc6gBV7OCYy1n3SZJZpIxTb6 aa+nnigYeikPfdS8VTn1FoUWNbCO9CIdozwWeTKHEk5CRteSP3kmHvJcZl27HB1m7ibw BqpJY1aupBQLEOSo8PRTMAPL8nNaGPV57vQzsGK1fXktiP7is+R1sSMOI/O8V+MPFmzD H1f/ja2279P81kF/4YsfWYgnZkmyFC1faP0WhZ9dBIFepPkP1Yvwcekm14PoQ4x1ZS8e swrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=p2wlddraVn76v/Wg72ysvhuN3i4GO4rEQJQDS25MEqw=; b=SWx3M3d5Dd+ziFk08MZAeLncOdqDx2YS0TI0UZyi6+GMHhWV68oBkZnSJYyZkYU7Mq uwRn75Ubzl9Y5fiaVNRNeEUesEtom4njI2UAibRjQQR2VRD0rG8uX2k5sMh8F0Cc8hMX uYmcxpov6tVQ3Z4Z+r4e4DDdQR1e96LDjJFoh6BjqFjmyaEnULy6lb3ZoHrmi/45N39W fPD6jFH16mboCsulNsWfiQ4IWT64wuv3WnvMCnHlrxlP9pJchzI7G8b4eFvCicxdf2Ow GWiSfUwSxEDjg1QVOczuKR2iM7JqaFKlhYbn2YpG6TFBXRQp5TnexuLigjwJViULtgPs KxUw== X-Gm-Message-State: AOAM531Og6V7mcdUYkUMU9n9eBLvo987N59JDSwOP/nywqmUyDlfedHM vlR9XE7plw77TAcVFrNkGvRZe8cfQl5rfg== X-Google-Smtp-Source: ABdhPJwZfue/Zfyq74KLMFIJ7WnfBye31Ib4CaZMd2vfQzCMTsOArqhvZnh1JlJWKZ+wLDvttPATbQ== X-Received: by 2002:adf:f8cb:: with SMTP id f11mr27351138wrq.358.1595323393340; Tue, 21 Jul 2020 02:23:13 -0700 (PDT) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id d10sm36178845wrx.66.2020.07.21.02.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 02:23:12 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 21 Jul 2020 10:23:06 +0100 Message-Id: <20200721092306.823447-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: raspberrypi: Set sensor default orientation before configure() 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 default sensor orientation must be set early on in match() to ensure generateConfiguration() and configure() return out the correct Bayer ordering to the application. This is particularly important for RAW capture streams. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Tested-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index bf1c7714..e9084afd 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -962,6 +962,13 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator) /* Initialize the camera properties. */ data->properties_ = data->sensor_->properties(); + /* Configure the H/V flip controls based on the sensor rotation. */ + ControlList ctrls(data->unicam_[Unicam::Image].dev()->controls()); + int32_t rotation = data->properties_.get(properties::Rotation); + ctrls.set(V4L2_CID_HFLIP, static_cast(!!rotation)); + ctrls.set(V4L2_CID_VFLIP, static_cast(!!rotation)); + data->unicam_[Unicam::Image].dev()->setControls(&ctrls); + /* * List the available output streams. * Currently cannot do Unicam streams! @@ -1165,13 +1172,6 @@ int RPiCameraData::configureIPA() { V4L2_CID_EXPOSURE, result.data[1] } }); sensorMetadata_ = result.data[2]; } - - /* Configure the H/V flip controls based on the sensor rotation. */ - ControlList ctrls(unicam_[Unicam::Image].dev()->controls()); - int32_t rotation = sensor_->properties().get(properties::Rotation); - ctrls.set(V4L2_CID_HFLIP, static_cast(!!rotation)); - ctrls.set(V4L2_CID_VFLIP, static_cast(!!rotation)); - unicam_[Unicam::Image].dev()->setControls(&ctrls); } if (result.operation & RPI_IPA_CONFIG_SENSOR) {