@@ -455,16 +477,51 @@ static void media_print_topology_dot(struct media_device *media)
}
static void media_print_pad_text(struct media_entity *entity,
- const struct media_pad *pad)
+ const struct media_pad *pad,
+ struct v4l2_subdev_route *routes,
+ unsigned int num_routes)
{
+ unsigned int i;
+
if (media_entity_type(entity) != MEDIA_ENT_T_V4L2_SUBDEV)
return;
- v4l2_subdev_print_format(entity, pad->index, V4L2_SUBDEV_FORMAT_ACTIVE);
- v4l2_subdev_print_pad_dv(entity, pad->index, V4L2_SUBDEV_FORMAT_ACTIVE);
+ if (!routes) {
+ v4l2_subdev_print_format(entity, pad->index, 0, V4L2_SUBDEV_FORMAT_ACTIVE);
+ v4l2_subdev_print_pad_dv(entity, pad->index, V4L2_SUBDEV_FORMAT_ACTIVE);
+
+ if (pad->flags & MEDIA_PAD_FL_SOURCE)
+ v4l2_subdev_print_subdev_dv(entity);
+
+ return;
+ }
+
+ for (i = 0; i < num_routes; ++i) {
+ const struct v4l2_subdev_route *r = &routes[i];
+ unsigned int stream;
+
+ if (!(r->flags & V4L2_SUBDEV_ROUTE_FL_ACTIVE))
+ continue;
- if (pad->flags & MEDIA_PAD_FL_SOURCE)
- v4l2_subdev_print_subdev_dv(entity);
+ if (pad->flags & MEDIA_PAD_FL_SINK) {
+ if (r->sink_pad != pad->index)
+ continue;
+
+ stream = r->sink_stream;
+ } else {
+ if (r->source_pad != pad->index)
+ continue;
+
+ stream = r->source_stream;
+ }
+
+ v4l2_subdev_print_format(entity, pad->index, stream, V4L2_SUBDEV_FORMAT_ACTIVE);
+ v4l2_subdev_print_pad_dv(entity, pad->index, V4L2_SUBDEV_FORMAT_ACTIVE);
+
+ if (pad->flags & MEDIA_PAD_FL_SOURCE)
+ v4l2_subdev_print_subdev_dv(entity);