diff options
| author | Hans de Goede <[email protected]> | 2023-10-10 10:24:58 +0000 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2023-10-11 12:52:57 +0000 |
| commit | 4800021c630210ea0b19434a1fb56ab16385f2b3 (patch) | |
| tree | eb16780a70e22e2c56ae52fb8909b99ef575c0b4 /drivers/media/v4l2-core/v4l2-subdev.c | |
| parent | Merge tag 'drm-fixes-2023-10-13' of git://anongit.freedesktop.org/drm/drm (diff) | |
| download | kernel-4800021c630210ea0b19434a1fb56ab16385f2b3.tar.gz kernel-4800021c630210ea0b19434a1fb56ab16385f2b3.zip | |
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: 9a6b5bf4c1bb ("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]>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-subdev.c')
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-subdev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index b92348ad61f6..31752c06d1f0 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -502,6 +502,13 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, V4L2_SUBDEV_CLIENT_CAP_STREAMS; int rval; + /* + * If the streams API is not enabled, remove V4L2_SUBDEV_CAP_STREAMS. + * Remove this when the API is no longer experimental. + */ + if (!v4l2_subdev_enable_streams_api) + streams_subdev = false; + switch (cmd) { case VIDIOC_SUBDEV_QUERYCAP: { struct v4l2_subdev_capability *cap = arg; |
