summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2016-11-21 17:48:30 +0100
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-01-27 19:13:24 +0100
commit20b852273642f41ce5c97601acb89185cbcee772 (patch)
tree657f4fa2c59e6928e0acf761ff9e75dfca8707f6 /include
parent[media] media: entity: Be vocal about failing sanity checks (diff)
downloadlinux-20b852273642f41ce5c97601acb89185cbcee772.tar.xz
linux-20b852273642f41ce5c97601acb89185cbcee772.zip
[media] media: Rename graph and pipeline structs and functions
The media_entity_pipeline_start() and media_entity_pipeline_stop() functions are renamed as media_pipeline_start() and media_pipeline_stop(), respectively. The reason is two-fold: the pipeline struct is, rightly, already called media_pipeline (rather than media_entity_pipeline) and what this really is about is a pipeline. A pipeline consists of entities --- and, well, other objects embedded in these entities. As the pipeline object will be in the future moved from entities to pads in order to support multiple pipelines through a single entity, do the renaming now. Similarly, functions operating on struct media_entity_graph as well as the struct itself are renamed by dropping the "entity_" part from the prefix of the function family and the data structure. The graph traversal which is what the functions are about is not specifically about entities only and will operate on pads for the same reason as the media pipeline. The patch has been generated using the following command: git grep -l media_entity |xargs perl -i -pe ' s/media_entity_pipeline/media_pipeline/g; s/media_entity_graph/media_graph/g' And a few manual edits related to line start alignment and line wrapping. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/media-device.h2
-rw-r--r--include/media/media-entity.h65
2 files changed, 33 insertions, 34 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
index e9f1224ca45b..ae4eef416d70 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -150,7 +150,7 @@ struct media_device {
/* Serializes graph operations. */
struct mutex graph_mutex;
- struct media_entity_graph pm_count_walk;
+ struct media_graph pm_count_walk;
void *source_priv;
int (*enable_source)(struct media_entity *entity,
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 8a69550f30f8..c7c254c5bca1 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -82,7 +82,7 @@ struct media_entity_enum {
};
/**
- * struct media_entity_graph - Media graph traversal state
+ * struct media_graph - Media graph traversal state
*
* @stack: Graph traversal stack; the stack contains information
* on the path the media entities to be walked and the
@@ -90,7 +90,7 @@ struct media_entity_enum {
* @ent_enum: Visited entities
* @top: The top of the stack
*/
-struct media_entity_graph {
+struct media_graph {
struct {
struct media_entity *entity;
struct list_head *link;
@@ -108,7 +108,7 @@ struct media_entity_graph {
*/
struct media_pipeline {
int streaming_count;
- struct media_entity_graph graph;
+ struct media_graph graph;
};
/**
@@ -175,7 +175,7 @@ struct media_pad {
* return an error, in which case link setup will be
* cancelled. Optional.
* @link_validate: Return whether a link is valid from the entity point of
- * view. The media_entity_pipeline_start() function
+ * view. The media_pipeline_start() function
* validates all links by calling this operation. Optional.
*
* .. note::
@@ -816,20 +816,20 @@ struct media_pad *media_entity_remote_pad(struct media_pad *pad);
struct media_entity *media_entity_get(struct media_entity *entity);
/**
- * media_entity_graph_walk_init - Allocate resources used by graph walk.
+ * media_graph_walk_init - Allocate resources used by graph walk.
*
* @graph: Media graph structure that will be used to walk the graph
* @mdev: Pointer to the &media_device that contains the object
*/
-__must_check int media_entity_graph_walk_init(
- struct media_entity_graph *graph, struct media_device *mdev);
+__must_check int media_graph_walk_init(
+ struct media_graph *graph, struct media_device *mdev);
/**
- * media_entity_graph_walk_cleanup - Release resources used by graph walk.
+ * media_graph_walk_cleanup - Release resources used by graph walk.
*
* @graph: Media graph structure that will be used to walk the graph
*/
-void media_entity_graph_walk_cleanup(struct media_entity_graph *graph);
+void media_graph_walk_cleanup(struct media_graph *graph);
/**
* media_entity_put - Release the reference to the parent module
@@ -843,40 +843,39 @@ void media_entity_graph_walk_cleanup(struct media_entity_graph *graph);
void media_entity_put(struct media_entity *entity);
/**
- * media_entity_graph_walk_start - Start walking the media graph at a
+ * media_graph_walk_start - Start walking the media graph at a
* given entity
*
* @graph: Media graph structure that will be used to walk the graph
* @entity: Starting entity
*
- * Before using this function, media_entity_graph_walk_init() must be
+ * Before using this function, media_graph_walk_init() must be
* used to allocate resources used for walking the graph. This
* function initializes the graph traversal structure to walk the
* entities graph starting at the given entity. The traversal
* structure must not be modified by the caller during graph
* traversal. After the graph walk, the resources must be released
- * using media_entity_graph_walk_cleanup().
+ * using media_graph_walk_cleanup().
*/
-void media_entity_graph_walk_start(struct media_entity_graph *graph,
- struct media_entity *entity);
+void media_graph_walk_start(struct media_graph *graph,
+ struct media_entity *entity);
/**
- * media_entity_graph_walk_next - Get the next entity in the graph
+ * media_graph_walk_next - Get the next entity in the graph
* @graph: Media graph structure
*
* Perform a depth-first traversal of the given media entities graph.
*
* The graph structure must have been previously initialized with a call to
- * media_entity_graph_walk_start().
+ * media_graph_walk_start().
*
* Return: returns the next entity in the graph or %NULL if the whole graph
* have been traversed.
*/
-struct media_entity *
-media_entity_graph_walk_next(struct media_entity_graph *graph);
+struct media_entity *media_graph_walk_next(struct media_graph *graph);
/**
- * media_entity_pipeline_start - Mark a pipeline as streaming
+ * media_pipeline_start - Mark a pipeline as streaming
* @entity: Starting entity
* @pipe: Media pipeline to be assigned to all entities in the pipeline.
*
@@ -885,45 +884,45 @@ media_entity_graph_walk_next(struct media_entity_graph *graph);
* to every entity in the pipeline and stored in the media_entity pipe field.
*
* Calls to this function can be nested, in which case the same number of
- * media_entity_pipeline_stop() calls will be required to stop streaming. The
+ * media_pipeline_stop() calls will be required to stop streaming. The
* pipeline pointer must be identical for all nested calls to
- * media_entity_pipeline_start().
+ * media_pipeline_start().
*/
-__must_check int media_entity_pipeline_start(struct media_entity *entity,
- struct media_pipeline *pipe);
+__must_check int media_pipeline_start(struct media_entity *entity,
+ struct media_pipeline *pipe);
/**
- * __media_entity_pipeline_start - Mark a pipeline as streaming
+ * __media_pipeline_start - Mark a pipeline as streaming
*
* @entity: Starting entity
* @pipe: Media pipeline to be assigned to all entities in the pipeline.
*
- * ..note:: This is the non-locking version of media_entity_pipeline_start()
+ * ..note:: This is the non-locking version of media_pipeline_start()
*/
-__must_check int __media_entity_pipeline_start(struct media_entity *entity,
- struct media_pipeline *pipe);
+__must_check int __media_pipeline_start(struct media_entity *entity,
+ struct media_pipeline *pipe);
/**
- * media_entity_pipeline_stop - Mark a pipeline as not streaming
+ * media_pipeline_stop - Mark a pipeline as not streaming
* @entity: Starting entity
*
* Mark all entities connected to a given entity through enabled links, either
* directly or indirectly, as not streaming. The media_entity pipe field is
* reset to %NULL.
*
- * If multiple calls to media_entity_pipeline_start() have been made, the same
+ * If multiple calls to media_pipeline_start() have been made, the same
* number of calls to this function are required to mark the pipeline as not
* streaming.
*/
-void media_entity_pipeline_stop(struct media_entity *entity);
+void media_pipeline_stop(struct media_entity *entity);
/**
- * __media_entity_pipeline_stop - Mark a pipeline as not streaming
+ * __media_pipeline_stop - Mark a pipeline as not streaming
*
* @entity: Starting entity
*
- * .. note:: This is the non-locking version of media_entity_pipeline_stop()
+ * .. note:: This is the non-locking version of media_pipeline_stop()
*/
-void __media_entity_pipeline_stop(struct media_entity *entity);
+void __media_pipeline_stop(struct media_entity *entity);
/**
* media_devnode_create() - creates and initializes a device node interface