Show a patch.

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

{
    "id": 15898,
    "url": "https://patchwork.libcamera.org/api/patches/15898/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15898/",
    "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": "<20220512103258.324339-3-chenghaoyang@google.com>",
    "date": "2022-05-12T10:32:52",
    "name": "[libcamera-devel,2/8] Allow only one camera being started",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "52663ed1bde380c9c2cd791508e9c524864f37f7",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15898/mbox/",
    "series": [
        {
            "id": 3111,
            "url": "https://patchwork.libcamera.org/api/series/3111/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3111",
            "date": "2022-05-12T10:32:50",
            "name": "Use two imgus in ipu3 pipeline handler",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3111/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15898/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15898/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 CF257C326C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 May 2022 10:33:10 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0C65065641;\n\tThu, 12 May 2022 12:33:10 +0200 (CEST)",
            "from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com\n\t[IPv6:2607:f8b0:4864:20::1030])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 53D8C6049E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 May 2022 12:33:08 +0200 (CEST)",
            "by mail-pj1-x1030.google.com with SMTP id\n\tcq17-20020a17090af99100b001dc0386cd8fso4485950pjb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 May 2022 03:33:08 -0700 (PDT)",
            "from chenghaoyang-low.c.googlers.com.com\n\t(174.71.80.34.bc.googleusercontent.com. [34.80.71.174])\n\tby smtp.gmail.com with ESMTPSA id\n\tt19-20020a62d153000000b005087c23ad8dsm3402219pfl.0.2022.05.12.03.33.04\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 12 May 2022 03:33:05 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652351590;\n\tbh=wukPARUiUSFLdffEzZ5nRpJD5im1hAxRriQA2ITD1Wo=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=vmU44JqLm7Dx+nwZTSyFSNSAo6Oqy6eP1K9PCm2Zb3DyGv47E6e/jgS5J6o151z6Q\n\t8duq1jxdlWvmSGS+OW8jMFPivW/VuUzwNlhahyf2u6nUh3wwor1uPqHKtCpMb0cLtf\n\tuhhQmyAfRhnX3aEgHCwtNTiDxY/qkkRlBBjRDnAiLAD9Sk13gMYPNVtikI0oS+gTP3\n\t35VDOXEMNCkPrROo4/29ZWC8lhLo2tpktC3N9bzTdxkB/ENUg1tTAeBBbRmn5zG2+S\n\tN7QBYYd1ZSZtTUuXk/28W4AaFeiCvO6o16joEDB7h3YE5N0VQgbD1AYyJyrltxOFOE\n\tJEbjiI2unCgbA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=WfSb3RCwf0H+pQuNDVNprdxG0GnEl0+4yWxd1rNIr2s=;\n\tb=m6YhqHrwMucCYo1a1/16vsGpwREEBhSGG4qQO2tFYO2MKcPgkMuiSDUprqt5mGYA41\n\tgWTEYY/DiMppbFvIgd57o+SHy8i+wlyMpLN2nh3G2MPs+c7I/FgIX2wpjgFGRjsewqmi\n\tRlrXHz/0YXUtFT2c4gZzmD/ordmmcRCSZXvzI="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"m6YhqHrw\"; \n\tdkim-atps=neutral",
        "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=WfSb3RCwf0H+pQuNDVNprdxG0GnEl0+4yWxd1rNIr2s=;\n\tb=kzxHz1dqIu4Mb0Y7eMuGtbNI85duPcXEGnTBVHRh161WPbfSlUGj/y0h6Z3CJgxcD7\n\tQlaHCljTqlKyIe7bNMlR6wfBaE0NMQpdPfabc1XEtHEh7dJ/UxR9Iq9no62CqH7PGa6O\n\tdvYFgs9Uv2cC6FSWrvsr4NRjT5R64kqkv6RkhUdeotR5tFwDFFFcud1ljoNAhF+3wrRo\n\t0BVxfbRrYKN86Kff0/Pgil5tfZ69kC3nATu3gKmRVAncNWK44Vhy3/zSXcJKFlJGAN4m\n\t1S20ZL5LU+OYHAHLNx6iYWBU59rDlyktlyWOfmkMwZUe/L3R/XgyjmHAiKNi/GtMjRWy\n\tG4yw==",
        "X-Gm-Message-State": "AOAM532KsrJyISIAqKXO8XYKOs+a3IWwopy4KtBGXZFI+jbgAXUGsl75\n\tB4qrQy64LlGODi7HgPGyUcYspG2sDCf13ZVl",
        "X-Google-Smtp-Source": "ABdhPJxqeSsgi61fGU6pt9az3QNZiR5TXmH09IhGILKa75wV/NLKGhtPLFl0YilBshP0g28li0ULUw==",
        "X-Received": "by 2002:a17:902:ce92:b0:15e:9601:dc02 with SMTP id\n\tf18-20020a170902ce9200b0015e9601dc02mr28740393plg.79.1652351586314; \n\tThu, 12 May 2022 03:33:06 -0700 (PDT)",
        "X-Google-Original-From": "Harvey Yang <chenghaoyang@google.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 12 May 2022 10:32:52 +0000",
        "Message-Id": "<20220512103258.324339-3-chenghaoyang@google.com>",
        "X-Mailer": "git-send-email 2.36.0.512.ge40c2bad7a-goog",
        "In-Reply-To": "<20220512103258.324339-1-chenghaoyang@google.com>",
        "References": "<20220512103258.324339-1-chenghaoyang@google.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/8] Allow only one camera being started",
        "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>",
        "From": "Harvey Yang via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Harvey Yang <chenghaoyang@chromium.org>",
        "Cc": "Harvey Yang <chenghaoyang@chromium.org>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Harvey Yang <chenghaoyang@chromium.org>\n\nAs we hardly have use cases/applications that need both cameras at the\nsame time, this patch adds a rule that only one camera can be started\none time. This also allows the following patches that use both imgus to\nprocess frames from one single camera.\n\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++++++\n 1 file changed, 12 insertions(+)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex fd989e61..111ba053 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -166,6 +166,8 @@ private:\n \tMediaDevice *cio2MediaDev_;\n \tMediaDevice *imguMediaDev_;\n \n+\tCamera *inUseCamera_ = nullptr;\n+\n \tstd::vector<IPABuffer> ipaBuffers_;\n };\n \n@@ -765,6 +767,10 @@ int PipelineHandlerIPU3::freeBuffers(Camera *camera)\n \n int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlList *controls)\n {\n+\t// Deny second camera being started.\n+\tif (inUseCamera_ && inUseCamera_ != camera)\n+\t\treturn -1;\n+\n \tIPU3CameraData *data = cameraData(camera);\n \tCIO2Device *cio2 = &data->cio2_;\n \tImgUDevice *imgu = data->imgu_;\n@@ -781,6 +787,8 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis\n \tif (ret)\n \t\treturn ret;\n \n+\tinUseCamera_ = camera;\n+\n \tret = data->ipa_->start();\n \tif (ret)\n \t\tgoto error;\n@@ -808,6 +816,8 @@ error:\n \tfreeBuffers(camera);\n \tLOG(IPU3, Error) << \"Failed to start camera \" << camera->id();\n \n+\tinUseCamera_ = nullptr;\n+\n \treturn ret;\n }\n \n@@ -826,6 +836,8 @@ void PipelineHandlerIPU3::stopDevice(Camera *camera)\n \t\tLOG(IPU3, Warning) << \"Failed to stop camera \" << camera->id();\n \n \tfreeBuffers(camera);\n+\n+\tinUseCamera_ = nullptr;\n }\n \n void IPU3CameraData::cancelPendingRequests()\n",
    "prefixes": [
        "libcamera-devel",
        "2/8"
    ]
}