Patch Detail
Show a patch.
GET /api/patches/14786/?format=api
{ "id": 14786, "url": "https://patchwork.libcamera.org/api/patches/14786/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14786/", "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": "<20211126003118.42356-4-djrscally@gmail.com>", "date": "2021-11-26T00:31:16", "name": "[libcamera-devel,3/5] libcamera: ipu3-cio2: Discover VCMs through ancillary links", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f227437b37aa8ab46278b3cd6222c00e94247d9e", "submitter": { "id": 90, "url": "https://patchwork.libcamera.org/api/people/90/?format=api", "name": "Daniel Scally", "email": "djrscally@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14786/mbox/", "series": [ { "id": 2757, "url": "https://patchwork.libcamera.org/api/series/2757/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2757", "date": "2021-11-26T00:31:13", "name": "Enumerate CameraLens by following sensor's ancillary links", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2757/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14786/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14786/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 34DDABDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Nov 2021 00:31:36 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DCF0D604FB;\n\tFri, 26 Nov 2021 01:31:35 +0100 (CET)", "from mail-wr1-x435.google.com (mail-wr1-x435.google.com\n\t[IPv6:2a00:1450:4864:20::435])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 30EE760499\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Nov 2021 01:31:30 +0100 (CET)", "by mail-wr1-x435.google.com with SMTP id i5so14976528wrb.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 16:31:30 -0800 (PST)", "from localhost.localdomain\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tb188sm4381455wmd.45.2021.11.25.16.31.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 25 Nov 2021 16:31:29 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"DLaFPl9/\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=WiOK10IpVso/amOg/JULzN+ZlDMbZCiXCePGnabe+Y8=;\n\tb=DLaFPl9/zVgKMzN/9UmawBuMXIgK/LxxgrMU1Fp1WRAqCmZNOI8C/5flCw3ohnm+jx\n\tkf2oylfWGtbmei0pTBgwpl90Fa7F0yLvk5aBDZv3L4YOiyn0v+vDgUiKJramhwtMwjOs\n\tip0LvSb75EX9WtVs9mH1Sz4AgTuQiKdevj1QXZjvUIELv4TbcFSXZ2m7Yf9hXDnRpDKk\n\t/tGH+TnFssFC2Suu6oI0SYPYbWP5axq8ldzfK4FEhUSFNXGfMWc4Mnnb35ew1468uioq\n\tjxi2WeV6TaFRWvkROHD48QtpkW1SuOIJwGTwGKcyQfPx5oBaYSEeqgcqvXopBMODH4sA\n\tRrOA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=WiOK10IpVso/amOg/JULzN+ZlDMbZCiXCePGnabe+Y8=;\n\tb=r45aut4QRVC23hfJG2Nadl3SAfQG2F8fIiUDdN+Lj+lDnknhNjAeZEAFD1ig6Y8s/N\n\tq0tZAxtQSEtPlfv0AC8JatoonXaxtCmVl7MCg3hfLBAjKUf3wYrrcZEG7tZABGyBoRmo\n\tLxfPNVkVoMJRKtQw486Jq220KrDfYp3VN+EF9aKLO1Lkd/Kp2hQvPBCeiVlCLOF+z9F9\n\tuZM2hTyUkgMA86H6tr1B2gqhGF0orbZ1oE7dSF5CXSEI1EOn4BdeAI6gd7Xwj3wvPlad\n\tbBg5A5p8NqhK0vYkcTCR93jFl6D8C/v+eoObF+mRB2ORh0P6Cigk48EFgJzU8RwgmYyD\n\tvuCA==", "X-Gm-Message-State": "AOAM533KHmAlfuCiwgjNLyqvb6Tj+D94IBZGG5zX1K7gzJXv9hnYKT+b\n\tKX6ABi3uFX7KgkRf/UEoIeTQFZQwkw4=", "X-Google-Smtp-Source": "ABdhPJxiBIq9TMyRoaTqLNPPUOGGqq/RvyOG3bjYxYEeTxx4/6qP5QV0zOi0MOc5yfvNQSrkaHnt1A==", "X-Received": "by 2002:adf:d1c2:: with SMTP id\n\tb2mr11031705wrd.114.1637886689713; \n\tThu, 25 Nov 2021 16:31:29 -0800 (PST)", "From": "Daniel Scally <djrscally@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 26 Nov 2021 00:31:16 +0000", "Message-Id": "<20211126003118.42356-4-djrscally@gmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211126003118.42356-1-djrscally@gmail.com>", "References": "<20211126003118.42356-1-djrscally@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 3/5] libcamera: ipu3-cio2: Discover VCMs\n\tthrough ancillary links", "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": "Rather than attempting to discover VCMs via model name matching we\nshould follow the ancillary links that define the relationship\nbetween the two devices to locate any entities linked to the sensor.\nWhere we have linked entities with the function MEDIA_ENT_F_LENS we\ncan then create an instance of CameraLens to represent it.\n\nSigned-off-by: Daniel Scally <djrscally@gmail.com>\n---\n\nAlternatively rather than replace the matching on model names we could try\nthe ancillary links first and then simply guard the existing model matching\nwith an if (!lens_) ...\n\n src/libcamera/pipeline/ipu3/cio2.cpp | 45 +++++++++++++++-------------\n 1 file changed, 25 insertions(+), 20 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\nindex 59b2f586..169e7b54 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.cpp\n+++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n@@ -161,30 +161,35 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index)\n \t}\n \n \t/*\n-\t * \\todo Read the lens model from the sensor itself or from a device\n-\t * database. For now use default values taken from ChromeOS database.\n+\t * Sensors sometimes have ancillary devices such as a Lens or Flash\n+\t * that could be linked to the MediaEntity - search for and handle\n+\t * any such device (for now, we can only handle MEDIA_ENT_F_LENS)\n+\t *\n+\t * \\todo Handle MEDIA_ENT_F_FLASH too.\n \t */\n-\tstatic std::unordered_map<std::string, std::string> sensorLens = {\n-\t\t{ \"ov13858\", \"dw9714\" },\n-\t\t{ \"imx258\", \"dw9807\" },\n-\t\t{ \"imx355\", \"ak7375\" }\n-\t};\n-\n-\tauto it = sensorLens.find(sensor_->model());\n-\tif (it != sensorLens.end()) {\n-\t\tconst std::vector<MediaEntity *> &entities = media->entities();\n-\t\tfor (auto ent : entities) {\n-\t\t\tif (ent->function() == MEDIA_ENT_F_LENS) {\n-\t\t\t\tlens_ = std::make_unique<CameraLens>(ent);\n+\tconst std::vector<MediaLink *> &ancillary_links = sensorEntity->ancillary_links();\n+\tif (!ancillary_links.empty()) {\n+\t\tfor (auto it : ancillary_links) {\n+\t\t\tMediaEntity *ancillaryEntity = it->ancillary();\n+\n+\t\t\tswitch (ancillaryEntity->function()) {\n+\t\t\tcase MEDIA_ENT_F_LENS:\n+\t\t\t\tlens_ = std::make_unique<CameraLens>(ancillaryEntity);\n \t\t\t\tret = lens_->init();\n-\t\t\t\tif (!ret && lens_->model() == it->second) {\n-\t\t\t\t\tbreak;\n+\t\t\t\tif (ret) {\n+\t\t\t\t\tLOG(IPU3, Error)\n+\t\t\t\t\t\t<< \"Error during CameraLens init\";\n+\t\t\t\t\treturn ret;\n \t\t\t\t}\n-\t\t\t\tlens_.reset();\n+\t\t\t\tbreak;\n+\t\t\tcase MEDIA_ENT_F_FLASH:\n+\t\t\t\tLOG(IPU3, Warning)\n+\t\t\t\t\t<< \"Flash not yet supported\";\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tLOG(IPU3, Warning)\n+\t\t\t\t\t<< \"Unsupported entity function\";\n \t\t\t}\n-\t\t\tif (!lens_)\n-\t\t\t\tLOG(IPU3, Warning) << \"Lens device \"\n-\t\t\t\t\t\t << it->second << \" not found\";\n \t\t}\n \t}\n \n", "prefixes": [ "libcamera-devel", "3/5" ] }