Show a patch.

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

{
    "id": 16069,
    "url": "https://patchwork.libcamera.org/api/patches/16069/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16069/",
    "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": "<20220527093440.953377-5-paul.elder@ideasonboard.com>",
    "date": "2022-05-27T09:34:39",
    "name": "[libcamera-devel,v2,4/5] android: camera_device: Use YUV post-processor",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "97dd8f09ed0605e2046bab3fc60a42179144e17b",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16069/mbox/",
    "series": [
        {
            "id": 3145,
            "url": "https://patchwork.libcamera.org/api/series/3145/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3145",
            "date": "2022-05-27T09:34:35",
            "name": "Plumb the YUV processor in",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3145/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16069/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16069/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 0CACBC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 May 2022 09:35:01 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5EBC465636;\n\tFri, 27 May 2022 11:35:01 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 247D9633A1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 May 2022 11:34:59 +0200 (CEST)",
            "from pyrite.rasen.tech (softbank036240126034.bbtec.net\n\t[36.240.126.34])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 69E5932A;\n\tFri, 27 May 2022 11:34:57 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653644101;\n\tbh=7CYHVaZYnY+zkqAW+k//gmQdHxECnDVyIDvHzRif/ok=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=RLTQA09/XuZTJLeP4WUDAvUuXTC8XhSFASNeCea/mgKWaCDKT6yFPDwjqMPkHxbZ2\n\tincBjBk8/LlHc8w+mSto/Q07BvxsPVtHoC6RWI6okiMoHg5rVpq2n+6AKWKBt6ziuu\n\tYLKWp20Fy/pvIOE1orcD4A8X6l8D9UCBHCWAZgVexdW+7Eu6uqq+Ca7zqoe8bUoUpq\n\t1+7sppjM5MK8COU6jm4uUBp92bOTS5o7UIMjOx0H+cLgrQ26GccgmqsmnbZlACi9bo\n\tpqr8VbNWmLaCr/nv9rdQrbHPBK+YSMg30IRQ9JgtS9amr0kQ2KsPOFR6T8Sten7AuR\n\tJqpUWd7lgbtPA==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653644098;\n\tbh=7CYHVaZYnY+zkqAW+k//gmQdHxECnDVyIDvHzRif/ok=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ks08j0rE0AEE3qYXTsgJp6fdwjijQR2J1fX1sI3GbmNIydlKKAPaT7CesdOhVi1VG\n\t38DE62107YiSQKHVdsNdTPiaZDpivuCC4l9J5og8fpaQkQsnDL0OWCApRy3FSe9KWR\n\tFOpLzjFyVedS23CoggKnj2vw9TY2zcGIuw+MizC8="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ks08j0rE\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 27 May 2022 18:34:39 +0900",
        "Message-Id": "<20220527093440.953377-5-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20220527093440.953377-1-paul.elder@ideasonboard.com>",
        "References": "<20220527093440.953377-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 4/5] android: camera_device: Use YUV\n\tpost-processor",
        "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>",
        "From": "Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Paul Elder <paul.elder@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Hirokazu Honda <hiroh@chromium.org>\n\nWhen creating the list of StreamConfiguration to be requested to the camera,\nmap NV12 streams of equal size and format together, so that they will be\ngenerated by using the YUV post-processor.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 32 +++++++++++++++++++++++++++++---\n 1 file changed, 29 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 95c14f60..9ee34b93 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -605,14 +605,40 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \t\t\tcontinue;\n \t\t}\n \n+\t\t/*\n+\t\t * While gralloc usage flags are supposed to report usage\n+\t\t * patterns to select a suitable buffer allocation strategy, in\n+\t\t * practice they're also used to make other decisions, such as\n+\t\t * selecting the actual format for the IMPLEMENTATION_DEFINED\n+\t\t * HAL pixel format. To avoid issues, we thus have to set the\n+\t\t * GRALLOC_USAGE_HW_CAMERA_WRITE flag unconditionally, even for\n+\t\t * streams that will be produced in software.\n+\t\t */\n+\t\tstream->usage |= GRALLOC_USAGE_HW_CAMERA_WRITE;\n+\n+\t\t/*\n+\t\t * If a CameraStream with the same size and format of the\n+\t\t * current stream has already been requested, associate the two.\n+\t\t */\n+\t\tauto iter = std::find_if(\n+\t\t\tstreamConfigs.begin(), streamConfigs.end(),\n+\t\t\t[&size, &format](const Camera3StreamConfig &streamConfig) {\n+\t\t\t\treturn streamConfig.config.size == size &&\n+\t\t\t\t       streamConfig.config.pixelFormat == format;\n+\t\t\t});\n+\t\tif (iter != streamConfigs.end()) {\n+\t\t\t/* Add usage to copy the buffer in streams[0] to stream. */\n+\t\t\titer->streams[0].stream->usage |= GRALLOC_USAGE_SW_READ_OFTEN;\n+\t\t\tstream->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;\n+\t\t\titer->streams.push_back({ stream, CameraStream::Type::Mapped });\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tCamera3StreamConfig streamConfig;\n \t\tstreamConfig.streams = { { stream, CameraStream::Type::Direct } };\n \t\tstreamConfig.config.size = size;\n \t\tstreamConfig.config.pixelFormat = format;\n \t\tstreamConfigs.push_back(std::move(streamConfig));\n-\n-\t\t/* This stream will be produced by hardware. */\n-\t\tstream->usage |= GRALLOC_USAGE_HW_CAMERA_WRITE;\n \t}\n \n \t/* Now handle the MJPEG streams, adding a new stream if required. */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "4/5"
    ]
}