diff options
author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2022-08-31 16:13:35 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-09-24 09:15:52 +0200 |
commit | d9f4434513b499ddb8ba8617fba787b1ce98274e (patch) | |
tree | 2511aac5989743e07f245a6f141240add21a0d52 /include/media/media-entity.h | |
parent | 98d79dc34798cb5b3bdbc49cfc17ff63b3044b64 (diff) | |
download | linux-d9f4434513b499ddb8ba8617fba787b1ce98274e.tar.gz |
media: mc: entity: add alloc variant of pipeline_start
Add new variant of media_pipeline_start(), media_pipeline_alloc_start().
media_pipeline_alloc_start() can be used by drivers that do not need to
extend the media_pipeline. The function will either use the pipeline
already associated with the entity, if such exists, or allocate a new
pipeline.
When media_pipeline_stop() is called and the pipeline's use count drops
to zero, the pipeline is automatically freed.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media/media-entity.h')
-rw-r--r-- | include/media/media-entity.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h index aaf276f765cf..a77933afaa48 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -100,10 +100,12 @@ struct media_graph { /** * struct media_pipeline - Media pipeline related information * + * @allocated: Media pipeline allocated and freed by the framework * @start_count: Media pipeline start - stop count * @graph: Media graph walk during pipeline start / stop */ struct media_pipeline { + bool allocated; int start_count; struct media_graph graph; }; @@ -1093,6 +1095,19 @@ void media_pipeline_stop(struct media_entity *entity); void __media_pipeline_stop(struct media_entity *entity); /** + * media_pipeline_alloc_start - Mark a pipeline as streaming + * @entity: Starting entity + * + * media_pipeline_alloc_start() is similar to media_pipeline_start() but instead + * of working on a given pipeline the function will use an existing pipeline if + * the entity is already part of a pipeline, or allocate a new pipeline. + * + * Calls to media_pipeline_alloc_start() must be matched with + * media_pipeline_stop(). + */ +__must_check int media_pipeline_alloc_start(struct media_entity *entity); + +/** * media_devnode_create() - creates and initializes a device node interface * * @mdev: pointer to struct &media_device |