Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fab9d30b authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[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.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent f491dbe0
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -279,15 +279,25 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
				continue;

			ret = entity->ops->link_validate(link);
			if (ret < 0 && ret != -ENOIOCTLCMD)
			if (ret < 0 && ret != -ENOIOCTLCMD) {
				dev_dbg(entity->parent->dev,
					"link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n",
					entity->name, link->source->index,
					link->sink->entity->name,
					link->sink->index, ret);
				goto error;
			}
		}

		/* Either no links or validated links are fine. */
		bitmap_or(active, active, has_no_links, entity->num_pads);

		if (!bitmap_full(active, entity->num_pads)) {
			ret = -EPIPE;
			dev_dbg(entity->parent->dev,
				"\"%s\":%u must be connected by an enabled link\n",
				entity->name,
				find_first_zero_bit(active, entity->num_pads));
			goto error;
		}
	}