[libcamera-devel] libcamera: v4l2_videodevice: remove confusing memory MMAP assignment before QUERYBUF
diff mbox series

Message ID 20210203142955.1238189-1-helen.koike@collabora.com
State Accepted
Headers show
Series
  • [libcamera-devel] libcamera: v4l2_videodevice: remove confusing memory MMAP assignment before QUERYBUF
Related show

Commit Message

Helen Koike Feb. 3, 2021, 2:29 p.m. UTC
QUERYBUF doesn't require the memory field to be pre-filled.
Also, V4L2VideoDevice::createBuffer uses dmabuf file descriptors, thus
using V4L2_MEMORY_MMAP makes things confusing, so remove it.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
---
 src/libcamera/v4l2_videodevice.cpp | 1 -
 1 file changed, 1 deletion(-)

Comments

Laurent Pinchart Feb. 3, 2021, 11:17 p.m. UTC | #1
Hi Helen,

Thank you for the patch.

On Wed, Feb 03, 2021 at 11:29:55AM -0300, Helen Koike wrote:
> QUERYBUF doesn't require the memory field to be pre-filled.
> Also, V4L2VideoDevice::createBuffer uses dmabuf file descriptors, thus
> using V4L2_MEMORY_MMAP makes things confusing, so remove it.
> 
> Signed-off-by: Helen Koike <helen.koike@collabora.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera/v4l2_videodevice.cpp | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index a9509bff..c77e1aff 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -1255,7 +1255,6 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)
>  
>  	buf.index = index;
>  	buf.type = bufferType_;
> -	buf.memory = V4L2_MEMORY_MMAP;
>  	buf.length = std::size(v4l2Planes);
>  	buf.m.planes = v4l2Planes;
>

Patch
diff mbox series

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index a9509bff..c77e1aff 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1255,7 +1255,6 @@  std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)
 
 	buf.index = index;
 	buf.type = bufferType_;
-	buf.memory = V4L2_MEMORY_MMAP;
 	buf.length = std::size(v4l2Planes);
 	buf.m.planes = v4l2Planes;