Skip to content

Commit 4800021

Browse files
jwrdegoedeHans Verkuil
authored andcommitted
media: subdev: Don't report V4L2_SUBDEV_CAP_STREAMS when the streams API is disabled
Since the stream API is still experimental it is currently locked away behind the internal, default disabled, v4l2_subdev_enable_streams_api flag. Advertising V4L2_SUBDEV_CAP_STREAMS when the streams API is disabled confuses userspace. E.g. it causes the following libcamera error: ERROR SimplePipeline simple.cpp:1497 Failed to reset routes for /dev/v4l-subdev1: Inappropriate ioctl for device Don't report V4L2_SUBDEV_CAP_STREAMS when the streams API is disabled to avoid problems like this. Reported-by: Dennis Bonke <[email protected]> Fixes: 9a6b5bf ("media: add V4L2_SUBDEV_CAP_STREAMS") Cc: [email protected] # for >= 6.3 Signed-off-by: Hans de Goede <[email protected]> Acked-by: Sakari Ailus <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 10a6e5f commit 4800021

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/media/v4l2-core/v4l2-subdev.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,13 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,
502502
V4L2_SUBDEV_CLIENT_CAP_STREAMS;
503503
int rval;
504504

505+
/*
506+
* If the streams API is not enabled, remove V4L2_SUBDEV_CAP_STREAMS.
507+
* Remove this when the API is no longer experimental.
508+
*/
509+
if (!v4l2_subdev_enable_streams_api)
510+
streams_subdev = false;
511+
505512
switch (cmd) {
506513
case VIDIOC_SUBDEV_QUERYCAP: {
507514
struct v4l2_subdev_capability *cap = arg;

0 commit comments

Comments
 (0)