Show a patch.

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

{
    "id": 16153,
    "url": "https://patchwork.libcamera.org/api/patches/16153/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16153/",
    "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": "<20220604093025.77737-5-jacopo@jmondi.org>",
    "date": "2022-06-04T09:30:24",
    "name": "[libcamera-devel,v3,4/5] android: camera_device: Use YUV post-processor",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "86f5f465b139d2587a28d13211f166b6dfa1d462",
    "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/16153/mbox/",
    "series": [
        {
            "id": 3160,
            "url": "https://patchwork.libcamera.org/api/series/3160/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3160",
            "date": "2022-06-04T09:30:20",
            "name": "Plumb the YUV processor in",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3160/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16153/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16153/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 2DFFCC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  4 Jun 2022 09:30:39 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7DACF65641;\n\tSat,  4 Jun 2022 11:30:38 +0200 (CEST)",
            "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 27F7465634\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Jun 2022 11:30:37 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 1C177E0007;\n\tSat,  4 Jun 2022 09:30:35 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654335038;\n\tbh=5IqrAb2t3Vlkmylr4NzqDn4geSsuBec+eiAZ/HiObao=;\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=xeaAUck4f+n+ubPHPyXmuzQO3qvgLlkyMrQEVYuVjudPTGWDugnGc6diBdiSfS8me\n\tou2N4zq1V2vknjzvzT9wykMhuP2G0FOefOX35agtOeB+A39tTmNl4TDAyuE1q/wlFC\n\tIgAY998IutEUYuyfp7t2OWgVZYQib1WsdGlxzlpyQ1mUzMXv1mjXEliNdgCtDLekAO\n\tIausBXsbX1/jOSOW1oJYhzkpjiudxx346x9JqdabRAVRSQyDj8wOJuEYTwL6mmjNYQ\n\tl5q5bNfW1OvpJe0kBzqrW/OlUM+qB1EnUav7YO40ztFTsFCQ9HMrBJ/Yz1vehzNf+v\n\tl0ab6YkB591ZQ==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat,  4 Jun 2022 11:30:24 +0200",
        "Message-Id": "<20220604093025.77737-5-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220604093025.77737-1-jacopo@jmondi.org>",
        "References": "<20220604093025.77737-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 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": "Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Jacopo Mondi <jacopo@jmondi.org>",
        "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>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 bfe61cf715c8..0be6114e3c2c 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 as 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",
        "v3",
        "4/5"
    ]
}