{"id":9897,"url":"https://patchwork.libcamera.org/api/1.1/patches/9897/?format=json","web_url":"https://patchwork.libcamera.org/patch/9897/","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":"<20201002090807.108859-1-naush@raspberrypi.com>","date":"2020-10-02T09:08:07","name":"[libcamera-devel] pipeline: raspberrypi: Sensor flips should be applied unconditionally","commit_ref":"0b427b8ecffdb24a5e133cf7d3b4d89fa4bad22f","pull_url":null,"state":"accepted","archived":false,"hash":"bd9fa6f340e862d0ac32415755d970c74ee993cb","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9897/mbox/","series":[{"id":1344,"url":"https://patchwork.libcamera.org/api/1.1/series/1344/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1344","date":"2020-10-02T09:08:07","name":"[libcamera-devel] pipeline: raspberrypi: Sensor flips should be applied unconditionally","version":1,"mbox":"https://patchwork.libcamera.org/series/1344/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9897/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9897/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 B3C74C3B5C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Oct 2020 09:08:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4132960BCD;\n\tFri,  2 Oct 2020 11:08:19 +0200 (CEST)","from mail-wm1-x342.google.com (mail-wm1-x342.google.com\n\t[IPv6:2a00:1450:4864:20::342])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E24126035D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Oct 2020 11:08:17 +0200 (CEST)","by mail-wm1-x342.google.com with SMTP id x23so864212wmi.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 02 Oct 2020 02:08:17 -0700 (PDT)","from naushir-VirtualBox.pitowers.org\n\t([2a00:1098:3142:14:a00:27ff:fe4d:f6a2])\n\tby smtp.gmail.com with ESMTPSA id\n\te18sm1017160wrx.50.2020.10.02.02.08.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 02 Oct 2020 02:08:16 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"MxM7/Avb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=ZKpwDg/hllWudocQHvHwGdfd8jWK4JO9+D0rJ+xTUZo=;\n\tb=MxM7/Avb8GCBXW43RkBRyWWV0/0Qrg6nE6nPm6nPSvl4G1q+9Ligpdu/s0xFcclhwI\n\tvMQyMui3dwswqloVgjeQDpQ3G82XUICfhrjgMzElWNAcs6d+DGhypnmHRqfdqUoVqsms\n\tZGthZWZtwaql95idtK/vNXD5EWRgKK7l4sSCPQBVYM0WfqwFHfImZBNZoIlRh6+4bNHL\n\toutBh1BPPVa1VKstpaoAu/auz6JZiZK9SBaKYwmzErGLT4makZkkXu5Duuoo7TOzFcBD\n\tIOSv8WXRq5n3hURNhpMVPuq4TO4epAe1hgtBeHIPFA/xdSkxrkxOMc6+VIEMGvJXbIvt\n\t0f9w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=ZKpwDg/hllWudocQHvHwGdfd8jWK4JO9+D0rJ+xTUZo=;\n\tb=V6UDbrrfIG7Jj3SG2CRVgBJd+wVHuNXe0+zOBqrVk5ag/SbSxe+jtXGC2FBZynInxd\n\tXXlFiYk1KXYaiOpVaT+GttwsWJvvmZrNzIlg6jHGYGNgbu6VNxDUtVphjGIXgVa/l6+k\n\tiRHEelh9eBeObYKbbk4siKNNvWPRshsAXLLntj9qAscPFRNhohZhL4Kk64MJDQ0+nJ9E\n\tqM+bNDxZ5v/RllqurClvPEVda6pbhXXzBn2WilW5fviF2URGoSx15vqn/h+hpamxQ6Jw\n\tvCcrQIiRnHrISot/rwsc4yeBrTQayVaNUGeHP4Rvd0qAYVaS9LP8BlGb7dAKl0KKwF3G\n\t4ikg==","X-Gm-Message-State":"AOAM531vNDPXqn8l2j5P7/vfJvnCcy/L5Yvk1lhRDFQ4NLNSvWClXX4m\n\tYHaWHv+EBjDvZZOX4jjicbEb2du6nOouCw==","X-Google-Smtp-Source":"ABdhPJyWF16GNnVYzbGk8BaP9//ybuq+haCdzbopCuiFt2kBH5lAhpa6TScciFKHzMkg1j4HN3MksA==","X-Received":"by 2002:a7b:c750:: with SMTP id w16mr1768809wmk.16.1601629697115;\n\tFri, 02 Oct 2020 02:08:17 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  2 Oct 2020 10:08:07 +0100","Message-Id":"<20201002090807.108859-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH] pipeline: raspberrypi: Sensor flips\n\tshould be applied unconditionally","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":"The code in pipeline_handler::start() that applies the flips were in a\nblock that was conditional on the RPi::IPA_CONFIG_STAGGERED_WRITE return\nresult. This should be applied unconditionally.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 26 +++++++++----------\n 1 file changed, 13 insertions(+), 13 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex d4d04c0d..1052bdce 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1172,19 +1172,6 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \t\t\t\t\t      { V4L2_CID_EXPOSURE, result.data[resultIdx++] } });\n \t\t\tsensorMetadata_ = result.data[resultIdx++];\n \t\t}\n-\n-\t\t/*\n-\t\t * Configure the H/V flip controls based on the combination of\n-\t\t * the sensor and user transform.\n-\t\t */\n-\t\tif (supportsFlips_) {\n-\t\t\tControlList ctrls(unicam_[Unicam::Image].dev()->controls());\n-\t\t\tctrls.set(V4L2_CID_HFLIP,\n-\t\t\t\t  static_cast<int32_t>(!!(rpiConfig->combinedTransform_ & Transform::HFlip)));\n-\t\t\tctrls.set(V4L2_CID_VFLIP,\n-\t\t\t\t  static_cast<int32_t>(!!(rpiConfig->combinedTransform_ & Transform::VFlip)));\n-\t\t\tunicam_[Unicam::Image].dev()->setControls(&ctrls);\n-\t\t}\n \t}\n \n \tif (result.operation & RPi::IPA_CONFIG_SENSOR) {\n@@ -1198,6 +1185,19 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \t\tdropFrameCount_ = result.data[resultIdx++];\n \t}\n \n+\t/*\n+\t * Configure the H/V flip controls based on the combination of\n+\t * the sensor and user transform.\n+\t */\n+\tif (supportsFlips_) {\n+\t\tControlList ctrls(unicam_[Unicam::Image].dev()->controls());\n+\t\tctrls.set(V4L2_CID_HFLIP,\n+\t\t\t  static_cast<int32_t>(!!(rpiConfig->combinedTransform_ & Transform::HFlip)));\n+\t\tctrls.set(V4L2_CID_VFLIP,\n+\t\t\t  static_cast<int32_t>(!!(rpiConfig->combinedTransform_ & Transform::VFlip)));\n+\t\tunicam_[Unicam::Image].dev()->setControls(&ctrls);\n+\t}\n+\n \treturn 0;\n }\n \n","prefixes":["libcamera-devel"]}