[libcamera-devel] libcamera: v4l2_videodevice: Support MPLANE M2M devices

Message ID 20190816092157.30852-1-kieran.bingham@ideasonboard.com
State Accepted
Commit d209b2d4b4352b21114e129d088f15ddb381dee4
Headers show
Series
  • [libcamera-devel] libcamera: v4l2_videodevice: Support MPLANE M2M devices
Related show

Commit Message

Kieran Bingham Aug. 16, 2019, 9:21 a.m. UTC
M2M devices using MPLANE API will set the V4L2_CAP_VIDEO_M2M_MPLANE
capability flag.

Ensure that this is matched when checking for Multiplanar capabilities.

Fixes: 4f7625cca7ec ("libcamera: v4l2_videodevice: Support M2M devices")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/include/v4l2_videodevice.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Aug. 16, 2019, 9:37 a.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Fri, Aug 16, 2019 at 10:21:57AM +0100, Kieran Bingham wrote:
> M2M devices using MPLANE API will set the V4L2_CAP_VIDEO_M2M_MPLANE
> capability flag.
> 
> Ensure that this is matched when checking for Multiplanar capabilities.
> 
> Fixes: 4f7625cca7ec ("libcamera: v4l2_videodevice: Support M2M devices")
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  src/libcamera/include/v4l2_videodevice.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h
> index 0fc2dcd81d2b..4b8cf9394eb9 100644
> --- a/src/libcamera/include/v4l2_videodevice.h
> +++ b/src/libcamera/include/v4l2_videodevice.h
> @@ -50,7 +50,8 @@ struct V4L2Capability final : v4l2_capability {
>  	bool isMultiplanar() const
>  	{
>  		return device_caps() & (V4L2_CAP_VIDEO_CAPTURE_MPLANE |
> -					V4L2_CAP_VIDEO_OUTPUT_MPLANE);
> +					V4L2_CAP_VIDEO_OUTPUT_MPLANE |
> +					V4L2_CAP_VIDEO_M2M_MPLANE);
>  	}
>  	bool isCapture() const
>  	{
Niklas Söderlund Aug. 17, 2019, 3:46 p.m. UTC | #2
Hi Kieran,

Thanks for your work.

On 2019-08-16 10:21:57 +0100, Kieran Bingham wrote:
> M2M devices using MPLANE API will set the V4L2_CAP_VIDEO_M2M_MPLANE
> capability flag.
> 
> Ensure that this is matched when checking for Multiplanar capabilities.
> 
> Fixes: 4f7625cca7ec ("libcamera: v4l2_videodevice: Support M2M devices")
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/include/v4l2_videodevice.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h
> index 0fc2dcd81d2b..4b8cf9394eb9 100644
> --- a/src/libcamera/include/v4l2_videodevice.h
> +++ b/src/libcamera/include/v4l2_videodevice.h
> @@ -50,7 +50,8 @@ struct V4L2Capability final : v4l2_capability {
>  	bool isMultiplanar() const
>  	{
>  		return device_caps() & (V4L2_CAP_VIDEO_CAPTURE_MPLANE |
> -					V4L2_CAP_VIDEO_OUTPUT_MPLANE);
> +					V4L2_CAP_VIDEO_OUTPUT_MPLANE |
> +					V4L2_CAP_VIDEO_M2M_MPLANE);
>  	}
>  	bool isCapture() const
>  	{
> -- 
> 2.20.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h
index 0fc2dcd81d2b..4b8cf9394eb9 100644
--- a/src/libcamera/include/v4l2_videodevice.h
+++ b/src/libcamera/include/v4l2_videodevice.h
@@ -50,7 +50,8 @@  struct V4L2Capability final : v4l2_capability {
 	bool isMultiplanar() const
 	{
 		return device_caps() & (V4L2_CAP_VIDEO_CAPTURE_MPLANE |
-					V4L2_CAP_VIDEO_OUTPUT_MPLANE);
+					V4L2_CAP_VIDEO_OUTPUT_MPLANE |
+					V4L2_CAP_VIDEO_M2M_MPLANE);
 	}
 	bool isCapture() const
 	{