Show a patch.

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

{
    "id": 9852,
    "url": "https://patchwork.libcamera.org/api/patches/9852/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9852/",
    "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": "<20200929014334.49719-8-niklas.soderlund@ragnatech.se>",
    "date": "2020-09-29T01:43:34",
    "name": "[libcamera-devel,v4,7/7] libcamera: pipeline: rkisp1: Use the media link to track if a path is enabled",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c1db8779c7b07362de55c6e8e96bebca74fad326",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9852/mbox/",
    "series": [
        {
            "id": 1333,
            "url": "https://patchwork.libcamera.org/api/series/1333/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1333",
            "date": "2020-09-29T01:43:27",
            "name": "libcamera: pipeline: rkisp1: Create RkISP1Path helper",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/1333/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9852/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9852/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 2CF2EC3B5E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Sep 2020 01:43:59 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EE5C362146;\n\tTue, 29 Sep 2020 03:43:58 +0200 (CEST)",
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 39C6E62048\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Sep 2020 03:43:56 +0200 (CEST)",
            "from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de\n\t[84.172.82.168]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 3a46364f-01f5-11eb-b295-0050569116f7;\n\tTue, 29 Sep 2020 03:43:52 +0200 (CEST)"
        ],
        "X-Halon-ID": "3a46364f-01f5-11eb-b295-0050569116f7",
        "Authorized-sender": "niklas.soderlund@fsdn.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 29 Sep 2020 03:43:34 +0200",
        "Message-Id": "<20200929014334.49719-8-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20200929014334.49719-1-niklas.soderlund@ragnatech.se>",
        "References": "<20200929014334.49719-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v4 7/7] libcamera: pipeline: rkisp1: Use\n\tthe media link to track if a path is enabled",
        "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=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Instead of manually tracking if a path is enable or not use the media\ngraph link status. There is no functional change.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n* Changes since v3\n- Update spelling in commit message.\n- Do not check path status in RkISP1Path::start() instead keep check in\n  pipeline start().\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp    | 26 +++++++--------------\n src/libcamera/pipeline/rkisp1/rkisp1_path.h |  1 +\n 2 files changed, 9 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 72593a06b0f502b0..48d00970aba3beda 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -122,8 +122,7 @@ public:\n \tRkISP1CameraData(PipelineHandler *pipe, RkISP1MainPath *mainPath,\n \t\t\t RkISP1SelfPath *selfPath)\n \t\t: CameraData(pipe), sensor_(nullptr), frame_(0),\n-\t\t  frameInfo_(pipe), mainPath_(mainPath), selfPath_(selfPath),\n-\t\t  mainPathActive_(false), selfPathActive_(false)\n+\t\t  frameInfo_(pipe), mainPath_(mainPath), selfPath_(selfPath)\n \t{\n \t}\n \n@@ -145,9 +144,6 @@ public:\n \tRkISP1MainPath *mainPath_;\n \tRkISP1SelfPath *selfPath_;\n \n-\tbool mainPathActive_;\n-\tbool selfPathActive_;\n-\n private:\n \tvoid queueFrameAction(unsigned int frame,\n \t\t\t      const IPAOperationData &action);\n@@ -709,20 +705,14 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tLOG(RkISP1, Debug) << \"ISP output pad configured with \" << format.toString();\n \n-\tdata->mainPathActive_ = false;\n-\tdata->selfPathActive_ = false;\n \tfor (const StreamConfiguration &cfg : *config) {\n-\t\tif (cfg.stream() == &data->mainPathStream_) {\n+\t\tif (cfg.stream() == &data->mainPathStream_)\n \t\t\tret = mainPath_.configure(cfg, format);\n-\t\t\tif (ret)\n-\t\t\t\treturn ret;\n-\t\t\tdata->mainPathActive_ = true;\n-\t\t} else {\n+\t\telse\n \t\t\tret = selfPath_.configure(cfg, format);\n-\t\t\tif (ret)\n-\t\t\t\treturn ret;\n-\t\t\tdata->selfPathActive_ = true;\n-\t\t}\n+\n+\t\tif (ret)\n+\t\t\treturn ret;\n \t}\n \n \tV4L2DeviceFormat paramFormat = {};\n@@ -868,7 +858,7 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n \n \tstd::map<unsigned int, IPAStream> streamConfig;\n \n-\tif (data->mainPathActive_) {\n+\tif (data->mainPath_->isEnabled()) {\n \t\tret = mainPath_.start();\n \t\tif (ret) {\n \t\t\tparam_->streamOff();\n@@ -884,7 +874,7 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n \t\t};\n \t}\n \n-\tif (data->selfPathActive_) {\n+\tif (data->selfPath_->isEnabled()) {\n \t\tret = selfPath_.start();\n \t\tif (ret) {\n \t\t\tmainPath_.stop();\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\nindex 98863a2e693729be..f34d6bacd49c8f02 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n@@ -35,6 +35,7 @@ public:\n \tbool init(MediaDevice *media);\n \n \tint setEnabled(bool enable) { return link_->setEnabled(enable); }\n+\tbool isEnabled() { return link_->flags() & MEDIA_LNK_FL_ENABLED; }\n \n \tStreamConfiguration generateConfiguration(const Size &resolution);\n \tCameraConfiguration::Status validate(StreamConfiguration *cfg);\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "7/7"
    ]
}