<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/media/mc/mc-entity.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-06-16T11:50:58Z</updated>
<entry>
<title>media: mc: Fix graph walk in media_pipeline_start</title>
<updated>2024-06-16T11:50:58Z</updated>
<author>
<name>Tomi Valkeinen</name>
</author>
<published>2024-03-18T09:50:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bee9440bc0b6b3b7432f7bfde28656262a3484a2'/>
<id>urn:sha1:bee9440bc0b6b3b7432f7bfde28656262a3484a2</id>
<content type='text'>
commit 8a9d420149c477e7c97fbd6453704e4612bdd3fa upstream.

The graph walk tries to follow all links, even if they are not between
pads. This causes a crash with, e.g. a MEDIA_LNK_FL_ANCILLARY_LINK link.

Fix this by allowing the walk to proceed only for MEDIA_LNK_FL_DATA_LINK
links.

Signed-off-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Cc: stable@vger.kernel.org # for 6.1 and later
Fixes: ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()")
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>media: mc: Expand MUST_CONNECT flag to always require an enabled link</title>
<updated>2024-02-05T13:29:34Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2024-01-14T23:04:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3decc5ce7d778224d266423b542326ad469cb5f'/>
<id>urn:sha1:b3decc5ce7d778224d266423b542326ad469cb5f</id>
<content type='text'>
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: stable@vger.kernel.org # 6.1
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: Rename pad variable to clarify intent</title>
<updated>2024-02-05T13:29:34Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2024-01-14T22:30:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ec9109cf9f611e3ec9ed0355afcc7aae5e73176'/>
<id>urn:sha1:9ec9109cf9f611e3ec9ed0355afcc7aae5e73176</id>
<content type='text'>
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: stable@vger.kernel.org # 6.1
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: Add num_links flag to media_pad</title>
<updated>2024-02-05T13:29:34Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2024-01-14T22:30:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=baeddf94aa61879b118f2faa37ed126d772670cc'/>
<id>urn:sha1:baeddf94aa61879b118f2faa37ed126d772670cc</id>
<content type='text'>
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 &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: Fix flags handling when creating pad links</title>
<updated>2024-02-05T13:29:34Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2024-01-14T22:24:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=422f7af75d03d50895938d38bc9cb8be759c440f'/>
<id>urn:sha1:422f7af75d03d50895938d38bc9cb8be759c440f</id>
<content type='text'>
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: stable@vger.kernel.org # 6.1
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: Add local pad to pipeline regardless of the link state</title>
<updated>2024-02-05T13:29:34Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2024-01-14T13:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78f0daa026d4c5e192d31801d1be6caf88250220'/>
<id>urn:sha1:78f0daa026d4c5e192d31801d1be6caf88250220</id>
<content type='text'>
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: stable@vger.kernel.org # 6.1
Fixes: ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()")
Reported-by: Frieder Schrempf &lt;frieder.schrempf@kontron.de&gt;
Closes: https://lore.kernel.org/linux-media/7658a15a-80c5-219f-2477-2a94ba6c6ba1@kontron.de
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: Check pad flag validity</title>
<updated>2023-10-07T08:55:48Z</updated>
<author>
<name>Sakari Ailus</name>
</author>
<published>2023-04-25T09:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=deb866f9e3a45ae058b21765feeffae6aea6a193'/>
<id>urn:sha1:deb866f9e3a45ae058b21765feeffae6aea6a193</id>
<content type='text'>
Check the validity of pad flags on entity init. Exactly one of the flags
must be set.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: Make media_get_pad_index() use pad type flag</title>
<updated>2023-05-25T14:21:22Z</updated>
<author>
<name>Sakari Ailus</name>
</author>
<published>2023-04-25T10:23:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4fd463e9389f9c5ea00a327b4ff01daf5869e774'/>
<id>urn:sha1:4fd463e9389f9c5ea00a327b4ff01daf5869e774</id>
<content type='text'>
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 &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: Make media_entity_get_fwnode_pad() fwnode argument const</title>
<updated>2023-05-25T14:21:21Z</updated>
<author>
<name>Sakari Ailus</name>
</author>
<published>2023-05-05T13:27:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec178312b81448b30947b2cb66b849e4bf43d941'/>
<id>urn:sha1:ec178312b81448b30947b2cb66b849e4bf43d941</id>
<content type='text'>
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 &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mc: entity: Fix minor issues in comments and documentation</title>
<updated>2023-02-06T07:37:12Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2022-12-12T13:25:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b516354542b71632438d33920f6ce7478ecab0ce'/>
<id>urn:sha1:b516354542b71632438d33920f6ce7478ecab0ce</id>
<content type='text'>
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 &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
</feed>
