All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v3 7/9] media: rcar-vin: Handle parallel subdev in link_notify
Date: Thu, 24 May 2018 12:37:31 +0200	[thread overview]
Message-ID: <20180524103731.GG31036@bigcity.dyn.berto.se> (raw)
In-Reply-To: <1526654445-10702-8-git-send-email-jacopo+renesas@jmondi.org>

Hi Jacopo,

Thanks for your patch.

On 2018-05-18 16:40:43 +0200, Jacopo Mondi wrote:
> Handle parallel subdevices in link_notify callback. If the notified link
> involves a parallel subdevice, do not change routing of the VIN-CSI-2
> devices and mark the VIN instance as using a parallel input. If the
> CSI-2 link setup succeeds instead, mark the VIN instance as using CSI-2.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> ---
>  drivers/media/platform/rcar-vin/rcar-core.c | 36 +++++++++++++++++++++++++++--
>  1 file changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
> index d13bbcf..dcebb42 100644
> --- a/drivers/media/platform/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/rcar-vin/rcar-core.c
> @@ -168,10 +168,37 @@ static int rvin_group_link_notify(struct media_link *link, u32 flags,
>  	}
>  
>  	/* Add the new link to the existing mask and check if it works. */
> -	csi_id = rvin_group_entity_to_csi_id(group, link->source->entity);
>  	channel = rvin_group_csi_pad_to_channel(link->source->index);

I think you should move the channel = ...; bellow the new if statement 
the same way you do with mask_new.

> -	mask_new = mask & rvin_group_get_mask(vin, csi_id, channel);
> +	csi_id = rvin_group_entity_to_csi_id(group, link->source->entity);

Missing new line.

