media: subdev: add v4l2_subdev_has_pad_interdep()

Add a v4l2_subdev_has_pad_interdep() helper function which can be used
for media_entity_operations.has_pad_interdep op.

It considers two pads interdependent if there is an active route between
pad0 and pad1.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Tomi Valkeinen
2021-07-15 15:39:19 +02:00
committed by Mauro Carvalho Chehab
parent 8a54644571
commit 33c0ddbe56
2 changed files with 49 additions and 0 deletions

View File

@@ -1246,6 +1246,24 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
*/
int v4l2_subdev_link_validate(struct media_link *link);
/**
* v4l2_subdev_has_pad_interdep - MC has_pad_interdep implementation for subdevs
*
* @entity: pointer to &struct media_entity
* @pad0: pad number for the first pad
* @pad1: pad number for the second pad
*
* This function is an implementation of the
* media_entity_operations.has_pad_interdep operation for subdevs that
* implement the multiplexed streams API (as indicated by the
* V4L2_SUBDEV_FL_STREAMS subdev flag).
*
* It considers two pads interdependent if there is an active route between pad0
* and pad1.
*/
bool v4l2_subdev_has_pad_interdep(struct media_entity *entity,
unsigned int pad0, unsigned int pad1);
/**
* __v4l2_subdev_state_alloc - allocate v4l2_subdev_state
*