Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15, v6.6.14, v6.6.13, v6.6.12 |
|
#
ebb6fb7f |
| 14-Jan-2024 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc: Add num_links flag to media_pad
[ Upstream commit baeddf94aa61879b118f2faa37ed126d772670cc ]
Maintain a counter of the links connected to a pad in the media_pad structure. This helps che
media: mc: Add num_links flag to media_pad
[ Upstream commit baeddf94aa61879b118f2faa37ed126d772670cc ]
Maintain a counter of the links connected to a pad in the media_pad structure. This helps checking if a pad is connected to anything, which will be used in the pipeline building code.
Cc: stable@vger.kernel.org # 6.1 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15, v6.6.14, v6.6.13, v6.6.12 |
|
#
ebb6fb7f |
| 14-Jan-2024 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc: Add num_links flag to media_pad
[ Upstream commit baeddf94aa61879b118f2faa37ed126d772670cc ]
Maintain a counter of the links connected to a pad in the media_pad structure. This helps che
media: mc: Add num_links flag to media_pad
[ Upstream commit baeddf94aa61879b118f2faa37ed126d772670cc ]
Maintain a counter of the links connected to a pad in the media_pad structure. This helps checking if a pad is connected to anything, which will be used in the pipeline building code.
Cc: stable@vger.kernel.org # 6.1 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
Revision tags: v6.6.11, v6.6.10, v6.6.9, v6.6.8, v6.6.7, v6.6.6, v6.6.5, v6.6.4, v6.6.3, v6.6.2, v6.5.11, v6.6.1, v6.5.10, v6.6, v6.5.9, v6.5.8, v6.5.7, v6.5.6, v6.5.5, v6.5.4, v6.5.3, v6.5.2, v6.1.51, v6.5.1, v6.1.50, v6.5, v6.1.49, v6.1.48, v6.1.46, v6.1.45, v6.1.44, v6.1.43, v6.1.42, v6.1.41, v6.1.40, v6.1.39, v6.1.38, v6.1.37, v6.1.36, v6.4, v6.1.35, v6.1.34, v6.1.33, v6.1.32, v6.1.31, v6.1.30, v6.1.29, v6.1.28, v6.1.27, v6.1.26 |
|
#
4fd463e9 |
| 25-Apr-2023 |
Sakari Ailus <sakari.ailus@linux.intel.com> |
media: mc: Make media_get_pad_index() use pad type flag
Use the pad flag specifying the pad type instead of a boolean in preparation for internal source pads.
Also make the loop variable unsigned.
media: mc: Make media_get_pad_index() use pad type flag
Use the pad flag specifying the pad type instead of a boolean in preparation for internal source pads.
Also make the loop variable unsigned.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
ec178312 |
| 05-May-2023 |
Sakari Ailus <sakari.ailus@linux.intel.com> |
media: mc: Make media_entity_get_fwnode_pad() fwnode argument const
fwnode_graph_parse_endpoint() fwnode argument is now const, therefore make media_entity_get_fwnode_pad() fwnode argument const as
media: mc: Make media_entity_get_fwnode_pad() fwnode argument const
fwnode_graph_parse_endpoint() fwnode argument is now const, therefore make media_entity_get_fwnode_pad() fwnode argument const as well.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
Revision tags: v6.3, v6.1.25, v6.1.24, v6.1.23, v6.1.22, v6.1.21, v6.1.20, v6.1.19, v6.1.18, v6.1.17, v6.1.16, v6.1.15, v6.1.14, v6.1.13, v6.2, v6.1.12, v6.1.11, v6.1.10, v6.1.9, v6.1.8, v6.1.7, v6.1.6, v6.1.5, v6.0.19, v6.0.18, v6.1.4, v6.1.3, v6.0.17, v6.1.2, v6.0.16, v6.1.1, v6.0.15 |
|
#
eac564de |
| 21-Dec-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc: entity: Add entity iterator for media_pipeline
Add a media_pipeline_for_each_entity() macro to iterate over entities in a pipeline. This should be used by driver as a replacement of the m
media: mc: entity: Add entity iterator for media_pipeline
Add a media_pipeline_for_each_entity() macro to iterate over entities in a pipeline. This should be used by driver as a replacement of the media_graph_walk API, as iterating over the media_pipeline uses the cached list of pads and is thus more efficient.
Deprecate the media_graph_walk API to indicate it shouldn't be used in new drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
d10ac51e |
| 21-Dec-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc: entity: Add pad iterator for media_pipeline
Add a media_pipeline_for_each_pad() macro to iterate over pads in a pipeline. This should be used by driver as a replacement of the media_graph
media: mc: entity: Add pad iterator for media_pipeline
Add a media_pipeline_for_each_pad() macro to iterate over pads in a pipeline. This should be used by driver as a replacement of the media_graph_walk API, as iterating over the media_pipeline uses the cached list of pads and is thus more efficient.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
Revision tags: v6.0.14, v6.0.13, v6.1, v6.0.12, v6.0.11, v6.0.10, v5.15.80, v6.0.9, v5.15.79, v6.0.8, v5.15.78, v6.0.7, v5.15.77, v5.15.76, v6.0.6, v6.0.5, v5.15.75, v6.0.4, v6.0.3, v6.0.2, v5.15.74, v5.15.73, v6.0.1, v5.15.72, v6.0, v5.15.71, v5.15.70, v5.15.69, v5.15.68, v5.15.67, v5.15.66, v5.15.65, v5.15.64, v5.15.63, v5.15.62, v5.15.61, v5.15.60, v5.15.59, v5.19, v5.15.58, v5.15.57, v5.15.56, v5.15.55, v5.15.54, v5.15.53, v5.15.52, v5.15.51, v5.15.50, v5.15.49, v5.15.48, v5.15.47, v5.15.46, v5.15.45, v5.15.44, v5.15.43, v5.15.42, v5.18, v5.15.41, v5.15.40, v5.15.39, v5.15.38, v5.15.37, v5.15.36, v5.15.35, v5.15.34, v5.15.33, v5.15.32, v5.15.31, v5.17, v5.15.30, v5.15.29, v5.15.28, v5.15.27, v5.15.26, v5.15.25, v5.15.24, v5.15.23, v5.15.22, v5.15.21, v5.15.20, v5.15.19, v5.15.18, v5.15.17, v5.4.173, v5.15.16, v5.15.15 |
|
#
1ec06124 |
| 13-Jan-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
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.
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>
show more ...
|
#
a8278ad7 |
| 08-Sep-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: Fix documentation typos in media-entity.h
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
|
#
9e3576a1 |
| 31-Aug-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: mc: convert pipeline funcs to take media_pad
Now that the pipeline is stored into pads instead of entities, we can change the relevant functions to take pads instead of entities.
Signed-off-
media: mc: convert pipeline funcs to take media_pad
Now that the pipeline is stored into pads instead of entities, we can change the relevant functions to take pads instead of entities.
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>
show more ...
|
#
5b4f9a72 |
| 31-Aug-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: mc: entity: Add has_pad_interdep entity operation
Add a new media entity operation, has_pad_interdep. The optional op is used to discover the pad interdependencies inside an entity during the
media: mc: entity: Add has_pad_interdep entity operation
Add a new media entity operation, has_pad_interdep. The optional op is used to discover the pad interdependencies inside an entity during the pipeline construction.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
ae219872 |
| 31-Aug-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc: entity: Rewrite media_pipeline_start()
[Note: the code is mostly from Laurent but the patch description is from Tomi]
The media_pipeline_start() and media_pipeline_stop() functions use t
media: mc: entity: Rewrite media_pipeline_start()
[Note: the code is mostly from Laurent but the patch description is from Tomi]
The media_pipeline_start() and media_pipeline_stop() functions use the media graph walk API to traverse the graph and validate the pipeline. The graph walk traverses the media graph following links between the entities.
Also, while the pipeline can't change between the start and stop calls, the graph is walked again from scratch at stop time, or any time a driver needs to inspect the pipeline.
With the upcoming multiplexed streams support we will need a bit more intelligent pipeline construction, as e.g. two independent streams may be passing through a single entity via separate pads in which case those pads should not be part of the same pipeline.
This patch essentially rewrites the media_pipeline_start/stop so that a pipeline is defined as a set of pads instead of entities and the media graph traversal considers the pad interdependencies when choosing which links to follow.
Currently all the entity's pads are considered as interdependent. This means that the behavior with all the current drivers stays the same, but in the future we can define a more fine-grained pipeline construction.
Additionally the media pipeline's pads are cached at media_pipeline_start() time, and re-used at media_pipeline_stop() which avoid the need to re-walk the whole graph as the previous implementation did.
Also, caching pads in the pipeline can serve in the future as the foundation to provide a better API than the media graph walk to drivers to iterate over pads and entities in the pipeline.
Note that the old media_pipeline_start/stop used the media graph walk API. The new version does not use the media graph walk API, but instead a new implementation.
There are two reasons for not changing the graph walk: it proved to be rather difficult to change the graph walk to have the features implemented in this patch, and second, this keeps the backward compatibility of the graph walk as there are users of the graph walk API
The long term plan is that all the existing code would be converted to use the new cached pipeline, thus allowing us to remove the graph walk.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
d9f44345 |
| 31-Aug-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
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
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>
show more ...
|
#
72b60335 |
| 31-Aug-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc: entity: Add media_entity_pipeline() to access the media pipeline
Replace direct access to the pipe field in drivers with a new helper function. This will allow easier refactoring of media
media: mc: entity: Add media_entity_pipeline() to access the media pipeline
Replace direct access to the pipe field in drivers with a new helper function. This will allow easier refactoring of media pipeline handling in the MC core behind the scenes without affecting drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
49b38947 |
| 31-Aug-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc: entity: Merge media_entity_enum_init and __media_entity_enum_init
The media_entity_enum_init() function is a wrapper around __media_entity_enum_init() that turns a media_device pointer ar
media: mc: entity: Merge media_entity_enum_init and __media_entity_enum_init
The media_entity_enum_init() function is a wrapper around __media_entity_enum_init() that turns a media_device pointer argument into the maximum entity ID in the corresponding media graph. __media_entity_enum_init() is never used outside of media_entity_enum_init(), so the two functions can be merged together.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
8db465f7 |
| 31-Aug-2022 |
Jacopo Mondi <jacopo+renesas@jmondi.org> |
media: mc: entity: Add iterator helper for entity pads
Add an iterator helper to easily cycle through all pads in an entity and use it in media-entity and media-device code where appropriate.
Signe
media: mc: entity: Add iterator helper for entity pads
Add an iterator helper to easily cycle through all pads in an entity and use it in media-entity and media-device code where appropriate.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
b7319e2b |
| 31-Aug-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: mc: entity: Rename streaming_count -> start_count
'streaming_count' is a bit misleading name, as the count is increased with media_pipeline_start(). Let's rename it to 'start_count' instead.
media: mc: entity: Rename streaming_count -> start_count
'streaming_count' is a bit misleading name, as the count is increased with media_pipeline_start(). Let's rename it to 'start_count' instead.
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>
show more ...
|
#
c7097c80 |
| 31-Aug-2022 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
media: media-entity.h: add include for min()
./include/media/media-entity.h:595:34: error: implicit declaration of function ‘min’
Include minmax.h to get the definition for min().
Signed-off-by: T
media: media-entity.h: add include for min()
./include/media/media-entity.h:595:34: error: implicit declaration of function ‘min’
Include minmax.h to get the definition for min().
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>
show more ...
|
#
03b28286 |
| 14-Jun-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc-entity: Add a new helper function to get a remote pad for a pad
The newly added media_entity_remote_source_pad_unique() helper function handles use cases where the entity has a link enable
media: mc-entity: Add a new helper function to get a remote pad for a pad
The newly added media_entity_remote_source_pad_unique() helper function handles use cases where the entity has a link enabled uniqueness constraint covering all pads. There are use cases where the constraint covers a specific pad only. Add a new media_pad_remote_pad_unique() function to handle this. It operates as media_entity_remote_source_pad_unique(), but on a given pad instead of on the entity.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
5680fe45 |
| 14-Jun-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc-entity: Add a new helper function to get a remote pad
The media_entity_remote_pad_first() helper function returns the first remote pad it finds connected to a given pad. Beside being possi
media: mc-entity: Add a new helper function to get a remote pad
The media_entity_remote_pad_first() helper function returns the first remote pad it finds connected to a given pad. Beside being possibly non-deterministic (as it stops at the first enabled link), the fact that it returns the first match makes it unsuitable for drivers that need to guarantee that a single link is enabled, for instance when an entity can process data from one of multiple sources at a time.
For those use cases, add a new helper function, media_entity_remote_pad_unique(), that operates on an entity and returns a remote pad, with a guarantee that only one link is enabled. To ease its use in drivers, also add an inline wrapper that locates source pads specifically. A wrapper that locates sink pads can easily be added when needed.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
b2e44430 |
| 25-Jun-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: mc-entity: Rename media_entity_remote_pad() to media_pad_remote_pad_first()
The media_entity_remote_pad() is misnamed, as it operates on a pad and not an entity. Rename it to media_pad_remote
media: mc-entity: Rename media_entity_remote_pad() to media_pad_remote_pad_first()
The media_entity_remote_pad() is misnamed, as it operates on a pad and not an entity. Rename it to media_pad_remote_pad_first() to clarify its behaviour.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
1ed3d644 |
| 07-Jul-2022 |
Daniel Scally <djrscally@gmail.com> |
media: entity: Add iterator for entity data links
Iterating over the links for an entity is a somewhat common need through the media subsystem, but generally the assumption is that they will all be
media: entity: Add iterator for entity data links
Iterating over the links for an entity is a somewhat common need through the media subsystem, but generally the assumption is that they will all be data links. To meet that assumption add a new macro that iterates through an entity's links and skips non-data links.
Signed-off-by: Daniel Scally <djrscally@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
3c9b04d9 |
| 08-Apr-2022 |
Ian Jamison <ian.dev@arkver.com> |
media: media-entity.h: Fix documentation for media_create_intf_link
The documentation comment was inserted between the return type and the function name. Reunite the lines.
Signed-off-by: Ian Jamis
media: media-entity.h: Fix documentation for media_create_intf_link
The documentation comment was inserted between the return type and the function name. Reunite the lines.
Signed-off-by: Ian Jamison <ian.dev@arkver.com> Fixes: db7ee32aa185 ("[media] media-device.h: Improve documentation and update it") Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
012c87f7 |
| 02-Mar-2022 |
Daniel Scally <djrscally@gmail.com> |
media: entity: Add support for ancillary links
Add functions to create ancillary links, so that they don't need to be manually created by users.
Reviewed-by: Laurent Pinchart <laurent.pinchart@idea
media: entity: Add support for ancillary links
Add functions to create ancillary links, so that they don't need to be manually created by users.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Scally <djrscally@gmail.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
443bf23d |
| 24-Feb-2022 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: media-entity: Clarify media_entity_cleanup() usage
Being able to call cleanup functions on objects that haven't been initialized but whose memory has been zeroed simplifies error handling. Th
media: media-entity: Clarify media_entity_cleanup() usage
Being able to call cleanup functions on objects that haven't been initialized but whose memory has been zeroed simplifies error handling. The media_entity_cleanup() function documentation doesn't tell whether this is allowed or not, and inspection of its implementation doesn't provide any clue as the function is currently empty. Update the documentation to explicitly allow this usage pattern.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|
#
3056a8e9 |
| 13-Jan-2022 |
Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
media: media-entity: Simplify media_pipeline_start()
The media_pipeline_start() function has two purposes: it constructs a pipeline by recording the entities that are part of it, gathered from a gra
media: media-entity: Simplify media_pipeline_start()
The media_pipeline_start() function has two purposes: it constructs a pipeline by recording the entities that are part of it, gathered from a graph walk, and validate the media links. The pipeline pointer is stored in the media_entity structure as part of this process, and the entity's stream count is increased, to record that the entity is streaming.
When multiple video nodes are present in a pipeline, media_pipeline_start() is typically called on all of them, with the same pipeline pointer. This is taken into account in media_pipeline_start() by skipping validation for entities that are already part of the pipeline, while returning an error if an entity is part of a different pipeline.
It turns out that this process is overly complicated. When media_pipeline_start() is called for the first time, it constructs the full pipeline, adding all entities and validating all the links. Subsequent calls to media_pipeline_start() are then nearly no-ops, they only increase the stream count on the pipeline and on all entities.
The media_entity stream_count field is used for two purposes: checking if the entity is streaming, and detecting when a call to media_pipeline_stop() balances needs to reset the entity pipe pointer to NULL. The former can easily be replaced by a check of the pipe pointer.
Simplify media_pipeline_start() by avoiding the pipeline walk on all calls but the first one, and drop the media_entity stream_count field. media_pipeline_stop() is updated accordingly.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Sakari Ailus: Drop redundant '!= NULL' as discussed] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
show more ...
|