Linux Media Controller development
 help / color / mirror / Atom feed
From: Todor Tomov <todor.tomov@linaro.org>
To: Sakari Ailus <sakari.ailus@iki.fi>
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 10:00:25 +0300	[thread overview]
Message-ID: <8e5494d9-f8a3-16df-3850-fbfd3bf87965@linaro.org> (raw)
In-Reply-To: <20170629235332.m6ru4uxvdt6bmsod@valkosipuli.retiisi.org.uk>

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.

> 
> 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?


# media-ctl -d /dev/media1 --print-dot
digraph board {
        rankdir=TB
        n00000001 [label="msm_csiphy0\n/dev/v4l-subdev0", shape=box, style=filled, fillcolor=yellow]
        n00000001 -> n00000007 [style=dashed]
        n00000001 -> n0000000a [style=dashed]
        n00000004 [label="msm_csiphy1\n/dev/v4l-subdev1", shape=box, style=filled, fillcolor=yellow]
        n00000004 -> n00000007 [style=dashed]
        n00000004 -> n0000000a [style=dashed]
        n00000007 [label="msm_csid0\n/dev/v4l-subdev2", shape=box, style=filled, fillcolor=yellow]
        n00000007 -> n0000000d [style=dashed]
        n00000007 -> n00000010 [style=dashed]
        n0000000a [label="msm_csid1\n/dev/v4l-subdev3", shape=box, style=filled, fillcolor=yellow]
        n0000000a -> n0000000d [style=dashed]
        n0000000a -> n00000010 [style=dashed]
        n0000000d [label="msm_ispif0\n/dev/v4l-subdev4", shape=box, style=filled, fillcolor=yellow]
        n0000000d -> n00000013:port0 [style=dashed]
        n0000000d -> n0000001c:port0 [style=dashed]
        n0000000d -> n00000025:port0 [style=dashed]
        n0000000d -> n0000002e:port0 [style=dashed]
        n00000010 [label="msm_ispif1\n/dev/v4l-subdev5", shape=box, style=filled, fillcolor=yellow]
        n00000010 -> n00000013:port0 [style=dashed]
        n00000010 -> n0000001c:port0 [style=dashed]
        n00000010 -> n00000025:port0 [style=dashed]
        n00000010 -> n0000002e:port0 [style=dashed]
        n00000013 [label="{{<port0> 0} | msm_vfe0_rdi0\n/dev/v4l-subdev6 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
        n00000013:port1 -> n00000016 [style=bold]
        n00000016 [label="msm_vfe0_video0\n/dev/video0", shape=box, style=filled, fillcolor=yellow]
        n0000001c [label="{{<port0> 0} | msm_vfe0_rdi1\n/dev/v4l-subdev7 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
        n0000001c:port1 -> n0000001f [style=bold]
        n0000001f [label="msm_vfe0_video1\n/dev/video1", shape=box, style=filled, fillcolor=yellow]
        n00000025 [label="{{<port0> 0} | msm_vfe0_rdi2\n/dev/v4l-subdev8 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
        n00000025:port1 -> n00000028 [style=bold]
        n00000028 [label="msm_vfe0_video2\n/dev/video2", shape=box, style=filled, fillcolor=yellow]
        n0000002e [label="{{<port0> 0} | msm_vfe0_pix\n/dev/v4l-subdev9 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
        n0000002e:port1 -> n00000031 [style=bold]
        n00000031 [label="msm_vfe0_video3\n/dev/video3", shape=box, style=filled, fillcolor=yellow]
        n00000057 [label="{{} | ov5645 1-0076\n/dev/v4l-subdev10 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
        n00000057:port0 -> n00000001 [style=bold]
        n00000059 [label="{{} | ov5645 1-0074\n/dev/v4l-subdev11 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
        n00000059:port0 -> n00000004 [style=bold]
}


--
Best regards,
Todor Tomov

  reply	other threads:[~2017-06-30  7:00 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 [this message]
2017-06-30  8:05           ` Sakari Ailus
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=8e5494d9-f8a3-16df-3850-fbfd3bf87965@linaro.org \
    --to=todor.tomov@linaro.org \
    --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=sakari.ailus@iki.fi \
    /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