History

[media] media: Print information on failed link validation

The Media controller doesn't tell much to the user in cases such as pipeline startup failure. The link validation is the most common media graph (or in V4L2's case, format) related reason for the failure. In more complex pipelines the reason may not always be obvious to the user, so point them to look at the right direction.

Sakari Ailus committed 12 years ago

Commit fab9d301 parent f491dbe1 file · +11 −1Browse files

Unified · Split

drivers/media/media-entity.c+11−1
@@ -279,8 +279,14 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity, · 278 unmodified lines
279279 continue;
280280
281281 ret = entity->ops->link_validate(link);
282− if (ret < 0 && ret != -ENOIOCTLCMD)
282+ if (ret < 0 && ret != -ENOIOCTLCMD) {
283+ dev_dbg(entity->parent->dev,
284+ "link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n",
285+ entity->name, link->source->index,
286+ link->sink->entity->name,
287+ link->sink->index, ret);
283288 goto error;
289+ }
284290 }
285291
286292 /* Either no links or validated links are fine. */
@@ -288,6 +294,10 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity, · 1 unmodified line
288294
289295 if (!bitmap_full(active, entity->num_pads)) {
290296 ret = -EPIPE;
297+ dev_dbg(entity->parent->dev,
298+ "\"%s\":%u must be connected by an enabled link\n",
299+ entity->name,
300+ find_first_zero_bit(active, entity->num_pads));
291301 goto error;
292302 }
293303 }