public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: linux-media@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-renesas-soc@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Benoit Parrot <bparrot@ti.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: Re: [PATCH/RFC v2 14/15] adv748x: csi2: add get_routing support
Date: Mon, 18 Dec 2017 23:58:02 +0100	[thread overview]
Message-ID: <20171218225802.GD32148@bigcity.dyn.berto.se> (raw)
In-Reply-To: <23bd28e2-5949-da25-b3e6-84f6d20dd8ef@ideasonboard.com>

Hi Kieran,

Thanks for your comments,

On 2017-12-14 23:27:57 +0000, Kieran Bingham wrote:
> Hi Niklas,
> 
> On 14/12/17 19:08, Niklas Söderlund wrote:
> > To support multiplexed streams the internal routing between the
> > adv748x sink pad and its source pad needs to be described.
> 
> The adv748x has quite a few sink and source pads... I presume here you mean the
> adv748x csi2 sink and source pad :D

Yes :-) Will fix for next version, thanks.

> 
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > ---
> >  drivers/media/i2c/adv748x/adv748x-csi2.c | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c b/drivers/media/i2c/adv748x/adv748x-csi2.c
> > index 291b35bef49d41fb..dbefb53f5b8c414d 100644
> > --- a/drivers/media/i2c/adv748x/adv748x-csi2.c
> > +++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
> > @@ -262,10 +262,32 @@ static int adv748x_csi2_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
> >  	return 0;
> >  }
> >  
> > +static int adv748x_csi2_get_routing(struct v4l2_subdev *subdev,
> > +				    struct v4l2_subdev_routing *routing)
> > +{
> > +	struct v4l2_subdev_route *r = routing->routes;
> > +
> > +	if (routing->num_routes < 1) {
> > +		routing->num_routes = 1;
> > +		return -ENOSPC;
> > +	}
> > +
> > +	routing->num_routes = 1;
> > +
> > +	r->sink_pad = ADV748X_CSI2_SINK;
> > +	r->sink_stream = 0;
> > +	r->source_pad = ADV748X_CSI2_SOURCE;
> > +	r->source_stream = 0;
> > +	r->flags = V4L2_SUBDEV_ROUTE_FL_ACTIVE | V4L2_SUBDEV_ROUTE_FL_IMMUTABLE;
> > +
> > +	return 0;
> > +}
> > +
> 
> So - I think this is fine - but it seems a lot of code to define a static
> default route which describes a single link between it's sink pad - and its
> source pad ...
> 
> I suspect this should/could be wrapped by some helpers in core for cases like
> this, as it's the simple case - but as we don't currently have that I guess we
> have to put this in here for now ?

Yes for now we need to fill in the information here.

> 
> Maybe we should have a helper to make this

I'm sure there could be v4l2 helpers for such a case. I don't even think 
you wound need to prime it with any information. If there is only one 
source and one sink I'm sure a helper function can figure it out :-)

> 
> return v4l2_subdev_single_route(subdev, routing,
>                                 ADV748X_CS2_SINK, 0,
>                                 ADV748X_CSI2_SOURCE, 0,
>                   V4L2_SUBDEV_ROUTE_FL_ACTIVE | V4L2_SUBDEV_ROUTE_FL_IMMUTABLE);
> 
> Or maybe even define these static routes in a struct somehow?

For more complex setups a struct could be used together with a helper 
function to decode it. But then again maybe it's easier to just define a 
const v4l2_subdev_route array and 'routing->routes = my_const_routes' ?

> 
> >  static const struct v4l2_subdev_pad_ops adv748x_csi2_pad_ops = {
> >  	.get_fmt = adv748x_csi2_get_format,
> >  	.set_fmt = adv748x_csi2_set_format,
> >  	.get_frame_desc = adv748x_csi2_get_frame_desc,
> > +	.get_routing = adv748x_csi2_get_routing,
> >  	.s_stream = adv748x_csi2_s_stream,
> >  };
> >  
> > 

-- 
Regards,
Niklas Söderlund

  reply	other threads:[~2017-12-18 22:58 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 19:08 [PATCH/RFC v2 00/15] Add multiplexed pad streaming support Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 01/15] v4l2-subdev.h: add pad and stream aware s_stream Niklas Söderlund
2017-12-15 11:51   ` Sakari Ailus
2017-12-18 23:06     ` Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 02/15] rcar-vin: use pad as the starting point for a pipeline Niklas Söderlund
2017-12-15 11:54   ` Sakari Ailus
2017-12-18 23:08     ` Niklas Söderlund
2017-12-27 15:28       ` Sakari Ailus
2017-12-14 19:08 ` [PATCH/RFC v2 03/15] rcar-vin: use the pad and stream aware s_stream Niklas Söderlund
2017-12-15 12:07   ` Sakari Ailus
2017-12-18 23:24     ` Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 04/15] rcar-csi2: switch to " Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 05/15] rcar-csi2: count usage for each source pad Niklas Söderlund
2017-12-15 12:25   ` Sakari Ailus
2017-12-18 23:38     ` Niklas Söderlund
2017-12-29 11:23       ` Sakari Ailus
2017-12-14 19:08 ` [PATCH/RFC v2 06/15] rcar-csi2: use frame description information when propagating .s_stream() Niklas Söderlund
2017-12-15 13:19   ` Sakari Ailus
2017-12-18 23:59     ` Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 07/15] rcar-csi2: use frame description information to configure CSI-2 bus Niklas Söderlund
2017-12-15 14:15   ` jacopo mondi
2017-12-19  0:05     ` Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 08/15] rcar-csi2: add get_routing support Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 09/15] adv748x: csi2: add module param for virtual channel Niklas Söderlund
2017-12-14 22:19   ` Kieran Bingham
2017-12-18 22:44     ` Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 10/15] adv748x: csi2: add translation from pixelcode to CSI-2 datatype Niklas Söderlund
2017-12-14 22:25   ` Kieran Bingham
2017-12-15 14:37     ` jacopo mondi
2017-12-14 19:08 ` [PATCH/RFC v2 11/15] adv748x: csi2: implement get_frame_desc Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 12/15] adv748x: csi2: switch to pad and stream aware s_stream Niklas Söderlund
2017-12-14 23:12   ` Kieran Bingham
2017-12-14 19:08 ` [PATCH/RFC v2 13/15] adv748x: csi2: only allow formats on sink pads Niklas Söderlund
2017-12-14 23:16   ` Kieran Bingham
2017-12-18 22:25     ` Niklas Söderlund
2017-12-14 19:08 ` [PATCH/RFC v2 14/15] adv748x: csi2: add get_routing support Niklas Söderlund
2017-12-14 23:27   ` Kieran Bingham
2017-12-18 22:58     ` Niklas Söderlund [this message]
2017-12-14 19:08 ` [PATCH/RFC v2 15/15] adv748x: afe: add routing support Niklas Söderlund
2017-12-14 22:56   ` Kieran Bingham
2017-12-14 22:59     ` Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171218225802.GD32148@bigcity.dyn.berto.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=bparrot@ti.com \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox