media: subdev: Require code change to enable [GS]_ROUTING

The Streams API is an experimental feature. To use the Streams API, the
user needs to change a variable in v4l2-subdev.c and recompile the kernel.

This commit should be reverted when the Streams API is deemed ready for
production use.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Tomi Valkeinen 2023-01-15 13:40:08 +01:00 committed by Mauro Carvalho Chehab
parent a418bb3f30
commit 8a54644571
1 changed files with 15 additions and 0 deletions

View File

@ -23,6 +23,15 @@
#include <media/v4l2-fh.h>
#include <media/v4l2-ioctl.h>
#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
/*
* The Streams API is an experimental feature. To use the Streams API, set
* 'v4l2_subdev_enable_streams_api' to 1 below.
*/
static bool v4l2_subdev_enable_streams_api;
#endif
/*
* Maximum stream ID is 63 for now, as we use u64 bitmask to represent a set
* of streams.
@ -766,6 +775,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,
struct v4l2_subdev_routing *routing = arg;
struct v4l2_subdev_krouting *krouting;
if (!v4l2_subdev_enable_streams_api)
return -ENOIOCTLCMD;
if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS))
return -ENOIOCTLCMD;
@ -793,6 +805,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,
struct v4l2_subdev_krouting krouting = {};
unsigned int i;
if (!v4l2_subdev_enable_streams_api)
return -ENOIOCTLCMD;
if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS))
return -ENOIOCTLCMD;