diff mbox series

[v7,08/27] media: entity: Add has_route entity operation

Message ID 20210524104408.599645-9-tomi.valkeinen@ideasonboard.com
State Superseded
Headers show
Series v4l: subdev internal routing and streams | expand

Commit Message

Tomi Valkeinen May 24, 2021, 10:43 a.m. UTC
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The optional operation can be used by entities to report whether two
pads are internally connected.

While at there, fix a Sphinx compiler warning in a comment block a few
lines above.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 include/media/media-entity.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Jacopo Mondi July 8, 2021, 12:43 p.m. UTC | #1
Hi Tomi,
   a small note

On Mon, May 24, 2021 at 01:43:49PM +0300, Tomi Valkeinen wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>

> The optional operation can be used by entities to report whether two

> pads are internally connected.

>

> While at there, fix a Sphinx compiler warning in a comment block a few

> lines above.

>

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

> ---

>  include/media/media-entity.h | 7 +++++++

>  1 file changed, 7 insertions(+)

>

> diff --git a/include/media/media-entity.h b/include/media/media-entity.h

> index 516d73a2941e..ad4020b2df65 100644

> --- a/include/media/media-entity.h

> +++ b/include/media/media-entity.h

> @@ -187,6 +187,7 @@ enum media_pad_signal_type {

>   * @flags:	Pad flags, as defined in

>   *		:ref:`include/uapi/linux/media.h <media_header>`

>   *		(seek for ``MEDIA_PAD_FL_*``)

> + *

>   * .. note::

>   *

>   *    @stream_count reference count must never be negative, but is a signed

> @@ -214,6 +215,10 @@ struct media_pad {

>   * @link_validate:	Return whether a link is valid from the entity point of

>   *			view. The media_pipeline_start() function

>   *			validates all links by calling this operation. Optional.

> + * @has_route:		Return whether a route exists inside the entity between

> + *			two given pads. Pads are passed to the operation ordered

> + *			by index. Optional: If the operation isn't implemented


According to the next patch, this doesn't seem to be 'Optional:' :)

Thanks
   j

> + *			all pads will be considered as connected.

>   *

>   * .. note::

>   *

> @@ -227,6 +232,8 @@ struct media_entity_operations {

>  			  const struct media_pad *local,

>  			  const struct media_pad *remote, u32 flags);

>  	int (*link_validate)(struct media_link *link);

> +	bool (*has_route)(struct media_entity *entity, unsigned int pad0,

> +			  unsigned int pad1);

>  };

>

>  /**

> --

> 2.25.1

>
Sakari Ailus July 11, 2021, 3:26 p.m. UTC | #2
On Thu, Jul 08, 2021 at 02:43:10PM +0200, Jacopo Mondi wrote:
> Hi Tomi,

>    a small note

> 

> On Mon, May 24, 2021 at 01:43:49PM +0300, Tomi Valkeinen wrote:

> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> >

> > The optional operation can be used by entities to report whether two

> > pads are internally connected.

> >

> > While at there, fix a Sphinx compiler warning in a comment block a few

> > lines above.

> >

> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > Signed-off-by: Michal Simek <michal.simek@xilinx.com>

> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

> > ---

> >  include/media/media-entity.h | 7 +++++++

> >  1 file changed, 7 insertions(+)

> >

> > diff --git a/include/media/media-entity.h b/include/media/media-entity.h

> > index 516d73a2941e..ad4020b2df65 100644

> > --- a/include/media/media-entity.h

> > +++ b/include/media/media-entity.h

> > @@ -187,6 +187,7 @@ enum media_pad_signal_type {

> >   * @flags:	Pad flags, as defined in

> >   *		:ref:`include/uapi/linux/media.h <media_header>`

> >   *		(seek for ``MEDIA_PAD_FL_*``)

> > + *

> >   * .. note::

> >   *

> >   *    @stream_count reference count must never be negative, but is a signed

> > @@ -214,6 +215,10 @@ struct media_pad {

> >   * @link_validate:	Return whether a link is valid from the entity point of

> >   *			view. The media_pipeline_start() function

> >   *			validates all links by calling this operation. Optional.

> > + * @has_route:		Return whether a route exists inside the entity between

> > + *			two given pads. Pads are passed to the operation ordered

> > + *			by index. Optional: If the operation isn't implemented

> 

> According to the next patch, this doesn't seem to be 'Optional:' :)


How? Few drivers will implement this in the end, and that's been taken into
account in code AFAIU.

-- 
Sakari Ailus
Jacopo Mondi July 12, 2021, 7:42 a.m. UTC | #3
Hi Sakari,

On Sun, Jul 11, 2021 at 06:26:26PM +0300, Sakari Ailus wrote:
> On Thu, Jul 08, 2021 at 02:43:10PM +0200, Jacopo Mondi wrote:

> > Hi Tomi,

> >    a small note

> >

> > On Mon, May 24, 2021 at 01:43:49PM +0300, Tomi Valkeinen wrote:

> > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > >

> > > The optional operation can be used by entities to report whether two

> > > pads are internally connected.

> > >

> > > While at there, fix a Sphinx compiler warning in a comment block a few

> > > lines above.

> > >

> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > > Signed-off-by: Michal Simek <michal.simek@xilinx.com>

> > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

> > > ---

> > >  include/media/media-entity.h | 7 +++++++

> > >  1 file changed, 7 insertions(+)

> > >

> > > diff --git a/include/media/media-entity.h b/include/media/media-entity.h

> > > index 516d73a2941e..ad4020b2df65 100644

> > > --- a/include/media/media-entity.h

> > > +++ b/include/media/media-entity.h

> > > @@ -187,6 +187,7 @@ enum media_pad_signal_type {

> > >   * @flags:	Pad flags, as defined in

> > >   *		:ref:`include/uapi/linux/media.h <media_header>`

> > >   *		(seek for ``MEDIA_PAD_FL_*``)

> > > + *

> > >   * .. note::

> > >   *

> > >   *    @stream_count reference count must never be negative, but is a signed

> > > @@ -214,6 +215,10 @@ struct media_pad {

> > >   * @link_validate:	Return whether a link is valid from the entity point of

> > >   *			view. The media_pipeline_start() function

> > >   *			validates all links by calling this operation. Optional.

> > > + * @has_route:		Return whether a route exists inside the entity between

> > > + *			two given pads. Pads are passed to the operation ordered

> > > + *			by index. Optional: If the operation isn't implemented

> >

> > According to the next patch, this doesn't seem to be 'Optional:' :)

>

> How? Few drivers will implement this in the end, and that's been taken into

> account in code AFAIU.


What I meant is that it's not optional that all pads are considered
connected if the op is not implemented. Or maybe this should have read
as "Implementing the operation is optional" ?

>

> --

> Sakari Ailus
Sakari Ailus July 26, 2021, 6:13 p.m. UTC | #4
On Mon, Jul 12, 2021 at 09:42:20AM +0200, Jacopo Mondi wrote:
> Hi Sakari,

> 

> On Sun, Jul 11, 2021 at 06:26:26PM +0300, Sakari Ailus wrote:

> > On Thu, Jul 08, 2021 at 02:43:10PM +0200, Jacopo Mondi wrote:

> > > Hi Tomi,

> > >    a small note

> > >

> > > On Mon, May 24, 2021 at 01:43:49PM +0300, Tomi Valkeinen wrote:

> > > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > > >

> > > > The optional operation can be used by entities to report whether two

> > > > pads are internally connected.

> > > >

> > > > While at there, fix a Sphinx compiler warning in a comment block a few

> > > > lines above.

> > > >

> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > > > Signed-off-by: Michal Simek <michal.simek@xilinx.com>

> > > > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> > > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> > > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

> > > > ---

> > > >  include/media/media-entity.h | 7 +++++++

> > > >  1 file changed, 7 insertions(+)

> > > >

> > > > diff --git a/include/media/media-entity.h b/include/media/media-entity.h

> > > > index 516d73a2941e..ad4020b2df65 100644

> > > > --- a/include/media/media-entity.h

> > > > +++ b/include/media/media-entity.h

> > > > @@ -187,6 +187,7 @@ enum media_pad_signal_type {

> > > >   * @flags:	Pad flags, as defined in

> > > >   *		:ref:`include/uapi/linux/media.h <media_header>`

> > > >   *		(seek for ``MEDIA_PAD_FL_*``)

> > > > + *

> > > >   * .. note::

> > > >   *

> > > >   *    @stream_count reference count must never be negative, but is a signed

> > > > @@ -214,6 +215,10 @@ struct media_pad {

> > > >   * @link_validate:	Return whether a link is valid from the entity point of

> > > >   *			view. The media_pipeline_start() function

> > > >   *			validates all links by calling this operation. Optional.

> > > > + * @has_route:		Return whether a route exists inside the entity between

> > > > + *			two given pads. Pads are passed to the operation ordered

> > > > + *			by index. Optional: If the operation isn't implemented

> > >

> > > According to the next patch, this doesn't seem to be 'Optional:' :)

> >

> > How? Few drivers will implement this in the end, and that's been taken into

> > account in code AFAIU.

> 

> What I meant is that it's not optional that all pads are considered

> connected if the op is not implemented. Or maybe this should have read

> as "Implementing the operation is optional" ?


Fine for me. I don't think the old text was bad either though.

-- 
Sakari Ailus
diff mbox series

Patch

diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 516d73a2941e..ad4020b2df65 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -187,6 +187,7 @@  enum media_pad_signal_type {
  * @flags:	Pad flags, as defined in
  *		:ref:`include/uapi/linux/media.h <media_header>`
  *		(seek for ``MEDIA_PAD_FL_*``)
+ *
  * .. note::
  *
  *    @stream_count reference count must never be negative, but is a signed
@@ -214,6 +215,10 @@  struct media_pad {
  * @link_validate:	Return whether a link is valid from the entity point of
  *			view. The media_pipeline_start() function
  *			validates all links by calling this operation. Optional.
+ * @has_route:		Return whether a route exists inside the entity between
+ *			two given pads. Pads are passed to the operation ordered
+ *			by index. Optional: If the operation isn't implemented
+ *			all pads will be considered as connected.
  *
  * .. note::
  *
@@ -227,6 +232,8 @@  struct media_entity_operations {
 			  const struct media_pad *local,
 			  const struct media_pad *remote, u32 flags);
 	int (*link_validate)(struct media_link *link);
+	bool (*has_route)(struct media_entity *entity, unsigned int pad0,
+			  unsigned int pad1);
 };
 
 /**