Patch Detail
Show a patch.
GET /api/patches/12187/?format=api
{ "id": 12187, "url": "https://patchwork.libcamera.org/api/patches/12187/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12187/", "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": "<20210503122518.745088-1-pnguyen@baylibre.com>", "date": "2021-05-03T12:25:17", "name": "[libcamera-devel] pipeline: simple: Rework the supportedDevices list", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "1123cd8052dd3723c0e54607a21efba1f9c3b695", "submitter": { "id": 79, "url": "https://patchwork.libcamera.org/api/people/79/?format=api", "name": "Phi-bang Nguyen", "email": "pnguyen@baylibre.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12187/mbox/", "series": [ { "id": 1995, "url": "https://patchwork.libcamera.org/api/series/1995/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1995", "date": "2021-05-03T12:25:17", "name": "[libcamera-devel] pipeline: simple: Rework the supportedDevices list", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1995/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12187/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12187/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 5E247BDE78\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 3 May 2021 12:25:42 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1C9B360511;\n\tMon, 3 May 2021 14:25:42 +0200 (CEST)", "from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4439C60511\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 3 May 2021 14:25:41 +0200 (CEST)", "by mail-wm1-x329.google.com with SMTP id n205so2318957wmf.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 03 May 2021 05:25:41 -0700 (PDT)", "from localhost.localdomain (206.159.69.91.rev.sfr.net.\n\t[91.69.159.206]) by smtp.googlemail.com with ESMTPSA id\n\tt206sm11373299wmb.11.2021.05.03.05.25.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 03 May 2021 05:25:40 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=baylibre-com.20150623.gappssmtp.com\n\theader.i=@baylibre-com.20150623.gappssmtp.com\n\theader.b=\"rMVVhSSK\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=baylibre-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=LRal6OKz6/fLzgNS6RylPR6MI9yFWTnEq4J1yw09wwA=;\n\tb=rMVVhSSK0X71u8ctSCOywpj8kNng771R15U812uNRSjJHR/4u5x3hqNr1iMgoHez2I\n\tOHSQ7YqYextjE6C34c+102mL3L8onE60s6iv9b3TUX0chFI1UW756aGXio3WckmJCBvm\n\t4UsLIKPrg0EfflXYdP1AGA4BfA7XDPvg6e8uB/hSsPZxBD8ZOVfyxElfJTor1k8qR7bU\n\tSazeiYuJ/RXwtOaN4nnM69fTFRGd9tTLboc2kyktDK/GZTYyXXvsrUtE2oSuF8PzV/TD\n\tufc7yTg0NCqkQS23WBmmOBbFjnKnrIjUQsLieBXBz1WQk4i+gdF4GvDXrTtv+qtMAx+A\n\tV/Zw==", "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=LRal6OKz6/fLzgNS6RylPR6MI9yFWTnEq4J1yw09wwA=;\n\tb=FQsDyEu4bt2d5PcpZcDY4F92gtA+wWIDq9yC+A8PlZKyfLmnhWP8qIbHVeDr5r31jm\n\tsysnrR2Cur3F06ICpuZ+ExfT5hoc/o5L95xANABMawoNrN32AZwFVs5PKLJyHPd/jXu+\n\tStXTI+O6wjoM6W1Hu1Mj9DWhaLWH0a3GtAnFhUA4rLPUv8mlQODTOm5+FvcisH6YKJJE\n\tiu0OhZsm1Toe8sJkf/KQZeprqgfS7BjX3KbEJQ8H07BuZV+Nw9XMBCWTy4VVhVoce/gQ\n\t+Fd+kEuSvuMhbwSibz9a3J1Qt47SV/OYZuBCHIVbgR6V/0PaQVdPWWesdztWXxK98lJL\n\tRsdw==", "X-Gm-Message-State": "AOAM5327H2Ajkv/0wKqcGxF1QzSNSMZ/LKZmmwtmbiwSGaioTI4q7iIb\n\trZYtWErXf7OxMbSRpI/RhwKo8UIUzdNTTA==", "X-Google-Smtp-Source": "ABdhPJwIey+vYEGgFCE2ZXRFL/82b0fOf4PKWa78QpSB2i+AX7mEe7Hfl8Uxglokzwt2g+3JHtGPNA==", "X-Received": "by 2002:a1c:4c09:: with SMTP id\n\tz9mr21212943wmf.104.1620044740707; \n\tMon, 03 May 2021 05:25:40 -0700 (PDT)", "From": "Phi-Bang Nguyen <pnguyen@baylibre.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 3 May 2021 14:25:17 +0200", "Message-Id": "<20210503122518.745088-1-pnguyen@baylibre.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH] pipeline: simple: Rework the\n\tsupportedDevices list", "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": "There is a usecase that the same driver may go with a converter\non a platform and with another converter on another platform.\n\nCurrently, the simple pipeline handler only takes the 1st driver\nit can acquire in the supported devices list and skip the rest.\nThis makes it take the wrong converter for the above usecase.\n\nSo, make the changes to support the above usecase.\n\nSigned-off-by: Phi-Bang Nguyen <pnguyen@baylibre.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 34 +++++++++++++++---------\n 1 file changed, 22 insertions(+), 12 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex f6095d38..9a572694 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -127,16 +127,19 @@ class SimplePipelineHandler;\n \n struct SimplePipelineInfo {\n \tconst char *driver;\n-\tconst char *converter;\n-\tunsigned int numStreams;\n+\t/*\n+\t * Each converter in the list contains the name\n+\t * and the number of streams it supports.\n+\t */\n+\tstd::vector<std::pair<const char *, unsigned int>> converters;\n };\n \n namespace {\n \n static const SimplePipelineInfo supportedDevices[] = {\n-\t{ \"imx7-csi\", \"pxp\", 1 },\n-\t{ \"qcom-camss\", nullptr, 1 },\n-\t{ \"sun6i-csi\", nullptr, 1 },\n+\t{ \"imx7-csi\", { { \"pxp\", 1 } } },\n+\t{ \"qcom-camss\", { { nullptr, 1 } } },\n+\t{ \"sun6i-csi\", { { nullptr, 1 } } },\n };\n \n } /* namespace */\n@@ -145,7 +148,7 @@ class SimpleCameraData : public CameraData\n {\n public:\n \tSimpleCameraData(SimplePipelineHandler *pipe,\n-\t\t\t const SimplePipelineInfo *info,\n+\t\t\t unsigned int numStreams,\n \t\t\t MediaEntity *sensor);\n \n \tbool isValid() const { return sensor_ != nullptr; }\n@@ -266,9 +269,9 @@ private:\n */\n \n SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n-\t\t\t\t const SimplePipelineInfo *info,\n+\t\t\t\t unsigned int numStreams,\n \t\t\t\t MediaEntity *sensor)\n-\t: CameraData(pipe), streams_(info->numStreams)\n+\t: CameraData(pipe), streams_(numStreams)\n {\n \tint ret;\n \n@@ -934,6 +937,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n {\n \tconst SimplePipelineInfo *info = nullptr;\n \tMediaDevice *converter = nullptr;\n+\tunsigned int numStreams = 1;\n \n \tfor (const SimplePipelineInfo &inf : supportedDevices) {\n \t\tDeviceMatch dm(inf.driver);\n@@ -947,9 +951,15 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n \tif (!media_)\n \t\treturn false;\n \n-\tif (info->converter) {\n-\t\tDeviceMatch converterMatch(info->converter);\n-\t\tconverter = acquireMediaDevice(enumerator, converterMatch);\n+\tfor (const auto &cvt : info->converters) {\n+\t\tif (cvt.first) {\n+\t\t\tDeviceMatch converterMatch(cvt.first);\n+\t\t\tconverter = acquireMediaDevice(enumerator, converterMatch);\n+\t\t\tif (converter) {\n+\t\t\t\tnumStreams = cvt.second;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n \t}\n \n \t/* Locate the sensors. */\n@@ -983,7 +993,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n \n \tfor (MediaEntity *sensor : sensors) {\n \t\tstd::unique_ptr<SimpleCameraData> data =\n-\t\t\tstd::make_unique<SimpleCameraData>(this, info, sensor);\n+\t\t\tstd::make_unique<SimpleCameraData>(this, numStreams, sensor);\n \t\tif (!data->isValid()) {\n \t\t\tLOG(SimplePipeline, Error)\n \t\t\t\t<< \"No valid pipeline for sensor '\"\n", "prefixes": [ "libcamera-devel" ] }