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 --- src/libcamera/dma_buf_allocator.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/libcamera/dma_buf_allocator.cpp b/src/libcamera/dma_buf_allocator.cpp index 3cc52f96..a014c3b4 100644 --- a/src/libcamera/dma_buf_allocator.cpp +++ b/src/libcamera/dma_buf_allocator.cpp @@ -311,6 +311,18 @@ DmaSyncer::DmaSyncer(SharedFD fd, SyncType type) sync(DMA_BUF_SYNC_START); } +/** + * \fn DmaSyncer::DmaSyncer(DmaSyncer &&other); + * \param[in] other The other instance + * \brief Enable move on class DmaSyncer + */ + +/** + * \fn DmaSyncer::operator=(DmaSyncer &&other); + * \param[in] other The other instance + * \brief Enable move on class DmaSyncer + */ + DmaSyncer::~DmaSyncer() { sync(DMA_BUF_SYNC_END); -- cgit v1.2.1