* [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
* [PATCH v2 1/1] media: Print information on failed link validation
2014-10-03 21:40 [PATCH 1/1] media: Print information on failed link validation Sakari Ailus
@ 2014-10-28 23:10 ` Sakari Ailus
2014-10-28 23:20 ` Laurent Pinchart
0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2014-10-28 23:10 UTC (permalink / raw)
To: linux-media; +Cc: laurent.pinchart
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>
---
since v1:
- Fix language in the second message.
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..a4030c3 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,
+ "\"%s\":%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
* Re: [PATCH v2 1/1] media: Print information on failed link validation
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
0 siblings, 2 replies; 5+ messages in thread
From: Laurent Pinchart @ 2014-10-28 23:20 UTC (permalink / raw)
To: Sakari Ailus; +Cc: linux-media
Hi Sakari,
Thank you for the patch.
On Wednesday 29 October 2014 01:10:04 Sakari Ailus wrote:
> 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>
> ---
> since v1:
> - Fix language in the second message.
>
> 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..a4030c3 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,
> + "\"%s\":%u must be connected by an enabled link, error %d\n",
> + entity->name,
> + find_first_zero_bit(active, entity->num_pads),
> + ret);
Given that ret is always set to -EPIPE, I wouldn't print ", error %d".
Apart from that,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> goto error;
> }
> }
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/1] media: Print information on failed link validation
2014-10-28 23:20 ` Laurent Pinchart
@ 2014-10-28 23:33 ` Sakari Ailus
2014-10-28 23:35 ` [PATCH v3 " Sakari Ailus
1 sibling, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2014-10-28 23:33 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media
Hi Laurent,
On Wed, Oct 29, 2014 at 01:20:06AM +0200, Laurent Pinchart wrote:
> > ret = -EPIPE;
> > + dev_dbg(entity->parent->dev,
> > + "\"%s\":%u must be connected by an enabled link, error %d\n",
> > + entity->name,
> > + find_first_zero_bit(active, entity->num_pads),
> > + ret);
>
> Given that ret is always set to -EPIPE, I wouldn't print ", error %d".
>
> Apart from that,
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Thanks for the ack. Good point as well, I'll fix that for v3.
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/1] media: Print information on failed link validation
2014-10-28 23:20 ` Laurent Pinchart
2014-10-28 23:33 ` Sakari Ailus
@ 2014-10-28 23:35 ` Sakari Ailus
1 sibling, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2014-10-28 23:35 UTC (permalink / raw)
To: linux-media; +Cc: laurent.pinchart
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>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
since v2:
- Omit printing -EPIPE error code since it's always the same.
drivers/media/media-entity.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index c404354..584f858 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -280,8 +280,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. */
@@ -289,6 +295,10 @@ __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,
+ "\"%s\":%u must be connected by an enabled link\n",
+ entity->name,
+ find_first_zero_bit(active, entity->num_pads));
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