Show a patch.

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

{
    "id": 2760,
    "url": "https://patchwork.libcamera.org/api/patches/2760/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2760/",
    "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": "<20200130154137.10315-1-naush@raspberrypi.com>",
    "date": "2020-01-30T15:41:37",
    "name": "[libcamera-devel] libcamera: v4l2_videodevice: Fix V4L2 buffer cache entry availabity check",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "caa2e4747419c0e16e8c4259953508ce3270e7b2",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2760/mbox/",
    "series": [
        {
            "id": 651,
            "url": "https://patchwork.libcamera.org/api/series/651/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=651",
            "date": "2020-01-30T15:41:37",
            "name": "[libcamera-devel] libcamera: v4l2_videodevice: Fix V4L2 buffer cache entry availabity check",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/651/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2760/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2760/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<naush@raspberrypi.com>",
        "Received": [
            "from mail-wm1-x343.google.com (mail-wm1-x343.google.com\n\t[IPv6:2a00:1450:4864:20::343])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5080960448\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Jan 2020 16:43:55 +0100 (CET)",
            "by mail-wm1-x343.google.com with SMTP id s144so6717897wme.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Jan 2020 07:43:55 -0800 (PST)",
            "from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net.\n\t[212.69.50.51]) by smtp.gmail.com with ESMTPSA id\n\tc4sm6736663wml.7.2020.01.30.07.43.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 30 Jan 2020 07:43:54 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id;\n\tbh=3lXELgRwE5w9jrzZiFusyN5XF4WyCPj2oRa3E7euEGo=;\n\tb=hQ1xJM36TOwvi9G1fX9ce1W2zubWL+1SM09rRrputUugpiD2Z92yvspa4R4cwFwCX+\n\tTfcNYEPEfkMZsw/gf8M+l6vwiUkFnZIXfhNQjMJqjpcMra6PXAXlH9OuVxdST6XHQNbt\n\t9SyyegK3hOTPo3XyaEGo+bg2gq7iK/tyYuulZG+5j3YfIdpDeFTlXCKgs5izCPoWEzvw\n\tSVh1w0y/ED8BXCuj0+QK7sWd/WS5TtNIrZmpHRqCIXzE5lnUSycfYps/uXsT23y1t74V\n\th0LV4Qx5FJHoBpxpFKz62QmSa1YPOC0NSb4rOLMWhqCyQCgZKGGkGKzJ3F8g1Ua4hHWT\n\t2dCg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=3lXELgRwE5w9jrzZiFusyN5XF4WyCPj2oRa3E7euEGo=;\n\tb=tw2yn6AoNMRIUKOPf3cmyoS9VONwQPOoH+ZCtH7xI8gN2Eg2DtZEvjnTY+ibA05F8K\n\tn8AzMzBuoCXaEAwJozNqN0Rek3w2rLLC0689AU4tSXNr1Um7ew4ui+xZUHP9BXhYKwJ+\n\tbpO4JIZiV0PC+OJYsIRxDzFv0ulbAfNUNvxXN3WtrbaTKnQlgBxIs0sJxeK3gT/BbUTt\n\ttduPLoHccmaW7ZyuKTxK3vVmZqozgOwRf46fxlsLRM0oEnyz3CNwWoGzz2E6ajM5Pd4i\n\tKFNW1C0kDvC2Sg9wAwmtTgJ6jLB9AuMTS8QN4vGJc6FZbkhSZqPCYbFcr+e3VZg9KtHf\n\twunA==",
        "X-Gm-Message-State": "APjAAAWGd4QLenpUx4k+cnmxHwOq2JIQO5kOpqGesMdRfnlPRZB/e+ob\n\t2yYfoS5+XPZAfep3ZqUYDhqGjmVWaMR7cQ==",
        "X-Google-Smtp-Source": "APXvYqyaq1KfaccxegaAtW/XeViMamBaVNVEjU4MIWDHIsrNJnN6DcUxmszPXI072Mml+bmugC+FOA==",
        "X-Received": "by 2002:a7b:cb97:: with SMTP id m23mr6015167wmi.37.1580399034648;\n\tThu, 30 Jan 2020 07:43:54 -0800 (PST)",
        "From": "naush@raspberrypi.com",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 30 Jan 2020 15:41:37 +0000",
        "Message-Id": "<20200130154137.10315-1-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Fix V4L2\n\tbuffer cache entry availabity check",
        "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>",
        "X-List-Received-Date": "Thu, 30 Jan 2020 15:43:55 -0000"
    },
    "content": "From: Naushir Patuck <naush@raspberrypi.com>\n\nThe logic for keeping track of the cache holding dmabuf file descriptors\ndid not distinguish between slots that are occuiped but free and slots\nthat are not occupied.  In devices using imported dmabufs this would\nresult in ping-ponging between the top two cache entries - and that in\nturn would result in unnecessary cache missies.\n\nFix this by tracking if an entry is occupied separately from if an entry\nis free.\n\nFixes: 9e71540ebbde (\"libcamera: v4l2_videodevice: Add V4L2BufferCache to deal with index mapping\")\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/include/v4l2_videodevice.h | 1 +\n src/libcamera/v4l2_videodevice.cpp       | 6 +++---\n 2 files changed, 4 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h\nindex e4d35ab..a77b62e 100644\n--- a/src/libcamera/include/v4l2_videodevice.h\n+++ b/src/libcamera/include/v4l2_videodevice.h\n@@ -125,6 +125,7 @@ private:\n \t\tbool operator==(const FrameBuffer &buffer);\n \n \t\tbool free;\n+\t\tbool occupied;\n \n \tprivate:\n \t\tstruct Plane {\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 37b8d33..b887a38 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -212,7 +212,7 @@ int V4L2BufferCache::get(const FrameBuffer &buffer)\n \t\tif (!entry.free)\n \t\t\tcontinue;\n \n-\t\tif (use < 0)\n+\t\tif (use < 0 && !entry.occupied)\n \t\t\tuse = index;\n \n \t\t/* Try to find a cache hit by comparing the planes. */\n@@ -245,12 +245,12 @@ void V4L2BufferCache::put(unsigned int index)\n }\n \n V4L2BufferCache::Entry::Entry()\n-\t: free(true)\n+\t: free(true), occupied(false)\n {\n }\n \n V4L2BufferCache::Entry::Entry(bool free, const FrameBuffer &buffer)\n-\t: free(free)\n+\t: free(free), occupied(true)\n {\n \tfor (const FrameBuffer::Plane &plane : buffer.planes())\n \t\tplanes_.emplace_back(plane);\n",
    "prefixes": [
        "libcamera-devel"
    ]
}