Show a patch.

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

{
    "id": 8766,
    "url": "https://patchwork.libcamera.org/api/patches/8766/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8766/",
    "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": "<20200713132451.2944673-6-kieran.bingham@ideasonboard.com>",
    "date": "2020-07-13T13:24:47",
    "name": "[libcamera-devel,5/9] libcamera: pipeline: vivid: Configure the device",
    "commit_ref": null,
    "pull_url": null,
    "state": "awaiting-upstream",
    "archived": false,
    "hash": "1b6cc72a3341004c60c42e3a59ea66cc0d554fe1",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/8766/mbox/",
    "series": [
        {
            "id": 1102,
            "url": "https://patchwork.libcamera.org/api/series/1102/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1102",
            "date": "2020-07-13T13:24:42",
            "name": "Introduce a new PipelineHandler",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1102/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8766/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8766/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 4BC31BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jul 2020 13:25:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1247B60740;\n\tMon, 13 Jul 2020 15:25:02 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A46260732\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jul 2020 15:24:58 +0200 (CEST)",
            "from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net\n\t[86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CA629C9;\n\tMon, 13 Jul 2020 15:24:57 +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=\"eckvXv51\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594646698;\n\tbh=pSoAy4XI4XXV/bNdip7z3VsfLMgi8XQoYm696m9AJb4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=eckvXv51zqla1ZExBiNPbMnbNeCYNBETPwWflum1cTeUEl7TXNWPPKEQy4+dVTyCx\n\trV3RhqqXB6C/nhjkC2btuKTYsIZ7w3RVyj3+LtyzgkJm29F5U0xsVU1LARul6XDSSX\n\tsXxwL9SK1655rM6cKnaykqJ/2Q9QNtrI+3VZOh3k=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Mon, 13 Jul 2020 14:24:47 +0100",
        "Message-Id": "<20200713132451.2944673-6-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200713132451.2944673-1-kieran.bingham@ideasonboard.com>",
        "References": "<20200713132451.2944673-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 5/9] libcamera: pipeline: vivid: Configure\n\tthe device",
        "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>",
        "Cc": "Chris Ward <chris@gregariousmammal.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When the configurations have been generated and validated, they can be\napplied to a device.\n\nVivid supports only a single stream, so it directly obtains the first\nStreamConfiguration from the CameraConfiguration.\n\nThe VIVID catpure device is a V4L2Video device, so we generate a\nV4L2DeviceFormat to apply directly to the capture device node.\n\nNote that we explicitly convert the libcamera Format stored in\ncfg.pixelFormat to a V4L2PixelFormat using the helpers provided by the\nV4L2VideoDevice to ensure that any multiplanar formats are handled\ncorrectly and accordingly.\n\nFollowing the call to set the format using the Kernel API, if the format\nhas been adjusted in any way by the kernel driver, then we have failed\nto correctly handle the validation stages, and thus the configure\noperation is idendified has having failed.\n\nFinally stream specific data can be directly stored and set as\nreflecting the state of the stream.\n\n[NOTE: the cfg.setStream() call here associates the stream to the\nStreamConfiguration however that should quite likely be done as part of\nthe validation process. TBD]\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/pipeline/vivid/vivid.cpp | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp\nindex 9e95bae8bc30..dbc19424e75a 100644\n--- a/src/libcamera/pipeline/vivid/vivid.cpp\n+++ b/src/libcamera/pipeline/vivid/vivid.cpp\n@@ -150,7 +150,26 @@ CameraConfiguration *PipelineHandlerVivid::generateConfiguration(Camera *camera,\n \n int PipelineHandlerVivid::configure(Camera *camera, CameraConfiguration *config)\n {\n-\treturn -1;\n+\tVividCameraData *data = cameraData(camera);\n+\tStreamConfiguration &cfg = config->at(0);\n+\tint ret;\n+\n+\tV4L2DeviceFormat format = {};\n+\tformat.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);\n+\tformat.size = cfg.size;\n+\n+\tret = data->video_->setFormat(&format);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (format.size != cfg.size ||\n+\t    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))\n+\t\treturn -EINVAL;\n+\n+\tcfg.setStream(&data->stream_);\n+\tcfg.stride = format.planes[0].bpl;\n+\n+\treturn 0;\n }\n \n int PipelineHandlerVivid::exportFrameBuffers(Camera *camera, Stream *stream,\n",
    "prefixes": [
        "libcamera-devel",
        "5/9"
    ]
}