Show a patch.

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

{
    "id": 13355,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13355/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13355/",
    "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": "<20210814050912.15113-3-umang.jain@ideasonboard.com>",
    "date": "2021-08-14T05:09:10",
    "name": "[libcamera-devel,v3,2/4] pipeline: vimc: Allocate mock IPA buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "77c3080d933cd76ade0267b2fddd5585d467c2da",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": {
        "id": 12,
        "url": "https://patchwork.libcamera.org/api/1.1/users/12/?format=api",
        "username": "uajain",
        "first_name": "Umang",
        "last_name": "Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/13355/mbox/",
    "series": [
        {
            "id": 2358,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2358/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2358",
            "date": "2021-08-14T05:09:08",
            "name": "Pass buffers to VIMC IPA",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2358/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13355/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13355/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 39059BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 14 Aug 2021 05:09:30 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E4DE86888D;\n\tSat, 14 Aug 2021 07:09:29 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B56BA68892\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 14 Aug 2021 07:09:28 +0200 (CEST)",
            "from perceval.ideasonboard.com (unknown [103.251.226.70])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 845D73E5;\n\tSat, 14 Aug 2021 07:09:27 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"St6910U/\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628917768;\n\tbh=Tee/KMPLGPgvgC9XUtav/PFtO0gUaBitMDk58DK+Kro=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=St6910U/cvVao4gCZXChDnPeGuOnVXLFc8197KZH1/UTeG9A/3dHvGqS9O+rjYcSS\n\tQj27tusBTVBDxc5Nx3+GxVB/iD8bIPMV0r7W2E54Ud4GESFiS4yeM3EzICMAEWa//g\n\tZtLXY0SqH0D+n3W7PvluxKnoYCQqri04+SD8IJVA=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 14 Aug 2021 10:39:10 +0530",
        "Message-Id": "<20210814050912.15113-3-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210814050912.15113-1-umang.jain@ideasonboard.com>",
        "References": "<20210814050912.15113-1-umang.jain@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 2/4] pipeline: vimc: Allocate mock IPA\n\tbuffers",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "VIMC is a virtual test driver that doesn't have statistics or\nparameters buffers that are typically passed from a pipeline\nhandler to its platform IPA. To increase the test coverage going\nforward, we can atleast mimick the typical interaction of how\na pipeline handler and IPA interacts, and use it to increase the\ntest coverage.\n\nHence, create simple (single plane) dmabuf-backed FrameBuffers,\nwhich can act as mock IPA buffers and can be memory mapped(mmap)\nto VIMC IPA. To create these buffers, temporarily hijack the output\nvideo node and configure it with a V4L2DeviceFormat. Buffers then\ncan be exported from the output video node using\nV4L2VideoDevice::exportBuffers(). These buffers will be mimicked as\nIPA buffers in subsequent commits.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/vimc/vimc.cpp | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)",
    "diff": "diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 4c92729d..2dfa1418 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -50,6 +50,7 @@ public:\n \t}\n \n \tint init();\n+\tint allocateMockIPABuffers();\n \tvoid bufferReady(FrameBuffer *buffer);\n \n \tMediaDevice *media_;\n@@ -61,6 +62,7 @@ public:\n \tStream stream_;\n \n \tstd::unique_ptr<ipa::vimc::IPAProxyVimc> ipa_;\n+\tstd::vector<std::unique_ptr<FrameBuffer>> mockIPABufs_;\n };\n \n class VimcCameraConfiguration : public CameraConfiguration\n@@ -500,6 +502,12 @@ int VimcCameraData::init()\n \tif (raw_->open())\n \t\treturn -ENODEV;\n \n+\tret = allocateMockIPABuffers();\n+\tif (!ret) {\n+\t\tLOG(VIMC, Warning) << \"Cannot allocate mock IPA buffers\";\n+\t\treturn ret;\n+\t}\n+\n \t/* Initialise the supported controls. */\n \tconst ControlInfoMap &controls = sensor_->controls();\n \tControlInfoMap::Map ctrls;\n@@ -548,6 +556,21 @@ void VimcCameraData::bufferReady(FrameBuffer *buffer)\n \tpipe_->completeRequest(request);\n }\n \n+int VimcCameraData::allocateMockIPABuffers()\n+{\n+\tconstexpr unsigned int kBufCount = 2;\n+\n+\tV4L2DeviceFormat format;\n+\tformat.fourcc = video_->toV4L2PixelFormat(formats::BGR888);\n+\tformat.size = Size (160, 120);\n+\n+\tint ret = video_->setFormat(&format);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\treturn video_->exportBuffers(kBufCount, &mockIPABufs_);\n+}\n+\n REGISTER_PIPELINE_HANDLER(PipelineHandlerVimc)\n \n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "2/4"
    ]
}