media: mc: entity: add alloc variant of pipeline_start
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 31 Aug 2022 14:13:35 +0000 (16:13 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 24 Sep 2022 07:15:52 +0000 (09:15 +0200)
commitd9f4434513b499ddb8ba8617fba787b1ce98274e
tree2511aac5989743e07f245a6f141240add21a0d52
parent98d79dc34798cb5b3bdbc49cfc17ff63b3044b64
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>
drivers/media/mc/mc-entity.c
drivers/media/v4l2-core/v4l2-dev.c
include/media/media-entity.h
include/media/v4l2-dev.h