Show a patch.

GET /api/1.1/patches/14957/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 14957,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14957/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14957/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20211201115711.1017822-2-naush@raspberrypi.com>",
    "date": "2021-12-01T11:57:10",
    "name": "[libcamera-devel,v1,1/2] pipeline: raspberrypi: Move sensor entity detection out of registerCamera()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "62ada8b15aa8e758c9040808c29e75df7232488b",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14957/mbox/",
    "series": [
        {
            "id": 2793,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2793/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2793",
            "date": "2021-12-01T11:57:09",
            "name": "Raspberry Pi: Add video mux and bridge support",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2793/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14957/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14957/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 BE590C3250\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Dec 2021 11:57:24 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5B5EB6059C;\n\tWed,  1 Dec 2021 12:57:24 +0100 (CET)",
            "from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B3A46011A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Dec 2021 12:57:23 +0100 (CET)",
            "by mail-wr1-x436.google.com with SMTP id t9so34685231wrx.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Dec 2021 03:57:23 -0800 (PST)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:9907:13eb:bd49:5862])\n\tby smtp.gmail.com with ESMTPSA id\n\tf13sm1139451wmq.29.2021.12.01.03.57.21\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Dec 2021 03:57:22 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"N2EhLhdM\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=49BdeSGrYkKnPrwypx/xXitVPSiEQrgJRyauOS4rVKk=;\n\tb=N2EhLhdM4V/UCs7rKPwLdbGOsIOIGRC9NzE2y6adyYSWSmJRCGTR3C17kySEB0cbQI\n\txl/kavMlG757YjOBr3lFywwhaGKY1lgzhlMfT9ndLu4cCo1oRBq6J3785q2A9uUNwbwb\n\tJ2nAQkKVmoBqhyfPC4PQSL5i1sEssTZRgZU/XOSnARJ/RFC1FvvELt06iPODzrKYY5kP\n\tgHLEnt1GP8iYk8S+6f4h72ZIuu6fYFa35/B3bjOt1i6vmToVMvjWA3qnDCevF4ZH0skV\n\tNkWOiPfl6ynyKKapXQs5uexX4Uh/697fQNYPKZBOrgezGAnkF9Q27G/kpn5sSVTnJR26\n\tCDzg==",
        "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=49BdeSGrYkKnPrwypx/xXitVPSiEQrgJRyauOS4rVKk=;\n\tb=d1LiSOBw8uzNipg+KOK/xN3tV3PMG5tAnhcIOi9SSGmUHXY3NPIFSAXKiZtK61SQ3R\n\tr5kiA2SGVCrXY+oEfA29pweJPx/g83UVwVY6Y+xEyOLBIWmr26wyCZZF4sboSjMnWs83\n\tcx9UxY19NjtC+Eetptz+yXwDVL4zpqcdfAtG+hV8tz3gf1SFyX6jk6GZAOt5nYXsrLl1\n\tG9s3Cq2zRRDSobfC86frKm5nkds2q0QwxTvpcRp3GwoNVfuNeCOj44IVUpKupOVlR3HN\n\t0zYVT6ESF7Mhez3esOJAToZ6DElzN96O7Ij7uO6w15NmciQKLZRCgpyqCeT1iawEwzlW\n\tmyBA==",
        "X-Gm-Message-State": "AOAM531YbKUoJ/2b7TVgaH/ErpO0qDSM8kx75Sd7zVGMTPs3TUMrntBu\n\t/2HZST+14v2D4SSMD7qe4uY+5XWZ1F5VG8x1",
        "X-Google-Smtp-Source": "ABdhPJz3IYmo9Vo01X35Sipk10+KNhL3FlRvO/nYO1i/CwMgOCs8hIpLMK8Xxg8mXxau30tb2noIDA==",
        "X-Received": "by 2002:a5d:4a0a:: with SMTP id\n\tm10mr5962292wrq.221.1638359842544; \n\tWed, 01 Dec 2021 03:57:22 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  1 Dec 2021 11:57:10 +0000",
        "Message-Id": "<20211201115711.1017822-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211201115711.1017822-1-naush@raspberrypi.com>",
        "References": "<20211201115711.1017822-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v1 1/2] pipeline: raspberrypi: Move sensor\n\tentity detection out of registerCamera()",
        "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": "Enumerate the sensor device entities in PipelineHandlerRPi::match() and loop\nover PipelineHandlerRPi::registerCamera() for each sensor found. This will\nallow the pipeline handler to register multiple cameras attached to a single\nUnicam instance with a Video Mux device.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 35 +++++++++++--------\n 1 file changed, 20 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex e31fa3b23859..811160490f5c 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -314,7 +314,7 @@ private:\n \t\treturn static_cast<RPiCameraData *>(camera->_d());\n \t}\n \n-\tint registerCamera(MediaDevice *unicam, MediaDevice *isp);\n+\tint registerCamera(MediaDevice *unicam, MediaDevice *isp, MediaEntity *sensorEntity);\n \tint queueAllBuffers(Camera *camera);\n \tint prepareBuffers(Camera *camera);\n \tvoid freeBuffers(Camera *camera);\n@@ -1009,16 +1009,28 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \t}\n \n-\tint ret = registerCamera(unicamDevice, ispDevice);\n-\tif (ret) {\n-\t\tLOG(RPI, Error) << \"Failed to register camera: \" << ret;\n-\t\treturn false;\n+\t/*\n+\t * The loop below is used to register multiple cameras behind one or more\n+\t * video mux devices that are attaced to a particular Unicam instance.\n+\t * Obviously these cameras cannot be used simultaneously.\n+\t */\n+\tunsigned int numCameras = 0;\n+\tfor (MediaEntity *entity : unicamDevice->entities()) {\n+\t\tif (entity->function() != MEDIA_ENT_F_CAM_SENSOR)\n+\t\t\tcontinue;\n+\n+\t\tint ret = registerCamera(unicamDevice, ispDevice, entity);\n+\t\tif (ret)\n+\t\t\tLOG(RPI, Error) << \"Failed to register camera \"\n+\t\t\t\t\t<< entity->name() << \": \" << ret;\n+\t\telse\n+\t\t\tnumCameras++;\n \t}\n \n-\treturn true;\n+\treturn !!numCameras;\n }\n \n-int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp)\n+int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp, MediaEntity *sensorEntity)\n {\n \tstd::unique_ptr<RPiCameraData> data = std::make_unique<RPiCameraData>(this);\n \n@@ -1059,14 +1071,7 @@ int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp)\n \tdata->isp_[Isp::Output1].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispOutputDequeue);\n \tdata->isp_[Isp::Stats].dev()->bufferReady.connect(data.get(), &RPiCameraData::ispOutputDequeue);\n \n-\t/* Identify the sensor. */\n-\tfor (MediaEntity *entity : unicam->entities()) {\n-\t\tif (entity->function() == MEDIA_ENT_F_CAM_SENSOR) {\n-\t\t\tdata->sensor_ = std::make_unique<CameraSensor>(entity);\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\n+\tdata->sensor_ = std::make_unique<CameraSensor>(sensorEntity);\n \tif (!data->sensor_)\n \t\treturn -EINVAL;\n \n",
    "prefixes": [
        "libcamera-devel",
        "v1",
        "1/2"
    ]
}