summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-01-14 01:26:26 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-01-22 09:25:11 +0100
commit1ec061243edeb729ac249b278bb241a846cc8e64 (patch)
tree389c3c2f415ab06113725c83b61e6de9f3ccb8f7
parent7acd650a0484d92985a0d6d867d980c6dd019885 (diff)
downloadlinux-stable-1ec061243edeb729ac249b278bb241a846cc8e64.tar.gz
linux-stable-1ec061243edeb729ac249b278bb241a846cc8e64.tar.bz2
linux-stable-1ec061243edeb729ac249b278bb241a846cc8e64.zip
media: mc: Improve the media_entity_has_pad_interdep() documentation
Document the function parameters, the requirements on the pad0 and pad1 arguments, the locking requirements and the return value. Also improve the documentation of the corresponding .has_pad_interdep() operation, stating clearly that the operation must be called through the media_entity_has_pad_interdep() function only. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
-rw-r--r--drivers/media/mc/mc-entity.c15
-rw-r--r--include/media/media-entity.h4
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index b8bcbc734eaf..35ef52f6da6f 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -226,7 +226,13 @@ EXPORT_SYMBOL_GPL(media_entity_pads_init);
* Graph traversal
*/
-/*
+/**
+ * media_entity_has_pad_interdep - Check interdependency between two pads
+ *
+ * @entity: The entity
+ * @pad0: The first pad index
+ * @pad1: The second pad index
+ *
* This function checks the interdependency inside the entity between @pad0
* and @pad1. If two pads are interdependent they are part of the same pipeline
* and enabling one of the pads means that the other pad will become "locked"
@@ -236,6 +242,13 @@ EXPORT_SYMBOL_GPL(media_entity_pads_init);
* to check the dependency inside the entity between @pad0 and @pad1. If the
* has_pad_interdep operation is not implemented, all pads of the entity are
* considered to be interdependent.
+ *
+ * One of @pad0 and @pad1 must be a sink pad and the other one a source pad.
+ * The function returns false if both pads are sinks or sources.
+ *
+ * The caller must hold entity->graph_obj.mdev->mutex.
+ *
+ * Return: true if the pads are connected internally and false otherwise.
*/
static bool media_entity_has_pad_interdep(struct media_entity *entity,
unsigned int pad0, unsigned int pad1)
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 85ed08ddee9d..47863e8fde7b 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -242,7 +242,9 @@ struct media_pad {
* part of the same pipeline and enabling one of the pads
* means that the other pad will become "locked" and
* doesn't allow configuration changes. pad0 and pad1 are
- * guaranteed to not both be sinks or sources.
+ * guaranteed to not both be sinks or sources. Never call
+ * the .has_pad_interdep() operation directly, always use
+ * media_entity_has_pad_interdep().
* Optional: If the operation isn't implemented all pads
* will be considered as interdependent.
*