Show a patch.

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

{
    "id": 13064,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13064/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13064/",
    "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": "<20210721092800.1735805-1-naush@raspberrypi.com>",
    "date": "2021-07-21T09:28:00",
    "name": "[libcamera-devel] pipeline: raspberrypi: Fix a bug when clearing out Request buffers on stop",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "64ab47006dceb29e84f39b8e7273413fda294e2c",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13064/mbox/",
    "series": [
        {
            "id": 2263,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2263/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2263",
            "date": "2021-07-21T09:28:00",
            "name": "[libcamera-devel] pipeline: raspberrypi: Fix a bug when clearing out Request buffers on stop",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2263/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13064/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13064/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 47427C0109\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Jul 2021 09:28:13 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8BF0F6027A;\n\tWed, 21 Jul 2021 11:28:12 +0200 (CEST)",
            "from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 280746027A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Jul 2021 11:28:11 +0200 (CEST)",
            "by mail-wr1-x432.google.com with SMTP id c12so1421453wrt.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Jul 2021 02:28:11 -0700 (PDT)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:71d0:d02:dc34:e964])\n\tby smtp.gmail.com with ESMTPSA id\n\tp11sm25863286wro.78.2021.07.21.02.28.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 21 Jul 2021 02:28:10 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"tWtYmLbP\"; dkim-atps=neutral",
        "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:mime-version\n\t:content-transfer-encoding;\n\tbh=pxcK8Q1JMJMroEKUBaArncxKI5F80ngrYZR40U/6rfc=;\n\tb=tWtYmLbPqcbB+9SqE8J9L94wKKwUXTjFZrXFjAQgEIPUrSXBZxlmrwYWKBp50QrKS3\n\tgIiI14sjl+aRTsjPqtYrLDAK056PwTVqG0+A7nHSKOnCIgK1MSnuihLvONpNTQhFt0bU\n\tOg/qmVsswTO5z581xgbdzSS/GvLD7HIc/offB8vlOMATa5q0IpkQuJetNlLX+n83fBXV\n\tv3ba09O7oui+8EqT/XxNNF1twiPWsdgN5CuLJ5e3kLisKoQ9aeMV9tuB3DuNZDsvaWW6\n\tYmjDztHoMP1Muk1gbmuzu8CgXEV2i9jyoxHqAcfpqzCXughCSB/vPDxGYmjlk90gk3XR\n\tesNQ==",
        "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:mime-version\n\t:content-transfer-encoding;\n\tbh=pxcK8Q1JMJMroEKUBaArncxKI5F80ngrYZR40U/6rfc=;\n\tb=WD1oEvVxavEMnOGE1JHUgFKWuaM6sd9d5ccTGBDEUd4dIsTfuIQzVhOreEpH0djDic\n\tpfd2jD3J49P626eUoHAyXk3AibDjzzUlBouaZpy1cr5iUsBORKaw6NHKxM2sHUwlbxDU\n\tH6iZOTO+i8MB4PXtJ0XRYh6uqtwSwuTMtxA/VQX0Dj89RfldHVHk27Y1xV3cK+pU6yAI\n\thw69oquqRD3HUa2eqHq9udgpJTTdZAfKknmuD7ZfQ5WSf8LXXc/GslbCRN9A2TvsYo79\n\t+Olrfr+nuIhmygRMvVPDgnlXtHOSADRfQdto59H8Op1s7R2yZZXBvX43wBpMj1wdwFIP\n\tB8AA==",
        "X-Gm-Message-State": "AOAM531SRW8bYnABXD/M5ITx9FpcO79sde1Zjy1TDIpbC7M8G/69EFRZ\n\tMM6E2fsniiw4ovvFAJXZ9g1VXR6KanYoCA==",
        "X-Google-Smtp-Source": "ABdhPJyvoyFrU5OlGdpJSq/j8L35M/mVXOCayqZf8G1mygi5b6/DpnEDyxLIMLdoKWQO5rw/hGPICA==",
        "X-Received": "by 2002:adf:e4d1:: with SMTP id\n\tv17mr40454816wrm.206.1626859690519; \n\tWed, 21 Jul 2021 02:28:10 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 21 Jul 2021 10:28:00 +0100",
        "Message-Id": "<20210721092800.1735805-1-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] pipeline: raspberrypi: Fix a bug when\n\tclearing out Request buffers on stop",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When RPiCameraData::clearIncompleteRequests() clears out the request queue\nduring a stop condition, it unconditionally calls completeBuffer() on all\nbuffers in each request.  This is wrong, as a buffer could have already been\ncompleted as part of the current request, but the request itself may not yet\nhave completed.\n\nFix this by checking if the buffers in the request have been completed before\ncancelling them.\n\nFixes: d372aaa10ddb (\"pipeline: raspberrypi: Simplify RPiCameraData::clearIncompleteRequests()\")\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex f821d8fe1b6c..0bab3bedd402 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1520,8 +1520,14 @@ void RPiCameraData::clearIncompleteRequests()\n \n \t\tfor (auto &b : request->buffers()) {\n \t\t\tFrameBuffer *buffer = b.second;\n-\t\t\tbuffer->cancel();\n-\t\t\tpipe_->completeBuffer(request, buffer);\n+\t\t\t/*\n+\t\t\t * Has the buffer already been handed back to the\n+\t\t\t * request? If not, do so now.\n+\t\t\t */\n+\t\t\tif (buffer->request()) {\n+\t\t\t\tbuffer->cancel();\n+\t\t\t\tpipe_->completeBuffer(request, buffer);\n+\t\t\t}\n \t\t}\n \n \t\tpipe_->completeRequest(request);\n",
    "prefixes": [
        "libcamera-devel"
    ]
}