Patch Detail
Show a patch.
GET /api/patches/18565/?format=api
{ "id": 18565, "url": "https://patchwork.libcamera.org/api/patches/18565/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18565/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20230427105356.16869-1-robert.mader@collabora.com>", "date": "2023-04-27T10:53:56", "name": "[libcamera-devel] pipeline: simple: Validate transform", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d5e3868184362bacc802eae3434eb8bd4c5bc6a6", "submitter": { "id": 140, "url": "https://patchwork.libcamera.org/api/people/140/?format=api", "name": "Robert Mader", "email": "robert.mader@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18565/mbox/", "series": [ { "id": 3851, "url": "https://patchwork.libcamera.org/api/series/3851/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3851", "date": "2023-04-27T10:53:56", "name": "[libcamera-devel] pipeline: simple: Validate transform", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3851/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18565/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18565/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 9E84DC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Apr 2023 10:54:52 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 091E2627DF;\n\tThu, 27 Apr 2023 12:54:52 +0200 (CEST)", "from madras.collabora.co.uk (madras.collabora.co.uk\n\t[46.235.227.172])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B7CA627B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Apr 2023 12:54:50 +0200 (CEST)", "from thinkpad-t460p.mediaserver.passengera.com\n\t(85-160-31-131.reb.o2.cz [85.160.31.131])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: rmader)\n\tby madras.collabora.co.uk (Postfix) with ESMTPSA id B1E356603219;\n\tThu, 27 Apr 2023 11:54:49 +0100 (BST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1682592892;\n\tbh=QxC1WfZVHysTuVGJJeqcIy9RkceIs8w+Dowxs906M4A=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=t9QOxFizGFgsXOwBtThoMkUAf7cYiQQYbqszkRdGQCs62sm/z3aIW9CS92FT9pzqA\n\tzABFpvwzd2tb83gojR37Ey3ynMIaDvSBdUNwpYUGeikYsivfzF/Q/PFq1AmGmN6ZK3\n\tETSsL7F/+QDJO9T5QND8PJ2DUECcW2A9C7yG/+Ssjv/tSvUoadLbtXnVDanpciKhrt\n\trdztrAPpOpJAM88ym48GJdU3sxrifLo790Z8Qa39CoxPYzRtNF7qHGtx/e85VQV46z\n\tGUolh7lU+pDVfnJDvoQtFEo8ieHuVNjdtx6HQ6O/Fj0Qako9StlivehdQwpsOFxKqq\n\t85/iF6LWrqnOw==", "v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1682592890;\n\tbh=QxC1WfZVHysTuVGJJeqcIy9RkceIs8w+Dowxs906M4A=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=kwuYD6UC2qdXkbQPgfmx4f5cbo7YN+FWhOpjKeRArpJbP+ShQiJ4nMTGyw3mOFRbd\n\tvpW7Epq5MpxZe12D8xfAYCpsJ+ZupLSfLwzDJPftm9s0W895BnEuHIJ6HbrvGBWWAq\n\tp2Y0jgjuIHrruLIX2uB35nfZdESP1gjAq2+PBE85vciBkk/GayFs1KR4UgTWkKEcnQ\n\tCkWQl6x+j+YTB2oQWwg/3thHNZwK2Wt5gHSwY7g7VR7HTMy9lucxEeNgFu7hcDfz7w\n\tuZRnyODZC5b2mC86BMTOAvqyD5lfQvqAb0ySdVTEhSS7627Q+0zjYgQMnLl864RoTv\n\tcP3sW/aKSjwyg==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=collabora.com\n\theader.i=@collabora.com\n\theader.b=\"kwuYD6UC\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 27 Apr 2023 12:53:56 +0200", "Message-Id": "<20230427105356.16869-1-robert.mader@collabora.com>", "X-Mailer": "git-send-email 2.40.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] pipeline: simple: Validate transform", "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>", "From": "Robert Mader via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Robert Mader <robert.mader@collabora.com>", "Cc": "Robert Mader <robert.mader@collabora.com>, Arnav Singh <me@arnavion.dev>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Just like we do for other pipeline handlers already.\nThis ensures we corretly pass on transforms that are not handled by the\nsensor - e.g. rotations - back to the app via the config, which is\nrequired on devices like the Pinephone.\n\nSigned-off-by: Robert Mader <robert.mader@collabora.com>\nTested-by: Arnav Singh <me@arnavion.dev>\n---\n src/libcamera/pipeline/simple/simple.cpp | 21 ++++++++++++++-------\n 1 file changed, 14 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 2423ec10..abfb4c87 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -211,7 +211,8 @@ public:\n \tint init();\n \tint setupLinks();\n \tint setupFormats(V4L2SubdeviceFormat *format,\n-\t\t\t V4L2Subdevice::Whence whence);\n+\t\t\t V4L2Subdevice::Whence whence,\n+\t\t\t Transform transform = Transform::Identity);\n \tvoid bufferReady(FrameBuffer *buffer);\n \n \tunsigned int streamIndex(const Stream *stream) const\n@@ -292,6 +293,7 @@ public:\n \t}\n \n \tbool needConversion() const { return needConversion_; }\n+\tconst Transform &combinedTransform() { return combinedTransform_; }\n \n private:\n \t/*\n@@ -304,6 +306,7 @@ private:\n \n \tconst SimpleCameraData::Configuration *pipeConfig_;\n \tbool needConversion_;\n+\tTransform combinedTransform_;\n };\n \n class SimplePipelineHandler : public PipelineHandler\n@@ -664,7 +667,8 @@ int SimpleCameraData::setupLinks()\n }\n \n int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n-\t\t\t\t V4L2Subdevice::Whence whence)\n+\t\t\t\t V4L2Subdevice::Whence whence,\n+\t\t\t\t Transform transform)\n {\n \tSimplePipelineHandler *pipe = SimpleCameraData::pipe();\n \tint ret;\n@@ -673,7 +677,7 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n \t * Configure the format on the sensor output and propagate it through\n \t * the pipeline.\n \t */\n-\tret = sensor_->setFormat(format);\n+\tret = sensor_->setFormat(format, transform);\n \tif (ret < 0)\n \t\treturn ret;\n \n@@ -877,15 +881,16 @@ SimpleCameraConfiguration::SimpleCameraConfiguration(Camera *camera,\n \n CameraConfiguration::Status SimpleCameraConfiguration::validate()\n {\n+\tconst CameraSensor *sensor = data_->sensor_.get();\n \tStatus status = Valid;\n \n \tif (config_.empty())\n \t\treturn Invalid;\n \n-\tif (transform != Transform::Identity) {\n-\t\ttransform = Transform::Identity;\n+\tTransform requestedTransform = transform;\n+\tcombinedTransform_ = sensor->validateTransform(&transform);\n+\tif (transform != requestedTransform)\n \t\tstatus = Adjusted;\n-\t}\n \n \t/* Cap the number of entries to the available streams. */\n \tif (config_.size() > data_->streams_.size()) {\n@@ -1116,7 +1121,9 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \tformat.mbus_code = pipeConfig->code;\n \tformat.size = pipeConfig->sensorSize;\n \n-\tret = data->setupFormats(&format, V4L2Subdevice::ActiveFormat);\n+\tret = data->setupFormats(&format,\n+\t\t\t\t V4L2Subdevice::ActiveFormat,\n+\t\t\t\t config->combinedTransform());\n \tif (ret < 0)\n \t\treturn ret;\n \n", "prefixes": [ "libcamera-devel" ] }