Patch Detail
Show a patch.
GET /api/patches/23777/?format=api
{ "id": 23777, "url": "https://patchwork.libcamera.org/api/patches/23777/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23777/", "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": "<20250709134229.135949-2-uajain@igalia.com>", "date": "2025-07-09T13:42:28", "name": "[1/2] libcamera: simple: Detect Bayer pattern change during configure()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "dae51790a3a62e6975ce5289d0bd929f5873d01b", "submitter": { "id": 232, "url": "https://patchwork.libcamera.org/api/people/232/?format=api", "name": "Umang Jain", "email": "uajain@igalia.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/23777/mbox/", "series": [ { "id": 5279, "url": "https://patchwork.libcamera.org/api/series/5279/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5279", "date": "2025-07-09T13:42:27", "name": "libcamera: simple: Enable RPi's unicam+SoftISP", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5279/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23777/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23777/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 A8313C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 9 Jul 2025 13:42:36 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BB40A68EF0;\n\tWed, 9 Jul 2025 15:42:35 +0200 (CEST)", "from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AA47E68EE6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 9 Jul 2025 15:42:33 +0200 (CEST)", "from [49.36.71.19] (helo=uajain) by fanzine2.igalia.com with\n\tesmtpsa \n\t(Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uZV4C-00EUOy-HK; Wed, 09 Jul 2025 15:42:33 +0200" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"lXuRiVdW\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=GP02ZgzYBE2h2EZSxYTzFWAa8vs7oQblL4ui9wHK5+0=;\n\tb=lXuRiVdWU7CRsknhkmzN8FhEkl\n\t5HFbiHkGumDGNGTqkIy+AKXIB3Lvp0KRpyXk/RGeGft+JuXf8D7x6EkDRUP9zBATRvBJBZK4+LB+H\n\t1v3w31zCnbClr8TjMz3CNO1L2qaZGZJvbYqv2f+pZYLbs5jEzmtCWzrQLsCh6/CEUwN8wojRpnFgf\n\txSMLTBJcO6iRC+QPaIGWXS0j5UBqMJ7Wjz7viBq8XgWQ5zsybuvlR6L2XC7VKErwIK7TtPKT/dlqf\n\tqZXhOb/u287haiG7qYH/I8MlNzApBjmHjatMQcT2iwYx8ty8GTPDqhI470ovBV08dW+28PR0o93qu\n\t1qIvalKA==;", "From": "Umang Jain <uajain@igalia.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Umang Jain <uajain@igalia.com>", "Subject": "[PATCH 1/2] libcamera: simple: Detect Bayer pattern change during\n\tconfigure()", "Date": "Wed, 9 Jul 2025 19:12:28 +0530", "Message-ID": "<20250709134229.135949-2-uajain@igalia.com>", "X-Mailer": "git-send-email 2.50.0", "In-Reply-To": "<20250709134229.135949-1-uajain@igalia.com>", "References": "<20250709134229.135949-1-uajain@igalia.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Bayer pattern on the sensor can change while configuring it with the\nintended capture format. This is due to the transform being applied on\nthe sensor which supports [v/h]flips.\n\nDuring configure(), the simple pipeline handler does not detect any\nbayer pattern changes that can arise due to the transformations being\napplied via SimpleCameraData:setupFormats(). In such cases, the video\nnode will be configured in-correctly, without realising the bayer\npattern has changed on the sensor, for the given capture format.\n\nThis patch detects the bayer pattern change after the sensor has\nbeen configured and retrieves the corresponding V4L2 pixel format\nto correctly configure the video node.\n\nSigned-off-by: Umang Jain <uajain@igalia.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 16 ++++++++++++++--\n 1 file changed, 14 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex efb07051..e2a48724 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -1353,8 +1353,20 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \tif (ret < 0)\n \t\treturn ret;\n \n-\t/* Configure the video node. */\n-\tV4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n+\t/* Configure the video node, taking into account any Bayer pattern change. */\n+\tV4L2PixelFormat videoFormat;\n+\tif (format.code == pipeConfig->code) {\n+\t\tvideoFormat = video->toV4L2PixelFormat(pipeConfig->captureFormat);\n+\t} else {\n+\t\t/*\n+\t\t * Bayer pattern has changed because of the transform that was applied on\n+\t\t * the sensor. Get the V4L2PixelFormat corresponding to the configured Bayer\n+\t\t * pattern.\n+\t\t */\n+\t\tBayerFormat cfgBayer = BayerFormat::fromPixelFormat(pipeConfig->captureFormat);\n+\t\tcfgBayer.order = data->sensor_->bayerOrder(config->combinedTransform());\n+\t\tvideoFormat = cfgBayer.toV4L2PixelFormat();\n+\t}\n \n \tV4L2DeviceFormat captureFormat;\n \tcaptureFormat.fourcc = videoFormat;\n", "prefixes": [ "1/2" ] }