]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: subdev: Improve v4l2_subdev_enable/disable_streams_fallback
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 24 Apr 2024 15:39:08 +0000 (18:39 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 4 Jun 2024 06:31:24 +0000 (08:31 +0200)
commit61d6c8c896c1ccde350c281817847a32b0c6b83b
treec6fc1e4c9b457afc4bba3531ca80367a9efd5be6
parent1d7804281df3f09f0a109d00406e859a00bae7ae
media: subdev: Improve v4l2_subdev_enable/disable_streams_fallback

v4l2_subdev_enable/disable_streams_fallback() supports falling back to
.s_stream() for subdevs with a single source pad. It also tracks the
enabled streams for that one pad in the sd->enabled_streams field.

Tracking the enabled streams with sd->enabled_streams does not make
sense, as with .s_stream() there can only be a single stream per pad.
Thus, as the v4l2_subdev_enable/disable_streams_fallback() only supports
a single source pad, all we really need is a boolean which tells whether
streaming has been enabled on this pad or not.

However, as we only need a true/false state for a pad (instead of
tracking which streams have been enabled for a pad), we can easily
extend the fallback mechanism to support multiple source pads as we only
need to keep track of which pads have been enabled.

Change the sd->enabled_streams field to sd->enabled_pads, which is a
64-bit bitmask tracking the enabled source pads. With this change we can
remove the restriction that
v4l2_subdev_enable/disable_streams_fallback() only supports a single
source pad.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/v4l2-core/v4l2-subdev.c
include/media/v4l2-subdev.h