From 545046a41e1767fa601c4e82608053f1912146af Mon Sep 17 00:00:00 2001 From: Harvey Yang Date: Wed, 11 Dec 2024 08:44:27 +0000 Subject: DmaBufAllocator: Make DmaSyncer non-copyable As DmaSyncer does sync start/end in the c'tor/d'tor, copying a DmaSyncer instance would trigger sync end earlier than expected. This patch makes it non-copyable to avoid the issue. Fixes: 39482d59fe71 ("DmaBufAllocator: Add Dma Buffer synchronization function & helper class") Signed-off-by: Harvey Yang Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- include/libcamera/internal/dma_buf_allocator.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/dma_buf_allocator.h b/include/libcamera/internal/dma_buf_allocator.h index fc5de2c1..d26f8a74 100644 --- a/include/libcamera/internal/dma_buf_allocator.h +++ b/include/libcamera/internal/dma_buf_allocator.h @@ -60,9 +60,14 @@ public: explicit DmaSyncer(SharedFD fd, SyncType type = SyncType::ReadWrite); + DmaSyncer(DmaSyncer &&other) = default; + DmaSyncer &operator=(DmaSyncer &&other) = default; + ~DmaSyncer(); private: + LIBCAMERA_DISABLE_COPY(DmaSyncer) + void sync(uint64_t step); SharedFD fd_; -- cgit v1.2.1