Hi,
On 01/08/2022 15:37, Sakari Ailus wrote:
+u64 v4l2_subdev_state_xlate_streams(const struct v4l2_subdev_state *state,
+ u32 pad0, u32 pad1, u64 *streams);
+
/**
* enum v4l2_subdev_routing_restriction - Subdevice internal routing restrictions
*
How and where is this meant to be used?
I use it in subdev driver's .enable_streams(). E.g.:
static int ub953_enable_streams(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state, u32 pad,
u64 streams_mask)
{
struct ub953_data *priv = sd_to_ub953(sd);
struct media_pad *remote_pad;
u64 sink_streams;
int ret;
if (streams_mask & priv->enabled_source_streams)
return -EALREADY;
sink_streams = v4l2_subdev_state_xlate_streams(
state, UB953_PAD_SOURCE, UB953_PAD_SINK, &streams_mask);
remote_pad = media_entity_remote_pad(&priv->pads[UB953_PAD_SINK]);
ret = v4l2_subdev_enable_streams(priv->source_sd, remote_pad->index,
sink_streams);
if (ret)
return ret;
priv->enabled_source_streams |= streams_mask;
return 0;
}
The driver gets the source pad & stream mask, and must get the
sink pad & stream mask so that it can then call enable_streams
on its source subdev.
Tomi