Commit 8a546445 authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Mauro Carvalho Chehab

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: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent a418bb3f
...@@ -23,6 +23,15 @@ ...@@ -23,6 +23,15 @@
#include <media/v4l2-fh.h> #include <media/v4l2-fh.h>
#include <media/v4l2-ioctl.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 * Maximum stream ID is 63 for now, as we use u64 bitmask to represent a set
* of streams. * of streams.
...@@ -766,6 +775,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, ...@@ -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_routing *routing = arg;
struct v4l2_subdev_krouting *krouting; struct v4l2_subdev_krouting *krouting;
if (!v4l2_subdev_enable_streams_api)
return -ENOIOCTLCMD;
if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS))
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
...@@ -793,6 +805,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, ...@@ -793,6 +805,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,
struct v4l2_subdev_krouting krouting = {}; struct v4l2_subdev_krouting krouting = {};
unsigned int i; unsigned int i;
if (!v4l2_subdev_enable_streams_api)
return -ENOIOCTLCMD;
if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS))
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment