Patch Detail
Show a patch.
GET /api/patches/23824/?format=api
{ "id": 23824, "url": "https://patchwork.libcamera.org/api/patches/23824/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23824/", "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": "<20250716142027.236277-4-uajain@igalia.com>", "date": "2025-07-16T14:20:23", "name": "[RFC,3/6] libcamera: simple: Support StreamRole::Raw in generateConfiguration()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4710ba3d5f40dba914720725f2e3d4bc8a746dd8", "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/23824/mbox/", "series": [ { "id": 5289, "url": "https://patchwork.libcamera.org/api/series/5289/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5289", "date": "2025-07-16T14:20:20", "name": "libcamera: simple: Enable Raw capture", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5289/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23824/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23824/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 52E76C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 16 Jul 2025 14:20:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 20EED68F7F;\n\tWed, 16 Jul 2025 16:20:30 +0200 (CEST)", "from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 51B5068F61\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Jul 2025 16:20:26 +0200 (CEST)", "from [49.36.69.57] (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 1uc2zh-00HLf5-Di; Wed, 16 Jul 2025 16:20:25 +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=\"LzcNZuJM\"; 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=etVhYdqh6LyXoRuJ2CwOvKldi5x18r3Wrrk+FbwMZFk=;\n\tb=LzcNZuJMJTiW7zjcHtEmQ1MC3h\n\tZvLtbuBDIdAtuYWtzkmk8kmXwkeLvyJGkXc2o5oHu8/Jwa7yVfOwO56IBUTtY35W6+4Hw124u32oZ\n\tKoEahgjAvrPWqsCDCEnKLclzn5wCM0J4pCnI6p4zBiajCjaw2ke2KZTHpmwCGFjqectWhXa8lstvZ\n\tQ+PEoU78t8yzXOgE6bHdgtqrpgCvjPKJRLN4nCNGYQfEzw35T/wQUIDYgPXknC9IguBSBUO7tKVS8\n\tB1ZgEW1lNCmMMrO99+G5JSpeuL2dg4p9vgAPdMfCQMq0cDQ6kvk6CUTE/oguH5VrXTCAJ0rdRg9uV\n\t9OTauKWg==;", "From": "Umang Jain <uajain@igalia.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>,\n\tRobert Mader <robert.mader@collabora.com>, Umang Jain <uajain@igalia.com>", "Subject": "[RFC PATCH 3/6] libcamera: simple: Support StreamRole::Raw in\n\tgenerateConfiguration()", "Date": "Wed, 16 Jul 2025 19:50:23 +0530", "Message-ID": "<20250716142027.236277-4-uajain@igalia.com>", "X-Mailer": "git-send-email 2.50.0", "In-Reply-To": "<20250716142027.236277-1-uajain@igalia.com>", "References": "<20250716142027.236277-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": "Add stream role support for raw stream in generateConfiguration.\nIf multiple raw streams are requested, make sure to invalidate them\naccordingly in validate(). Currently, only one raw stream per camera\nconfiguration is allowed.\n\nIn order to get access to the raw formats supported by the sensor,\none would require to iterate over SimpleCameraData::formats_ map\nin generateConfiguration(). This map not only include output\nconfiguration pixel formats but also the raw format configuration that\ncan be produced (for raw roles).\n\nSigned-off-by: Umang Jain <uajain@igalia.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 50 ++++++++++++++++++++----\n 1 file changed, 43 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex cadc1117..d6c92391 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -1128,6 +1128,23 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n \tLOG(SimplePipeline, Debug)\n \t\t<< \"Largest stream size is \" << maxStreamSize;\n \n+\t/* Cap the number of raw stream configuration */\n+\tunsigned int rawCount = 0;\n+\tPixelFormat requestedRawFormat;\n+\tfor (const StreamConfiguration &cfg : config_) {\n+\t\tif (!isFormatRaw(cfg.pixelFormat))\n+\t\t\tcontinue;\n+\t\trequestedRawFormat = cfg.pixelFormat;\n+\t\trawCount++;\n+\t}\n+\n+\tif (rawCount > 1) {\n+\t\tLOG(SimplePipeline, Error)\n+\t\t\t<< \"Camera configuration with \"\n+\t\t\t<< rawCount << \" raw streams not supported\";\n+\t\treturn Invalid;\n+\t}\n+\n \t/*\n \t * Find the best configuration for the pipeline using a heuristic.\n \t * First select the pixel format based on the streams (which are\n@@ -1289,9 +1306,9 @@ SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRo\n \t/* Create the formats map. */\n \tstd::map<PixelFormat, std::vector<SizeRange>> formats;\n \n-\tfor (const SimpleCameraData::Configuration &cfg : data->configs_) {\n-\t\tfor (PixelFormat format : cfg.outputFormats)\n-\t\t\tformats[format].push_back(cfg.outputSizes);\n+\tfor (const auto &it : data->formats_) {\n+\t\tfor (const SimpleCameraData::Configuration *cfg : it.second)\n+\t\t\tformats[it.first].push_back(cfg->outputSizes);\n \t}\n \n \t/* Sort the sizes and merge any consecutive overlapping ranges. */\n@@ -1317,14 +1334,33 @@ SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRo\n \n \t/*\n \t * Create the stream configurations. Take the first entry in the formats\n-\t * map as the default, for lack of a better option.\n+\t * map as the default for each of role (raw or non-raw), for lack of a\n+\t * better option.\n \t *\n \t * \\todo Implement a better way to pick the default format\n \t */\n-\tfor ([[maybe_unused]] StreamRole role : roles) {\n+\tfor (StreamRole role : roles) {\n \t\tStreamConfiguration cfg{ StreamFormats{ formats } };\n-\t\tcfg.pixelFormat = formats.begin()->first;\n-\t\tcfg.size = formats.begin()->second[0].max;\n+\n+\t\tswitch (role) {\n+\t\tcase StreamRole::Raw:\n+\t\t\tfor (auto &[format, sizes] : formats) {\n+\t\t\t\tif (!isFormatRaw(format))\n+\t\t\t\t\tcontinue;\n+\t\t\t\tcfg.pixelFormat = format;\n+\t\t\t\tcfg.size = sizes.back().max;\n+\t\t\t\tcfg.colorSpace = ColorSpace::Raw;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tfor (auto &[format, sizes] : formats) {\n+\t\t\t\tif (isFormatRaw(format))\n+\t\t\t\t\tcontinue;\n+\t\t\t\tcfg.pixelFormat = format;\n+\t\t\t\tcfg.size = sizes[0].max;\n+\t\t\t}\n+\t\t}\n \n \t\tconfig->addConfiguration(cfg);\n \t}\n", "prefixes": [ "RFC", "3/6" ] }