diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2016-11-21 14:48:30 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-01-27 16:13:24 -0200 |
commit | 20b852273642f41ce5c97601acb89185cbcee772 (patch) | |
tree | 657f4fa2c59e6928e0acf761ff9e75dfca8707f6 /drivers/staging | |
parent | 12030f489ef87dd879400d65381482a1f2177adc (diff) |
[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 'drivers/staging')
-rw-r--r-- | drivers/staging/media/davinci_vpfe/vpfe_video.c | 25 | ||||
-rw-r--r-- | drivers/staging/media/davinci_vpfe/vpfe_video.h | 2 | ||||
-rw-r--r-- | drivers/staging/media/omap4iss/iss_video.c | 32 |
3 files changed, 29 insertions, 30 deletions
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c index c27d7e9a1bdb..03269d37a376 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c @@ -129,7 +129,7 @@ __vpfe_video_get_format(struct vpfe_video_device *video, /* make a note of pipeline details */ static int vpfe_prepare_pipeline(struct vpfe_video_device *video) { - struct media_entity_graph graph; + struct media_graph graph; struct media_entity *entity = &video->video_dev.entity; struct media_device *mdev = entity->graph_obj.mdev; struct vpfe_pipeline *pipe = &video->pipe; @@ -145,13 +145,13 @@ static int vpfe_prepare_pipeline(struct vpfe_video_device *video) pipe->outputs[pipe->output_num++] = video; mutex_lock(&mdev->graph_mutex); - ret = media_entity_graph_walk_init(&graph, entity->graph_obj.mdev); + ret = media_graph_walk_init(&graph, entity->graph_obj.mdev); if (ret) { mutex_unlock(&mdev->graph_mutex); return -ENOMEM; } - media_entity_graph_walk_start(&graph, entity); - while ((entity = media_entity_graph_walk_next(&graph))) { + media_graph_walk_start(&graph, entity); + while ((entity = media_graph_walk_next(&graph))) { if (entity == &video->video_dev.entity) continue; if (!is_media_entity_v4l2_video_device(entity)) @@ -162,7 +162,7 @@ static int vpfe_prepare_pipeline(struct vpfe_video_device *video) else pipe->outputs[pipe->output_num++] = far_end; } - media_entity_graph_walk_cleanup(&graph); + media_graph_walk_cleanup(&graph); mutex_unlock(&mdev->graph_mutex); return 0; @@ -300,12 +300,11 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe) mdev = entity->graph_obj.mdev; mutex_lock(&mdev->graph_mutex); - ret = media_entity_graph_walk_init(&pipe->graph, - entity->graph_obj.mdev); + ret = media_graph_walk_init(&pipe->graph, entity->graph_obj.mdev); if (ret) goto out; - media_entity_graph_walk_start(&pipe->graph, entity); - while ((entity = media_entity_graph_walk_next(&pipe->graph))) { + media_graph_walk_start(&pipe->graph, entity); + while ((entity = media_graph_walk_next(&pipe->graph))) { if (!is_media_entity_v4l2_subdev(entity)) continue; @@ -316,7 +315,7 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe) } out: if (ret) - media_entity_graph_walk_cleanup(&pipe->graph); + media_graph_walk_cleanup(&pipe->graph); mutex_unlock(&mdev->graph_mutex); return ret; } @@ -346,9 +345,9 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) mdev = entity->graph_obj.mdev; mutex_lock(&mdev->graph_mutex); - media_entity_graph_walk_start(&pipe->graph, entity); + media_graph_walk_start(&pipe->graph, entity); - while ((entity = media_entity_graph_walk_next(&pipe->graph))) { + while ((entity = media_graph_walk_next(&pipe->graph))) { if (!is_media_entity_v4l2_subdev(entity)) continue; @@ -359,7 +358,7 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) } mutex_unlock(&mdev->graph_mutex); - media_entity_graph_walk_cleanup(&pipe->graph); + media_graph_walk_cleanup(&pipe->graph); return ret ? -ETIMEDOUT : 0; } diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.h b/drivers/staging/media/davinci_vpfe/vpfe_video.h index aaec4403df3b..22136d3dadcb 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_video.h +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.h @@ -52,7 +52,7 @@ enum vpfe_video_state { struct vpfe_pipeline { /* media pipeline */ struct media_pipeline *pipe; - struct media_entity_graph graph; + struct media_graph graph; /* state of the pipeline, continuous, * single-shot or stopped */ diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c index c16927ac8eb0..f4b0e660109f 100644 --- a/drivers/staging/media/omap4iss/iss_video.c +++ b/drivers/staging/media/omap4iss/iss_video.c @@ -205,21 +205,21 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad) static struct iss_video * iss_video_far_end(struct iss_video *video) { - struct media_entity_graph graph; + struct media_graph graph; struct media_entity *entity = &video->video.entity; struct media_device *mdev = entity->graph_obj.mdev; struct iss_video *far_end = NULL; mutex_lock(&mdev->graph_mutex); - if (media_entity_graph_walk_init(&graph, mdev)) { + if (media_graph_walk_init(&graph, mdev)) { mutex_unlock(&mdev->graph_mutex); return NULL; } - media_entity_graph_walk_start(&graph, entity); + media_graph_walk_start(&graph, entity); - while ((entity = media_entity_graph_walk_next(&graph))) { + while ((entity = media_graph_walk_next(&graph))) { if (entity == &video->video.entity) continue; @@ -235,7 +235,7 @@ iss_video_far_end(struct iss_video *video) mutex_unlock(&mdev->graph_mutex); - media_entity_graph_walk_cleanup(&graph); + media_graph_walk_cleanup(&graph); return far_end; } @@ -854,7 +854,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) { struct iss_video_fh *vfh = to_iss_video_fh(fh); struct iss_video *video = video_drvdata(file); - struct media_entity_graph graph; + struct media_graph graph; struct media_entity *entity = &video->video.entity; enum iss_pipeline_state state; struct iss_pipeline *pipe; @@ -880,19 +880,19 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) if (ret) goto err_graph_walk_init; - ret = media_entity_graph_walk_init(&graph, entity->graph_obj.mdev); + ret = media_graph_walk_init(&graph, entity->graph_obj.mdev); if (ret) goto err_graph_walk_init; if (video->iss->pdata->set_constraints) video->iss->pdata->set_constraints(video->iss, true); - ret = media_entity_pipeline_start(entity, &pipe->pipe); + ret = media_pipeline_start(entity, &pipe->pipe); if (ret < 0) - goto err_media_entity_pipeline_start; + goto err_media_pipeline_start; - media_entity_graph_walk_start(&graph, entity); - while ((entity = media_entity_graph_walk_next(&graph))) + media_graph_walk_start(&graph, entity); + while ((entity = media_graph_walk_next(&graph))) media_entity_enum_set(&pipe->ent_enum, entity); /* Verify that the currently configured format matches the output of @@ -963,7 +963,7 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) spin_unlock_irqrestore(&video->qlock, flags); } - media_entity_graph_walk_cleanup(&graph); + media_graph_walk_cleanup(&graph); mutex_unlock(&video->stream_lock); @@ -972,13 +972,13 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) err_omap4iss_set_stream: vb2_streamoff(&vfh->queue, type); err_iss_video_check_format: - media_entity_pipeline_stop(&video->video.entity); -err_media_entity_pipeline_start: + media_pipeline_stop(&video->video.entity); +err_media_pipeline_start: if (video->iss->pdata->set_constraints) video->iss->pdata->set_constraints(video->iss, false); video->queue = NULL; - media_entity_graph_walk_cleanup(&graph); + media_graph_walk_cleanup(&graph); err_graph_walk_init: media_entity_enum_cleanup(&pipe->ent_enum); @@ -1026,7 +1026,7 @@ iss_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) if (video->iss->pdata->set_constraints) video->iss->pdata->set_constraints(video->iss, false); - media_entity_pipeline_stop(&video->video.entity); + media_pipeline_stop(&video->video.entity); done: mutex_unlock(&video->stream_lock); |