Show a patch.

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

{
    "id": 755,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/755/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/755/",
    "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": "<20190320163055.22056-10-jacopo@jmondi.org>",
    "date": "2019-03-20T16:30:33",
    "name": "[libcamera-devel,v4,09/31] libcamera: ipu3: Implement buffer allocation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3df7a7d5c12e2da522db2588bc5f091563d75258",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/755/mbox/",
    "series": [
        {
            "id": 214,
            "url": "https://patchwork.libcamera.org/api/1.1/series/214/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=214",
            "date": "2019-03-20T16:30:24",
            "name": "libcamera: ipu3: Add ImgU support + multiple streams",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/214/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/755/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/755/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CC49B611A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Mar 2019 17:30:33 +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 relay12.mail.gandi.net (Postfix) with ESMTPSA id 57455200008;\n\tWed, 20 Mar 2019 16:30:33 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 20 Mar 2019 17:30:33 +0100",
        "Message-Id": "<20190320163055.22056-10-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190320163055.22056-1-jacopo@jmondi.org>",
        "References": "<20190320163055.22056-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 09/31] libcamera: ipu3: Implement\n\tbuffer allocation",
        "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": "Wed, 20 Mar 2019 16:30:34 -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 | 48 +++++++++++++++++++++++++---\n 1 file changed, 43 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 994c95692dd4..659a7ca4829f 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -63,6 +63,9 @@ public:\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@@ -81,6 +84,8 @@ struct CIO2Device {\n \tV4L2Device *output;\n \tV4L2Subdevice *csi2;\n \tV4L2Subdevice *sensor;\n+\n+\tBufferPool pool;\n };\n \n class PipelineHandlerIPU3 : public PipelineHandler\n@@ -108,6 +113,8 @@ public:\n private:\n \tstatic constexpr unsigned int IPU3_IMGU_COUNT = 2;\n \tstatic constexpr unsigned int IPU3_BUFFER_COUNT = 4;\n+\tstatic constexpr unsigned int IPU3_CIO2_BUFFER_COUNT = 4;\n+\tstatic constexpr unsigned int IPU3_IMGU_BUFFER_COUNT = 4;\n \n \tclass IPU3CameraData : public CameraData\n \t{\n@@ -301,16 +308,47 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera,\n \n 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-\t\treturn -EINVAL;\n+\t/* Share buffers between CIO2 output and ImgU input. */\n+\tdata->cio2.pool.createBuffers(IPU3_CIO2_BUFFER_COUNT);\n+\tret = cio2->exportBuffers(&data->cio2.pool);\n+\tif (ret) {\n+\t\tLOG(IPU3, Error) << \"Failed to reserve CIO2 memory\";\n+\t\treturn ret;\n+\t}\n+\n+\tret = input->importBuffers(&data->cio2.pool);\n+\tif (ret) {\n+\t\tLOG(IPU3, Error) << \"Failed to import ImgU memory\";\n+\t\treturn ret;\n+\t}\n+\n+\t/* Prepare the buffer pools for viewfinder and stat. */\n+\tdata->imgu->vfPool.createBuffers(IPU3_IMGU_BUFFER_COUNT);\n+\tret = viewfinder->exportBuffers(&data->imgu->vfPool);\n+\tif (ret) {\n+\t\tLOG(IPU3, Error) << \"Failed to reserve ImgU viewfinder memory\";\n+\t\treturn ret;\n+\t}\n+\n+\tdata->imgu->statPool.createBuffers(IPU3_IMGU_BUFFER_COUNT);\n+\tret = stat->exportBuffers(&data->imgu->statPool);\n+\tif (ret) {\n+\t\tLOG(IPU3, Error) << \"Failed to reserve ImgU stat memory\";\n+\t\treturn ret;\n+\t}\n \n-\tint ret = cio2->exportBuffers(&stream->bufferPool());\n+\t/* Export ImgU output buffers to the stream's pool. */\n+\tret = output->exportBuffers(&stream->bufferPool());\n \tif (ret) {\n-\t\tLOG(IPU3, Error) << \"Failed to request memory\";\n+\t\tLOG(IPU3, Error) << \"Failed to reserve ImgU output memory\";\n \t\treturn ret;\n \t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "09/31"
    ]
}