| b3decc5c | 14-Jan-2024 |
Laurent Pinchart <[email protected]> |
media: mc: Expand MUST_CONNECT flag to always require an enabled link
The MEDIA_PAD_FL_MUST_CONNECT flag indicates that the pad requires an enabled link to stream, but only if it has any link at all
media: mc: Expand MUST_CONNECT flag to always require an enabled link
The MEDIA_PAD_FL_MUST_CONNECT flag indicates that the pad requires an enabled link to stream, but only if it has any link at all. This makes little sense, as if a pad is part of a pipeline, there are very few use cases for an active link to be mandatory only if links exist at all. A review of in-tree drivers confirms they all need an enabled link for pads marked with the MEDIA_PAD_FL_MUST_CONNECT flag.
Expand the scope of the flag by rejecting pads that have no links at all. This requires modifying the pipeline build code to add those pads to the pipeline.
Cc: [email protected] # 6.1 Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
show more ...
|
| 9ec9109c | 14-Jan-2024 |
Laurent Pinchart <[email protected]> |
media: mc: Rename pad variable to clarify intent
The pad local variable in the media_pipeline_explore_next_link() function is used to store the pad through which the entity has been reached. Rename
media: mc: Rename pad variable to clarify intent
The pad local variable in the media_pipeline_explore_next_link() function is used to store the pad through which the entity has been reached. Rename it to origin to reflect that and make the code easier to read. This will be even more important in subsequent commits when expanding the function with additional logic.
Cc: [email protected] # 6.1 Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
show more ...
|
| baeddf94 | 14-Jan-2024 |
Laurent Pinchart <[email protected]> |
media: mc: Add num_links flag to media_pad
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
media: mc: Add num_links flag to media_pad
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: [email protected] # 6.1 Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
show more ...
|
| 422f7af7 | 14-Jan-2024 |
Laurent Pinchart <[email protected]> |
media: mc: Fix flags handling when creating pad links
The media_create_pad_link() function doesn't correctly clear reject link type flags, nor does it set the DATA_LINK flag. It only works because t
media: mc: Fix flags handling when creating pad links
The media_create_pad_link() function doesn't correctly clear reject link type flags, nor does it set the DATA_LINK flag. It only works because the MEDIA_LNK_FL_DATA_LINK flag's value is 0.
Fix it by returning an error if any link type flag is set. This doesn't introduce any regression, as nobody calls the media_create_pad_link() function with link type flags (easily checked by grepping for the flag in the source code, there are very few hits).
Set the MEDIA_LNK_FL_DATA_LINK explicitly, which is a no-op that the compiler will optimize out, but is still useful to make the code more explicit and easier to understand.
Cc: [email protected] # 6.1 Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
show more ...
|
| 78f0daa0 | 14-Jan-2024 |
Laurent Pinchart <[email protected]> |
media: mc: Add local pad to pipeline regardless of the link state
When building pipelines by following links, the media_pipeline_explore_next_link() function only traverses enabled links. The remote
media: mc: Add local pad to pipeline regardless of the link state
When building pipelines by following links, the media_pipeline_explore_next_link() function only traverses enabled links. The remote pad of a disabled link is not added to the pipeline, and neither is the local pad. While the former is correct as disabled links should not be followed, not adding the local pad breaks processing of the MEDIA_PAD_FL_MUST_CONNECT flag.
The MEDIA_PAD_FL_MUST_CONNECT flag is checked in the __media_pipeline_start() function that iterates over all pads after populating the pipeline. If the pad is not present, the check gets skipped, rendering it useless.
Fix this by adding the local pad of all links regardless of their state, only skipping the remote pad for disabled links.
Cc: [email protected] # 6.1 Fixes: ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()") Reported-by: Frieder Schrempf <[email protected]> Closes: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
show more ...
|
| b5163545 | 12-Dec-2022 |
Laurent Pinchart <[email protected]> |
media: mc: entity: Fix minor issues in comments and documentation
Commit ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()") incorrectly referred to entity instead of pad in a comment
media: mc: entity: Fix minor issues in comments and documentation
Commit ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()") incorrectly referred to entity instead of pad in a comment, and forgot to update a second comment accordingly when moving the pipe from entity to pad. Furthermore, it didn't properly reflow the documentation text it updated.
Fix those small issues.
Fixes: ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()") Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|
| eac564de | 21-Dec-2022 |
Laurent Pinchart <[email protected]> |
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 <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|