Show a patch.

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

{
    "id": 22287,
    "url": "https://patchwork.libcamera.org/api/patches/22287/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22287/",
    "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": "<20241211084433.3039442-1-chenghaoyang@chromium.org>",
    "date": "2024-12-11T08:44:27",
    "name": "[v3] DmaBufAllocator: Make DmaSyncer non-copyable",
    "commit_ref": "545046a41e1767fa601c4e82608053f1912146af",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c95d985a3d2bd873bb6e6a4bb13ef2a2e4caa19d",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22287/mbox/",
    "series": [
        {
            "id": 4873,
            "url": "https://patchwork.libcamera.org/api/series/4873/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4873",
            "date": "2024-12-11T08:44:27",
            "name": "[v3] DmaBufAllocator: Make DmaSyncer non-copyable",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4873/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22287/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22287/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 584DDC32DD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Dec 2024 08:44:44 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9EC5F67EA0;\n\tWed, 11 Dec 2024 09:44:43 +0100 (CET)",
            "from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com\n\t[IPv6:2607:f8b0:4864:20::1033])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A6C066136\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Dec 2024 09:44:40 +0100 (CET)",
            "by mail-pj1-x1033.google.com with SMTP id\n\t98e67ed59e1d1-2ef8c012913so2823795a91.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Dec 2024 00:44:40 -0800 (PST)",
            "from chenghaoyang-low.c.googlers.com.com\n\t(112.212.229.35.bc.googleusercontent.com. [35.229.212.112])\n\tby smtp.gmail.com with ESMTPSA id\n\t98e67ed59e1d1-2ef4600d109sm11064544a91.44.2024.12.11.00.44.36\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 11 Dec 2024 00:44:37 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"K6f2D8FX\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1733906678; x=1734511478;\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=MgoBtlvR6GzfgMg1MnJVtj2p2Xxy0gCjmetb7vn5rBA=;\n\tb=K6f2D8FXScuMszFmVSvof0IjKSu3xBhF4QUaWb9wxXAAhu9KU84h3z0Q//BavnUJGn\n\tn2HHpjjDqCa7aSYxKOSAmBDhOi1iu7jfVXvTNQ+qipqr7PNjAgLUwD8i0UNW04rrs/S9\n\t3B4y+XOsokauvX/XypUEW0FzLbcTaXfxwjtis=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1733906678; x=1734511478;\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=MgoBtlvR6GzfgMg1MnJVtj2p2Xxy0gCjmetb7vn5rBA=;\n\tb=esfhaENcsgME7BrldpKKaXgckda79uTiM/PsWzaduQEUkJsGZn5xFLGYg9SYrLLbIm\n\tWks29x4QzKtKPTM0IfQfgEzN4IZnrD8lK4LePfPre/DWDchydNnWo6JKPTAzoWO6x484\n\tXFJ+E/31RdAKiK9A3iCtJ18uNvN7mUfL5Yvdi888Q9biBYBxaRuHTJJPytHFZ1MH65tI\n\tSKr055m+PcI9mv887gYDhJmbhk4fO8u253QwW3D57POB8G0nupcClA+ltlSXiuwAlTLF\n\tUHgv+AtgOzOmyeBJUnc7yTp2N5vOq695IleXFMqsbMCf1f5hacDwBmXls3iwx8/+5CtA\n\tZocw==",
        "X-Gm-Message-State": "AOJu0YzI66vNbHmLzv03LRf8t6YEUWBb5rxhMZ4TIqwn8tasNIPVnAOm\n\toc+PnCM05oE9Ms3k/i3q4mpKknB6rmJaqZr+45maJ7sfKUv6MY7jDhfsePPvg+uYs7fp/Y0GE+c\n\t=",
        "X-Gm-Gg": "ASbGncsGHznu0hLwur1TlBTaKO3S6uZllmpdDifvOUKKHNv3yWa2eLOT9bJFdapD160\n\thTpIwMfCD0xk+W+1OMOOmyVkr9QEcpdbAw8dvcaE2ZZ6iGqO6eayWx4nhtKZ/yvxCm0AWNY+7cj\n\tW4cCbXSKYCsLOUhZ9Ggnd1HRBqXwk3DIwR7laIRxxbzIIhRkqk/1GYPSaT5Wu0Wvx6fKFoJh5xU\n\tTEQSa6MhL80ludlvkUrN9CofJihgMFWewdQcjkMeqT8X5UkUPZmfw8DyOhFUXxHrK4OLEEyUDUG\n\tiw8p2Z4MNyKcen5yty/AwYAhccrvw1aIkvN+wp9ewqwlp/Xm4uOSLUAhVD8j",
        "X-Google-Smtp-Source": "AGHT+IEhEzjuUU+i/0FIpSYDYWmfpR5CZIZ/tI/5xHTbDTezkgjqyvPUhx2RRCgb1exUOYFHzrv+7g==",
        "X-Received": "by 2002:a17:90b:3b49:b0:2ee:cded:9ac7 with SMTP id\n\t98e67ed59e1d1-2f127fea904mr3443781a91.20.1733906678365; \n\tWed, 11 Dec 2024 00:44:38 -0800 (PST)",
        "From": "Harvey Yang <chenghaoyang@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Harvey Yang <chenghaoyang@chromium.org>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Subject": "[PATCH v3] DmaBufAllocator: Make DmaSyncer non-copyable",
        "Date": "Wed, 11 Dec 2024 08:44:27 +0000",
        "Message-ID": "<20241211084433.3039442-1-chenghaoyang@chromium.org>",
        "X-Mailer": "git-send-email 2.47.0.338.g60cca15819-goog",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "As DmaSyncer does sync start/end in the c'tor/d'tor, copying a DmaSyncer\ninstance would trigger sync end earlier than expected. This patch makes\nit non-copyable to avoid the issue.\n\nFixes: 39482d59fe71 (\"DmaBufAllocator: Add Dma Buffer synchronization function & helper class\")\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/dma_buf_allocator.h |  5 +++++\n src/libcamera/dma_buf_allocator.cpp            | 12 ++++++++++++\n 2 files changed, 17 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/dma_buf_allocator.h b/include/libcamera/internal/dma_buf_allocator.h\nindex fc5de2c13edd..d26f8a74f4c6 100644\n--- a/include/libcamera/internal/dma_buf_allocator.h\n+++ b/include/libcamera/internal/dma_buf_allocator.h\n@@ -60,9 +60,14 @@ public:\n \n \texplicit DmaSyncer(SharedFD fd, SyncType type = SyncType::ReadWrite);\n \n+\tDmaSyncer(DmaSyncer &&other) = default;\n+\tDmaSyncer &operator=(DmaSyncer &&other) = default;\n+\n \t~DmaSyncer();\n \n private:\n+\tLIBCAMERA_DISABLE_COPY(DmaSyncer)\n+\n \tvoid sync(uint64_t step);\n \n \tSharedFD fd_;\ndiff --git a/src/libcamera/dma_buf_allocator.cpp b/src/libcamera/dma_buf_allocator.cpp\nindex 3cc52f9686b0..a014c3b4263c 100644\n--- a/src/libcamera/dma_buf_allocator.cpp\n+++ b/src/libcamera/dma_buf_allocator.cpp\n@@ -311,6 +311,18 @@ DmaSyncer::DmaSyncer(SharedFD fd, SyncType type)\n \tsync(DMA_BUF_SYNC_START);\n }\n \n+/**\n+ * \\fn DmaSyncer::DmaSyncer(DmaSyncer &&other);\n+ * \\param[in] other The other instance\n+ * \\brief Enable move on class DmaSyncer\n+ */\n+\n+/**\n+ * \\fn DmaSyncer::operator=(DmaSyncer &&other);\n+ * \\param[in] other The other instance\n+ * \\brief Enable move on class DmaSyncer\n+ */\n+\n DmaSyncer::~DmaSyncer()\n {\n \tsync(DMA_BUF_SYNC_END);\n",
    "prefixes": [
        "v3"
    ]
}