Patch Detail
Show a patch.
GET /api/1.1/patches/22144/?format=api
{ "id": 22144, "url": "https://patchwork.libcamera.org/api/1.1/patches/22144/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22144/", "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": "<20241129185533.3308449-2-chenghaoyang@chromium.org>", "date": "2024-11-29T18:53:28", "name": "[1/1] DmaBufAllocator: Make DmaSyncer non-copyable", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "0a07e3f7fd683bd35f300182937b7c6bf69f679f", "submitter": { "id": 117, "url": "https://patchwork.libcamera.org/api/1.1/people/117/?format=api", "name": "Cheng-Hao Yang", "email": "chenghaoyang@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22144/mbox/", "series": [ { "id": 4835, "url": "https://patchwork.libcamera.org/api/1.1/series/4835/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4835", "date": "2024-11-29T18:53:27", "name": "Make DmaSyncer non-copyable", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4835/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22144/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22144/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 37072C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 29 Nov 2024 18:55:47 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 49E5B6603A;\n\tFri, 29 Nov 2024 19:55:45 +0100 (CET)", "from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com\n\t[IPv6:2607:f8b0:4864:20::62d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99F3E6601A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Nov 2024 19:55:42 +0100 (CET)", "by mail-pl1-x62d.google.com with SMTP id\n\td9443c01a7336-2153a73edd5so9225285ad.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Nov 2024 10:55:42 -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\td9443c01a7336-21546470f46sm13661995ad.105.2024.11.29.10.55.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 29 Nov 2024 10:55:40 -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=\"TKsFC+m/\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1732906541; x=1733511341;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=UHaAzcY1zQFKwmFV571thm8Bftc2+UShocBYnjxTarE=;\n\tb=TKsFC+m/xwqme9JOHOVY+4ckH79l45yavq1bd+GR1KsD2Dqi9eifK7gYtRSCnO+exV\n\tc1X67BPMsiF9t3pVgU6+Opk0x15iLIiFUkwgzX6dmHRGQcrZKOIssge5dJg5dI/0EMno\n\tm9lxut7v4CgVxullO8UNTrWKVTh1GVzUREZJc=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1732906541; x=1733511341;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=UHaAzcY1zQFKwmFV571thm8Bftc2+UShocBYnjxTarE=;\n\tb=QNhghp6i9tcgSn2GjOrcU62NwKVFZ7o2s4RQ9EWviVSaD6UQyDxY51xB6vXuZ+ElPP\n\tcBkSl/cbN5wUcH6v1KFWZ3Q5eyYpRzGWkawjKXXb0B0um6m3b5Xb0XeVtwulc8fmzE72\n\tT+O0qKUEsbOB82oGkZwxotqs5Q7F6Hz6jXqxg1Nce5EtmwZ/v+2XKzt3bcKSUKAqfjtk\n\tAqAM3mLKOUKKYN33xMYO1EEQ86+asJew2Y7JO8yYAt0tiSDVjvfTdwVsNMD8fVXW++YH\n\tV9ePwRcK002BP55NHw4RSt26Rb6atuBxFGYMlPOmv3aJzCZsEDpIa3Zn61h9Co3f0pmj\n\tp6Eg==", "X-Gm-Message-State": "AOJu0Yw/31c2FPauMgMboJuiDnye7BtEiwxdlCAT6QsoawkGpnQ0Cdr0\n\tFq9xs63cN6UOGA/rUbOEtKs7V6TRV2z56LYhbcfVtwzCOVSKShnHy3fLvVXip3H461BIMCFbsN4\n\t=", "X-Gm-Gg": "ASbGncst/aj87+Fie1Sg2ulEqc5t9b9qpn2GpIz1aQOo/qBvClkMSP9Ii43Rx9hJ9b8\n\t6ngj0pxGH5ZiFcatO+OFkynt+BS6NiY0ovfLqIuJZMjF0EAloqbRs1ZdSgsKoYFHRbJOTXBbIfU\n\tgLMh2Kr6z7Gzvs9+WPNIck7FHAXf1DNkm64W6vIpDbb3uY/yRvmQ/aZ7/pJZz7BS3cTOXLwwStC\n\tUrxUwSj5QxZeaNNlqR1kXwdwwCq8Mgb86Dp2CV0SllwDryllGbXOLOTJtP1mBpxWoFjmzMY1Ouy\n\t9sDB+W/416wWjn18W0i/GDZfhjuVymYRlly1WbsQ+ZJLbr/rVg6lRjdz", "X-Google-Smtp-Source": "AGHT+IEgYSWbalAJV2k4wzaa4S2G1sePICmaTlYu7kgIYylFh7R38uuPS5YM+GQfTLlN+j/Ms9FZow==", "X-Received": "by 2002:a17:902:e549:b0:215:5637:447 with SMTP id\n\td9443c01a7336-2155637073amr7064765ad.51.1732906540848; \n\tFri, 29 Nov 2024 10:55:40 -0800 (PST)", "From": "Harvey Yang <chenghaoyang@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Harvey Yang <chenghaoyang@chromium.org>", "Subject": "[PATCH 1/1] DmaBufAllocator: Make DmaSyncer non-copyable", "Date": "Fri, 29 Nov 2024 18:53:28 +0000", "Message-ID": "<20241129185533.3308449-2-chenghaoyang@chromium.org>", "X-Mailer": "git-send-email 2.47.0.338.g60cca15819-goog", "In-Reply-To": "<20241129185533.3308449-1-chenghaoyang@chromium.org>", "References": "<20241129185533.3308449-1-chenghaoyang@chromium.org>", "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": "This fixes commit 39482d59fe7160740ea5dd61f3ed965a88d848ce.\n\nAs 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\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/internal/dma_buf_allocator.h | 5 +++++\n src/libcamera/dma_buf_allocator.cpp | 10 ++++++++++\n 2 files changed, 15 insertions(+)", "diff": "diff --git a/include/libcamera/internal/dma_buf_allocator.h b/include/libcamera/internal/dma_buf_allocator.h\nindex fc5de2c13..0cb209630 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 &&) = default;\n+\tDmaSyncer &operator=(DmaSyncer &&) = 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 3cc52f968..5f517828d 100644\n--- a/src/libcamera/dma_buf_allocator.cpp\n+++ b/src/libcamera/dma_buf_allocator.cpp\n@@ -311,6 +311,16 @@ DmaSyncer::DmaSyncer(SharedFD fd, SyncType type)\n \tsync(DMA_BUF_SYNC_START);\n }\n \n+/**\n+ * \\fn DmaSyncer::DmaSyncer(DmaSyncer &&) = default;\n+ * \\brief Enable move on class DmaSyncer\n+ */\n+\n+/**\n+ * \\fn DmaSyncer::operator=(DmaSyncer &&) = default;\n+ * \\brief Enable move on class DmaSyncer\n+ */\n+\n DmaSyncer::~DmaSyncer()\n {\n \tsync(DMA_BUF_SYNC_END);\n", "prefixes": [ "1/1" ] }