@@ -60,9 +60,14 @@ public:
explicit DmaSyncer(SharedFD fd, SyncType type = SyncType::ReadWrite);
+ DmaSyncer(DmaSyncer &&) = default;
+ DmaSyncer &operator=(DmaSyncer &&) = default;
+
~DmaSyncer();
private:
+ LIBCAMERA_DISABLE_COPY(DmaSyncer)
+
void sync(uint64_t step);
SharedFD fd_;
@@ -311,6 +311,16 @@ DmaSyncer::DmaSyncer(SharedFD fd, SyncType type)
sync(DMA_BUF_SYNC_START);
}
+/**
+ * \fn DmaSyncer::DmaSyncer(DmaSyncer &&) = default;
+ * \brief Enable move on class DmaSyncer
+ */
+
+/**
+ * \fn DmaSyncer::operator=(DmaSyncer &&) = default;
+ * \brief Enable move on class DmaSyncer
+ */
+
DmaSyncer::~DmaSyncer()
{
sync(DMA_BUF_SYNC_END);
This fixes commit 39482d59fe7160740ea5dd61f3ed965a88d848ce. 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. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> --- include/libcamera/internal/dma_buf_allocator.h | 5 +++++ src/libcamera/dma_buf_allocator.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+)