Show a patch.

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

{
    "id": 19146,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19146/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19146/",
    "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": "<20231018125241.17838-1-william.vinnicombe@raspberrypi.com>",
    "date": "2023-10-18T12:52:41",
    "name": "[libcamera-devel,v2] pipeline: rpi: vc4: Allocate more embedded data buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "92435f83b3818a1f7b883b366b6dbf7ed2b4f65b",
    "submitter": {
        "id": 131,
        "url": "https://patchwork.libcamera.org/api/1.1/people/131/?format=api",
        "name": "William Vinnicombe",
        "email": "william.vinnicombe@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19146/mbox/",
    "series": [
        {
            "id": 4051,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4051/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4051",
            "date": "2023-10-18T12:52:41",
            "name": "[libcamera-devel,v2] pipeline: rpi: vc4: Allocate more embedded data buffers",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4051/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19146/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19146/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 BAFE3C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Oct 2023 12:53:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 161E36296F;\n\tWed, 18 Oct 2023 14:53:02 +0200 (CEST)",
            "from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com\n\t[IPv6:2a00:1450:4864:20::22c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 21C7C61DD1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Oct 2023 14:53:00 +0200 (CEST)",
            "by mail-lj1-x22c.google.com with SMTP id\n\t38308e7fff4ca-2b9338e4695so91745391fa.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Oct 2023 05:53:00 -0700 (PDT)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tq14-20020a05600c46ce00b0040836519dd9sm1622983wmo.25.2023.10.18.05.52.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 Oct 2023 05:52:58 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697633582;\n\tbh=RNioL3kSdCwy+upaTPyzFY2nbpE25rKOGabeX1HpnvA=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=jfC0nr7fnvx1tunpc91JcV9SDGISXCQzqpAsaDfQ2yMObYfaEPXRhflEKo6KL/+G+\n\tLG7xMaedqjA1lWRMWlaBx+EBJ9LuGmibOuSVj+esONpd0XYZagU1N68gpoYu+wP/ZO\n\tSBf3OcSfljImxj6PdMTWY+TraIX4DVslIAXQyXjcJ9aa+cABkLS2F/BMCMYpmmGs6Y\n\t4NO3shMdkCnedAcK9F6d4KNR2gOEp62+A2NnDICk54eESGJFx6pCZTcbxyz/0XVuFi\n\to3/jkhldNaD15GicN5ytuTenSbBuZAS0Qelk0w6oqy7nVLtTwwk1P/Ny6U2flodpAx\n\touJCmCvCx6mGw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1697633579; x=1698238379;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=/akBn66ehZSNqNRetwyTg1ivF5hhi/1gBDHlt7HY3SA=;\n\tb=EAFapyf5SmiHYMUX1+U3f3jhLZM5+PmhRH56RMpHnAkPNXfZvmNvuPvZiopHSzdm3o\n\tmboUyAchKHpIb1EcsXHfOFJ5uA4Rjq+jBjJGiUg2KMOGC1BqO8XGDIK7DV5yKqO/pCV3\n\ta6LnYbvSMxHeSzXLBoLB7lpJe4fhCWmV7lvsSBj4Z2T5dnhFoFEpXPP1BPG6rlCIsp90\n\tIgzrGYY6pxNpvbNpyRf5KnlRnEkTG0kpaRuDQV2Hv7S4YWkUyzVDbRXEfnwcehGZe5bk\n\tPFvGRbIqV6LFoBq5hARxxtKuuFKdY8PqM6nGdAJmQpvqKCdzl0wPlHGxJIMyS9yP+6ob\n\tMDDg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"EAFapyf5\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1697633579; x=1698238379;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=/akBn66ehZSNqNRetwyTg1ivF5hhi/1gBDHlt7HY3SA=;\n\tb=HKwuQE/9atY/Ps4UE9aa6pi9EYwCfkGJo0iotHO13u93VlMeoFhBQn3BIftswzvGJy\n\txzY4uVXBxfdyvf34aSeUA6YU7YV8SybPi4PVDMcv48guBbNpW0cpCnOvpKkZGxw+I9Le\n\tRD2lWIVLWzen/V6lAMjneTbwr6C6d7IiSdSxpcvrAbxp1K4jofmIXA/GQ0h86Rn7wHPV\n\t95Pw0EPQ7joJu//qK3rxFHSrVow/PsZEGAN9KUjmDcDni691vqAJxoepYc7OLFzXDdze\n\tZlf613hGurXVj1pVFSHnJWcIEAdrGewhI6oPPmlx8MRi8+tzNkP1DjB91arE1oVUJ/Pn\n\tKxBw==",
        "X-Gm-Message-State": "AOJu0YzPlwkemIRi+G5Ukt/9I1B8aN3EyDT4s7PQMSGzqoWTFCKBaSSk\n\trEhJvemH6CbDrW0bqxfNmEAIo7JvrOdeNlqCENQ=",
        "X-Google-Smtp-Source": "AGHT+IEhErBcFdah6CHZVYjECCyu84bzgLLsqRqfFcUbC4HJOZhXY+eE972tozi8XVObOJgp6sCK2g==",
        "X-Received": "by 2002:a05:651c:388:b0:2bf:f6f6:9fd9 with SMTP id\n\te8-20020a05651c038800b002bff6f69fd9mr3357101ljp.0.1697633578696; \n\tWed, 18 Oct 2023 05:52:58 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 18 Oct 2023 13:52:41 +0100",
        "Message-Id": "<20231018125241.17838-1-william.vinnicombe@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2] pipeline: rpi: vc4: Allocate more\n\tembedded data buffers",
        "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": "William Vinnicombe via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "William Vinnicombe <william.vinnicombe@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "If the pipeline runs out of embedded data buffers, then it will pass\nthe frame to the IPA without the metadata. The IPA then has to use the\ndelayed controls as inputs to the algorithms. This can cause problems\nwith the subsequent algorithms if the sensor did not action the\ncontrols, especially with the autofocus as that doesn't have controls\nwhich can be passed in lieu of the metadata.\n\nReduce the likelihood of this by increasing the number of embedded data\nbuffers, as they are small so a generous number can be allocated.\n\nSigned-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/rpi/vc4/vc4.cpp | 17 ++++++++++++++---\n 1 file changed, 14 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\nindex 425ab9ae..d7279d02 100644\n--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n@@ -258,10 +258,21 @@ int PipelineHandlerVc4::prepareBuffers(Camera *camera)\n \n \t\t} else if (stream == &data->unicam_[Unicam::Embedded]) {\n \t\t\t/*\n-\t\t\t * Embedded data buffers are (currently) for internal use,\n-\t\t\t * so allocate the minimum required to avoid frame drops.\n+\t\t\t * Embedded data buffers are (currently) for internal use, and\n+\t\t\t * are small enough (typically 1-2KB) that we can\n+\t\t\t * allocate them generously to avoid causing problems in the\n+\t\t\t * IPA when we cannot supply the metadata.\n+\t\t\t * \n+\t\t\t * 12 are allocated as a typical application will have 8-10\n+\t\t\t * input buffers, so allocating more embedded buffers than that\n+\t\t\t * is a sensible choice.\n+\t\t\t * \n+\t\t\t * The lifetimes of these buffers are smaller than those of the\n+\t\t\t * raw buffers, so allocating a fixed number will still suffice\n+\t\t\t * if the application requests a greater number of raw\n+\t\t\t * buffers, as these will be recycled quicker.\n \t\t\t */\n-\t\t\tnumBuffers = minBuffers;\n+\t\t\tnumBuffers = 12;\n \t\t} else {\n \t\t\t/*\n \t\t\t * Since the ISP runs synchronous with the IPA and requests,\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}