Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH 1/1] media: Print information on failed link validation
@ 2014-10-03 21:40 Sakari Ailus
  2014-10-28 23:10 ` [PATCH v2 " Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2014-10-03 21:40 UTC (permalink / raw)
  To: linux-media

From: Sakari Ailus <sakari.ailus@linux.intel.com>

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: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/media-entity.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 37c334e..a6cb6b6 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -279,8 +279,14 @@ __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. */
@@ -288,6 +294,11 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
 
 		if (!bitmap_full(active, entity->num_pads)) {
 			ret = -EPIPE;
+			dev_dbg(entity->parent->dev,
+				"entity %s has pad %u must be connected by an enabled link, error %d\n",
+				entity->name,
+				find_first_zero_bit(active, entity->num_pads),
+				ret);
 			goto error;
 		}
 	}
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-28 23:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-03 21:40 [PATCH 1/1] media: Print information on failed link validation Sakari Ailus
2014-10-28 23:10 ` [PATCH v2 " Sakari Ailus
2014-10-28 23:20   ` Laurent Pinchart
2014-10-28 23:33     ` Sakari Ailus
2014-10-28 23:35     ` [PATCH v3 " Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox