Show a patch.

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

{
    "id": 10342,
    "url": "https://patchwork.libcamera.org/api/patches/10342/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10342/",
    "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": "<20201105001546.1690179-6-niklas.soderlund@ragnatech.se>",
    "date": "2020-11-05T00:15:40",
    "name": "[libcamera-devel,05/11] libcamera: ipu3: cio2: Return the FrameBuffer pointer used",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "4df9cd8a987d342df85e1b870876e5298fc3028c",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": {
        "id": 16,
        "url": "https://patchwork.libcamera.org/api/users/16/?format=api",
        "username": "neg",
        "first_name": "Niklas",
        "last_name": "Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10342/mbox/",
    "series": [
        {
            "id": 1447,
            "url": "https://patchwork.libcamera.org/api/series/1447/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1447",
            "date": "2020-11-05T00:15:35",
            "name": "libcamera: ipu3: Attach to an skeleton IPA",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1447/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10342/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10342/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 C0B57BDB89\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Nov 2020 00:16:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19C7F62CCB;\n\tThu,  5 Nov 2020 01:16:21 +0100 (CET)",
            "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B47062C94\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Nov 2020 01:16:18 +0100 (CET)",
            "from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 6ce0fb43-1efa-11eb-8a9c-005056917a89;\n\tThu, 05 Nov 2020 01:04:08 +0100 (CET)"
        ],
        "X-Halon-ID": "6ce0fb43-1efa-11eb-8a9c-005056917a89",
        "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": "Thu,  5 Nov 2020 01:15:40 +0100",
        "Message-Id": "<20201105001546.1690179-6-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20201105001546.1690179-1-niklas.soderlund@ragnatech.se>",
        "References": "<20201105001546.1690179-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 05/11] libcamera: ipu3: cio2: Return the\n\tFrameBuffer pointer used",
        "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": "When adding IPA plumbing to the IPU3 pipeline handler it will be needed\nto track witch raw buffer was queued to the CIO2 for a specific request.\nCurrently if using an internally allocated raw buffer the FrameBuffer is\nnot exposed outside the CIO2Device as it was not needed. Prepare for the\nIPA by exposing which infernal raw buffer is picked for each request,\nlater changes will associate this with a Request.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/ipu3/cio2.cpp | 10 +++++++---\n src/libcamera/pipeline/ipu3/cio2.h   |  2 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp |  8 ++++----\n 3 files changed, 12 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\nindex e43ec70fe3e4e0db..1c7b9676f52abdb6 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.cpp\n+++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n@@ -262,7 +262,7 @@ int CIO2Device::stop()\n \treturn ret;\n }\n \n-int CIO2Device::queueBuffer(Request *request, FrameBuffer *rawBuffer)\n+FrameBuffer *CIO2Device::queueBuffer(Request *request, FrameBuffer *rawBuffer)\n {\n \tFrameBuffer *buffer = rawBuffer;\n \n@@ -270,7 +270,7 @@ int CIO2Device::queueBuffer(Request *request, FrameBuffer *rawBuffer)\n \tif (!buffer) {\n \t\tif (availableBuffers_.empty()) {\n \t\t\tLOG(IPU3, Error) << \"CIO2 buffer underrun\";\n-\t\t\treturn -EINVAL;\n+\t\t\treturn nullptr;\n \t\t}\n \n \t\tbuffer = availableBuffers_.front();\n@@ -279,7 +279,11 @@ int CIO2Device::queueBuffer(Request *request, FrameBuffer *rawBuffer)\n \n \tbuffer->setRequest(request);\n \n-\treturn output_->queueBuffer(buffer);\n+\tint ret = output_->queueBuffer(buffer);\n+\tif (ret)\n+\t\treturn nullptr;\n+\n+\treturn buffer;\n }\n \n void CIO2Device::tryReturnBuffer(FrameBuffer *buffer)\ndiff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h\nindex fa813a989fd21aec..e8b491a0c104a3e2 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.h\n+++ b/src/libcamera/pipeline/ipu3/cio2.h\n@@ -52,7 +52,7 @@ public:\n \tCameraSensor *sensor() { return sensor_; }\n \tconst CameraSensor *sensor() const { return sensor_; }\n \n-\tint queueBuffer(Request *request, FrameBuffer *rawBuffer);\n+\tFrameBuffer *queueBuffer(Request *request, FrameBuffer *rawBuffer);\n \tvoid tryReturnBuffer(FrameBuffer *buffer);\n \tSignal<FrameBuffer *> &bufferReady() { return output_->bufferReady; }\n \ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex c559d160084f87e7..62e99a308a6136a7 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -643,10 +643,10 @@ int PipelineHandlerIPU3::queueRequestDevice(Camera *camera, Request *request)\n \t * Queue a buffer on the CIO2, using the raw stream buffer provided in\n \t * the request, if any, or a CIO2 internal buffer otherwise.\n \t */\n-\tFrameBuffer *rawBuffer = request->findBuffer(&data->rawStream_);\n-\terror = data->cio2_.queueBuffer(request, rawBuffer);\n-\tif (error)\n-\t\treturn error;\n+\tFrameBuffer *reqRawBuffer = request->findBuffer(&data->rawStream_);\n+\tFrameBuffer *rawBuffer = data->cio2_.queueBuffer(request, reqRawBuffer);\n+\tif (!rawBuffer)\n+\t\treturn -ENOMEM;\n \n \t/* Queue all buffers from the request aimed for the ImgU. */\n \tfor (auto it : request->buffers()) {\n",
    "prefixes": [
        "libcamera-devel",
        "05/11"
    ]
}