Show a patch.

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

{
    "id": 683,
    "url": "https://patchwork.libcamera.org/api/patches/683/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/683/",
    "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": "<20190228200410.3022-6-jacopo@jmondi.org>",
    "date": "2019-02-28T20:04:05",
    "name": "[libcamera-devel,05/10] libcamera: ipu3: Implement buffer allocation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "89c07a9c77dcefaa92877e4b7e790dbd330b9f17",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/683/mbox/",
    "series": [
        {
            "id": 199,
            "url": "https://patchwork.libcamera.org/api/series/199/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=199",
            "date": "2019-02-28T20:04:00",
            "name": "libcamera: ipu3: ImgU support",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/199/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/683/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/683/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AFE91610BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Feb 2019 21:03:49 +0100 (CET)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 43B74E0005;\n\tThu, 28 Feb 2019 20:03:49 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 28 Feb 2019 21:04:05 +0100",
        "Message-Id": "<20190228200410.3022-6-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190228200410.3022-1-jacopo@jmondi.org>",
        "References": "<20190228200410.3022-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 05/10] libcamera: ipu3: Implement buffer\n\tallocation",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Thu, 28 Feb 2019 20:03:49 -0000"
    },
    "content": "Implement buffer allocation in IPU3 pipeline handlers.\nAs the pipeline handler supports a single stream, preprare two buffer\npools for 'viewfinder' and 'stat' video devices, and export the 'output'\nvideo device buffers to the Stream's pool.\n\nShare buffers between the CIO2 output and the ImgU input video devices,\nas the output of the former should immediately be provided to the\nlatter for further processing.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 47 ++++++++++++++++++++++++----\n 1 file changed, 41 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 1e89e57f628b..c7b7973952a0 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -47,6 +47,9 @@ struct ImguDevice {\n \tV4L2Device *viewfinder;\n \tV4L2Device *stat;\n \t/* TODO: add param video device for 3A tuning */\n+\n+\tBufferPool vfPool;\n+\tBufferPool statPool;\n };\n \n struct Cio2Device {\n@@ -63,6 +66,8 @@ struct Cio2Device {\n \tV4L2Device *output;\n \tV4L2Subdevice *csi2;\n \tV4L2Subdevice *sensor;\n+\n+\tBufferPool pool;\n };\n \n class IPU3CameraData : public CameraData\n@@ -319,18 +324,48 @@ int PipelineHandlerIPU3::allocateBuffers(Camera *camera, Stream *stream)\n {\n \tconst StreamConfiguration &cfg = stream->configuration();\n \tIPU3CameraData *data = cameraData(camera);\n+\tV4L2Device *viewfinder = data->imgu->viewfinder;\n+\tV4L2Device *output = data->imgu->output;\n+\tV4L2Device *input = data->imgu->input;\n \tV4L2Device *cio2 = data->cio2.output;\n+\tV4L2Device *stat = data->imgu->stat;\n+\tint ret;\n \n-\tif (!cfg.bufferCount)\n+\tif (!cfg.bufferCount) {\n+\t\tLOG(IPU3, Error)\n+\t\t\t<< \"Invalid number of buffers: \"<< cfg.bufferCount;\n \t\treturn -EINVAL;\n-\n-\tint ret = cio2->exportBuffers(&stream->bufferPool());\n-\tif (ret) {\n-\t\tLOG(IPU3, Error) << \"Failed to request memory\";\n-\t\treturn ret;\n \t}\n \n+\t/* Share buffers between CIO2 output and ImgU input. */\n+\tdata->cio2.pool.createBuffers(IPU3_BUF_NUM);\n+\tret = cio2->exportBuffers(&data->cio2.pool);\n+\tif (ret)\n+\t\tgoto error_reserve_memory;\n+\tinput->importBuffers(&data->cio2.pool);\n+\n+\t/* Prepare the buffer pools for viewfinder and stat. */\n+\tdata->imgu->vfPool.createBuffers(IPU3_BUF_NUM);\n+\tret = viewfinder->exportBuffers(&data->imgu->vfPool);\n+\tif (ret)\n+\t\tgoto error_reserve_memory;\n+\n+\tdata->imgu->statPool.createBuffers(IPU3_BUF_NUM);\n+\tret = stat->exportBuffers(&data->imgu->statPool);\n+\tif (ret)\n+\t\tgoto error_reserve_memory;\n+\n+\t/* Export ImgU output buffers to the stream's pool. */\n+\tret = output->exportBuffers(&stream->bufferPool());\n+\tif (ret)\n+\t\tgoto error_reserve_memory;\n+\n \treturn 0;\n+\n+error_reserve_memory:\n+\tLOG(IPU3, Error) << \"Failed to reserve memory\";\n+\n+\treturn ret;\n }\n \n int PipelineHandlerIPU3::freeBuffers(Camera *camera, Stream *stream)\n",
    "prefixes": [
        "libcamera-devel",
        "05/10"
    ]
}