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: bd38112b77 ("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>
This commit is contained in:
Kieran Bingham
2019-03-04 21:51:50 +00:00
parent cbdc4b9ad3
commit 7401f5002e
+5 -1
View File
@@ -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;