linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Todor Tomov <todor.tomov@linaro.org>
Cc: mchehab@kernel.org, hans.verkuil@cisco.com,
	javier@osg.samsung.com, s.nawrocki@samsung.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2 04/19] media: camss: Add CSIPHY files
Date: Fri, 30 Jun 2017 11:05:37 +0300	[thread overview]
Message-ID: <20170630080536.7doop7wxn77j6ju5@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <8e5494d9-f8a3-16df-3850-fbfd3bf87965@linaro.org>

Hi Todor,

On Fri, Jun 30, 2017 at 10:00:25AM +0300, Todor Tomov wrote:
> Hi Sakari,
> 
> On 06/30/2017 02:53 AM, Sakari Ailus wrote:
> > Hi Todor,
> > 
> > On Thu, Jun 29, 2017 at 07:36:47PM +0300, Todor Tomov wrote:
> >>>> +/*
> >>>> + * csiphy_link_setup - Setup CSIPHY connections
> >>>> + * @entity: Pointer to media entity structure
> >>>> + * @local: Pointer to local pad
> >>>> + * @remote: Pointer to remote pad
> >>>> + * @flags: Link flags
> >>>> + *
> >>>> + * Rreturn 0 on success
> >>>> + */
> >>>> +static int csiphy_link_setup(struct media_entity *entity,
> >>>> +			     const struct media_pad *local,
> >>>> +			     const struct media_pad *remote, u32 flags)
> >>>> +{
> >>>> +	if ((local->flags & MEDIA_PAD_FL_SOURCE) &&
> >>>> +	    (flags & MEDIA_LNK_FL_ENABLED)) {
> >>>> +		struct v4l2_subdev *sd;
> >>>> +		struct csiphy_device *csiphy;
> >>>> +		struct csid_device *csid;
> >>>> +
> >>>> +		if (media_entity_remote_pad((struct media_pad *)local))
> >>>
> >>> This is ugly.
> >>>
> >>> What do you intend to find with media_entity_remote_pad()? The pad flags
> >>> haven't been assigned to the pad yet, so media_entity_remote_pad() could
> >>> give you something else than remote.
> >>
> >> This is an attempt to check whether the pad is already linked - to refuse
> >> a second active connection from the same src pad. As far as I can say, it
> >> was a successful attempt. Do you see any problem with it?
> > 
> > Ah. So you have multiple links here only one of which may be active?
> 
> Exactly. Below I'm adding the output of media-ctl --print-dot as you have
> requested. I can add it in the driver document as well.

Hmm. I think it could be useful there as an example. I wonder what others
think.

> 
> > 
> > I guess you can well use media_entity_remote_pad(), but then
> > media_entity_remote_pad() argument needs to be made const. Feel free to
> > spin a patch. I don't think it'd have further implications elsewhere.
> > 
> 
> Well media_entity_remote_pad() accepts struct media_pad *pad, not a
> const and trying to pass a const triggers a warning. This is why I had
> to cast. Or did I misunderstand you?

No, you don't cast to non-const. Instead, you change the function to accept
a const argument.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

  reply	other threads:[~2017-06-30  8:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 14:48 [PATCH v2 00/19] Qualcomm 8x16 Camera Subsystem driver Todor Tomov
2017-06-19 14:48 ` [PATCH v2 01/19] doc: DT: camss: Binding document for Qualcomm Camera subsystem driver Todor Tomov
2017-06-23 20:41   ` Rob Herring
2017-06-29 12:11     ` Todor Tomov
2017-06-19 14:48 ` [PATCH v2 02/19] MAINTAINERS: Add " Todor Tomov
2017-06-19 14:48 ` [PATCH v2 03/19] doc: media/v4l-drivers: Add Qualcomm Camera Subsystem driver document Todor Tomov
2017-06-19 14:48 ` [PATCH v2 04/19] media: camss: Add CSIPHY files Todor Tomov
2017-06-28 21:34   ` Sakari Ailus
2017-06-29 16:36     ` Todor Tomov
2017-06-29 23:53       ` Sakari Ailus
2017-06-30  7:00         ` Todor Tomov
2017-06-30  8:05           ` Sakari Ailus [this message]
2017-06-19 14:48 ` [PATCH v2 05/19] media: camss: Add CSID files Todor Tomov
2017-07-03 10:49   ` Hans Verkuil
2017-07-03 14:10     ` Todor Tomov
2017-06-19 14:48 ` [PATCH v2 06/19] media: camss: Add ISPIF files Todor Tomov
2017-06-19 14:48 ` [PATCH v2 07/19] media: camss: Add VFE files Todor Tomov
2017-06-19 14:48 ` [PATCH v2 08/19] media: camss: Add files which handle the video device nodes Todor Tomov
2017-07-03 11:32   ` Hans Verkuil
2017-07-06 13:44     ` Todor Tomov
2017-07-06 14:43       ` Hans Verkuil
2017-06-19 14:48 ` [PATCH v2 09/19] media: camms: Add core files Todor Tomov
2017-06-29  6:33   ` Sakari Ailus
2017-07-03 14:03     ` Todor Tomov
2017-07-04  5:43       ` Sakari Ailus
2017-07-03 11:24   ` Hans Verkuil
2017-07-03 14:12     ` Todor Tomov
2017-06-19 14:48 ` [PATCH v2 10/19] media: camss: Enable building Todor Tomov
2017-06-20 10:30   ` kbuild test robot
2017-06-20 11:20     ` Todor Tomov
2017-06-19 14:48 ` [PATCH v2 11/19] camss: vfe: Format conversion support using PIX interface Todor Tomov
2017-06-19 14:48 ` [PATCH v2 12/19] doc: media/v4l-drivers: Qualcomm Camera Subsystem - PIX Interface Todor Tomov
2017-06-19 14:48 ` [PATCH v2 13/19] camss: vfe: Support for frame padding Todor Tomov
2017-06-19 14:48 ` [PATCH v2 14/19] camss: vfe: Add interface for scaling Todor Tomov
2017-06-19 14:48 ` [PATCH v2 15/19] camss: vfe: Configure scaler module in VFE Todor Tomov
2017-06-19 14:48 ` [PATCH v2 16/19] camss: vfe: Add interface for cropping Todor Tomov
2017-06-19 14:48 ` [PATCH v2 17/19] camss: vfe: Configure crop module in VFE Todor Tomov
2017-06-19 14:48 ` [PATCH v2 18/19] doc: media/v4l-drivers: Qualcomm Camera Subsystem - Scale and crop Todor Tomov
2017-06-19 14:48 ` [PATCH v2 19/19] camss: Use optimal clock frequency rates Todor Tomov
2017-07-03 11:36 ` [PATCH v2 00/19] Qualcomm 8x16 Camera Subsystem driver Hans Verkuil

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=20170630080536.7doop7wxn77j6ju5@valkosipuli.retiisi.org.uk \
    --to=sakari.ailus@iki.fi \
    --cc=hans.verkuil@cisco.com \
    --cc=javier@osg.samsung.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=todor.tomov@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).