With these two nits fixed:

Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> +	if (csi_id == -ENODEV) {
> +		struct v4l2_subdev *sd;
> +		unsigned int i;
> +
> +		/*
> +		 * Make sure the source entity subdevice is registered as
> +		 * a parallel input of one of the enabled VINs if it is not
> +		 * one of the CSI-2 subdevices.
> +		 *
> +		 * No hardware configuration required for parallel inputs,
> +		 * we can return here.
> +		 */
> +		sd = media_entity_to_v4l2_subdev(link->source->entity);
> +		for (i = 0; i < RCAR_VIN_NUM; i++) {
> +			if (group->vin[i] && group->vin[i]->parallel &&
> +			    group->vin[i]->parallel->subdev == sd) {
> +				group->vin[i]->is_csi = false;
> +				ret = 0;
> +				goto out;
> +			}
> +		}
> +
> +		vin_err(vin, "Subdevice %s not registered to any VIN\n",
> +			link->source->entity->name);
> +		ret = -ENODEV;
> +		goto out;
> +	}
>  
> +	mask_new = mask & rvin_group_get_mask(vin, csi_id, channel);
>  	vin_dbg(vin, "Try link change mask: 0x%x new: 0x%x\n", mask, mask_new);
>  
>  	if (!mask_new) {
> @@ -181,6 +208,11 @@ static int rvin_group_link_notify(struct media_link *link, u32 flags,
>  
>  	/* New valid CHSEL found, set the new value. */
>  	ret = rvin_set_channel_routing(group->vin[master_id], __ffs(mask_new));
> +	if (ret)
> +		goto out;
> +
> +	vin->is_csi = true;
> +
>  out:
>  	mutex_unlock(&group->lock);
>  
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas Söderlund

WARNING: multiple messages have this Message-ID (diff)
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v3 7/9] media: rcar-vin: Handle parallel subdev in link_notify
Date: Thu, 24 May 2018 12:37:31 +0200	[thread overview]
Message-ID: <20180524103731.GG31036@bigcity.dyn.berto.se> (raw)
In-Reply-To: <1526654445-10702-8-git-send-email-jacopo+renesas@jmondi.org>

Hi Jacopo,

Thanks for your patch.

On 2018-05-18 16:40:43 +0200, Jacopo Mondi wrote:
> Handle parallel subdevices in link_notify callback. If the notified link
> involves a parallel subdevice, do not change routing of the VIN-CSI-2
> devices and mark the VIN instance as using a parallel input. If the
> CSI-2 link setup succeeds instead, mark the VIN instance as using CSI-2.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> ---
>  drivers/media/platform/rcar-vin/rcar-core.c | 36 +++++++++++++++++++++++++++--
>  1 file changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
> index d13bbcf..dcebb42 100644
> --- a/drivers/media/platform/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/rcar-vin/rcar-core.c
> @@ -168,10 +168,37 @@ static int rvin_group_link_notify(struct media_link *link, u32 flags,
>  	}
>  
>  	/* Add the new link to the existing mask and check if it works. */
> -	csi_id = rvin_group_entity_to_csi_id(group, link->source->entity);
>  	channel = rvin_group_csi_pad_to_channel(link->source->index);

I think you should move the channel = ...; bellow the new if statement 
the same way you do with mask_new.

> -	mask_new = mask & rvin_group_get_mask(vin, csi_id, channel);
> +	csi_id = rvin_group_entity_to_csi_id(group, link->source->entity);

Missing new line.

With these two nits fixed:

Acked-by: Niklas S�derlund <niklas.soderlund+renesas@ragnatech.se>

> +	if (csi_id == -ENODEV) {
> +		struct v4l2_subdev *sd;
> +		unsigned int i;
> +
> +		/*
> +		 * Make sure the source entity subdevice is registered as
> +		 * a parallel input of one of the enabled VINs if it is not
> +		 * one of the CSI-2 subdevices.
> +		 *
> +		 * No hardware configuration required for parallel inputs,
> +		 * we can return here.
> +		 */
> +		sd = media_entity_to_v4l2_subdev(link->source->entity);
> +		for (i = 0; i < RCAR_VIN_NUM; i++) {
> +			if (group->vin[i] && group->vin[i]->parallel &&
> +			    group->vin[i]->parallel->subdev == sd) {
> +				group->vin[i]->is_csi = false;
> +				ret = 0;
> +				goto out;
> +			}
> +		}
> +
> +		vin_err(vin, "Subdevice %s not registered to any VIN\n",
> +			link->source->entity->name);
> +		ret = -ENODEV;
> +		goto out;
> +	}
>  
> +	mask_new = mask & rvin_group_get_mask(vin, csi_id, channel);
>  	vin_dbg(vin, "Try link change mask: 0x%x new: 0x%x\n", mask, mask_new);
>  
>  	if (!mask_new) {
> @@ -181,6 +208,11 @@ static int rvin_group_link_notify(struct media_link *link, u32 flags,
>  
>  	/* New valid CHSEL found, set the new value. */
>  	ret = rvin_set_channel_routing(group->vin[master_id], __ffs(mask_new));
> +	if (ret)
> +		goto out;
> +
> +	vin->is_csi = true;
> +
>  out:
>  	mutex_unlock(&group->lock);
>  
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas S�derlund

  reply	other threads:[~2018-05-24 10:37 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 14:40 [PATCH v3 0/9] rcar-vin: Add support for parallel input on Gen3 Jacopo Mondi
2018-05-18 14:40 ` [PATCH v3 1/9] media: rcar-vin: Rename 'digital' to 'parallel' Jacopo Mondi
2018-05-23 22:42   ` Niklas Söderlund
2018-05-23 22:42     ` Niklas Söderlund
2018-05-24 20:19     ` jacopo mondi
2018-05-18 14:40 ` [PATCH v3 2/9] media: rcar-vin: Remove two empty lines Jacopo Mondi
2018-05-23 22:43   ` Niklas Söderlund
2018-05-23 22:43     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 3/9] media: rcar-vin: Create a group notifier Jacopo Mondi
2018-05-24 10:14   ` Niklas Söderlund
2018-05-24 10:14     ` Niklas Söderlund
2019-04-05 16:16     ` Eugeniu Rosca
2019-04-06  0:04       ` Steve Longerbeam
2019-04-08 11:12         ` Niklas Söderlund
2019-04-09  3:58           ` Steve Longerbeam
2019-04-09  9:10             ` Kieran Bingham
2019-04-09 13:25               ` Niklas Söderlund
2019-04-09 22:52                 ` Steve Longerbeam
2019-04-09 20:57             ` Laurent Pinchart
2019-04-09 22:22               ` Steve Longerbeam
2019-04-09 22:59                 ` Laurent Pinchart
2019-04-09 23:29                   ` Steve Longerbeam
2019-04-11 20:28                     ` Eugeniu Rosca
2019-04-11 20:42                       ` Niklas Söderlund
2019-04-12 14:12                         ` Eugeniu Rosca
2019-04-12 15:10                           ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 4/9] media: rcar-vin: Cache the mbus configuration flags Jacopo Mondi
2018-05-24 10:20   ` Niklas Söderlund
2018-05-24 10:20     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 5/9] media: rcar-vin: Parse parallel input on Gen3 Jacopo Mondi
2018-05-24 10:30   ` Niklas Söderlund
2018-05-24 10:30     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 6/9] media: rcar-vin: Link parallel input media entities Jacopo Mondi
2018-05-24 10:32   ` Niklas Söderlund
2018-05-24 10:32     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 7/9] media: rcar-vin: Handle parallel subdev in link_notify Jacopo Mondi
2018-05-24 10:37   ` Niklas Söderlund [this message]
2018-05-24 10:37     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 8/9] media: rcar-vin: Rename _rcar_info to rcar_info Jacopo Mondi
2018-05-19  9:33   ` Sergei Shtylyov
2018-05-24 10:38   ` Niklas Söderlund
2018-05-24 10:38     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 9/9] media: rcar-vin: Add support for R-Car R8A77995 SoC Jacopo Mondi

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=20180524103731.GG31036@bigcity.dyn.berto.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=jacopo+renesas@jmondi.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.