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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user