summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2019-03-04 21:51:50 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2019-03-05 15:20:50 +0000
commit7401f5002e54dbb2f0c405d00082c4461150aea8 (patch)
tree5dde2660fa3c7fe535407e1ba632cc06368f9f64
parentcbdc4b9ad3807d31e2942690beb9cae18091ad89 (diff)
libcamera: camera: Unmap buffers before release
Buffers must have all mappings destroyed before buffers can be freed by the V4L2 device that has allocated them. Swap the ordering of freeBuffers() and destroyBuffers() to correct this. Fixes: bd38112b7795 ("libcamera: camera: Extend the interface to support capture") Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/libcamera/camera.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index 8e17085b..b4197f95 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -488,8 +488,12 @@ int Camera::freeBuffers()
if (!stream->bufferPool().count())
continue;
- pipe_->freeBuffers(this, stream);
+ /*
+ * All mappings must be destroyed before buffers can be freed
+ * by the V4L2 device that has allocated them.
+ */
stream->bufferPool().destroyBuffers();
+ pipe_->freeBuffers(this, stream);
}
state_ = CameraConfigured;