lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23f2f17c-7c3d-30c0-d191-1a5c7a4a2989@st.com>
Date:   Tue, 26 Mar 2019 14:12:52 +0000
From:   Mickael GUENE <mickael.guene@...com>
To:     Sakari Ailus <sakari.ailus@...ux.intel.com>
CC:     "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
        "Hugues FRUCHET" <hugues.fruchet@...com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Matt Ranostay <matt.ranostay@...sulko.com>,
        Petr Cvek <petrcvekcz@...il.com>,
        Akinobu Mita <akinobu.mita@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        "Ben Kao" <ben.kao@...el.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        "Todor Tomov" <todor.tomov@...aro.org>,
        Rui Miguel Silva <rui.silva@...aro.org>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        Hans Verkuil <hverkuil@...all.nl>,
        Ricardo Ribalda Delgado <ricardo@...alda.com>,
        "Jacopo Mondi" <jacopo+renesas@...ndi.org>,
        Tianshu Qiu <tian.shu.qiu@...el.com>,
        Bingbu Cao <bingbu.cao@...el.com>
Subject: Re: [PATCH v3 2/2] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge
 driver

Sakari,

On 3/26/19 14:54, Sakari Ailus wrote:
> Hi Mickael,
> 
> On Tue, Mar 26, 2019 at 12:57:03PM +0000, Mickael GUENE wrote:
> ...
>>>> +static int mipid02_set_fmt(struct v4l2_subdev *sd,
>>>> +			   struct v4l2_subdev_pad_config *cfg,
>>>> +			   struct v4l2_subdev_format *format)
>>>> +{
>>>> +	struct v4l2_mbus_framefmt *mbus_fmt = &format->format;
>>>> +	struct mipid02_dev *bridge = to_mipid02_dev(sd);
>>>> +	struct i2c_client *client = bridge->i2c_client;
>>>> +	struct v4l2_mbus_framefmt *fmt;
>>>> +	int ret;
>>>> +
>>>> +	dev_dbg(&client->dev, "%s for %d", __func__, format->pad);
>>>> +
>>>> +	if (format->pad >= MIPID02_PAD_NB)
>>>> +		return -EINVAL;
>>>> +	/* second CSI-2 pad not yet supported */
>>>> +	if (format->pad == 1)
>>>> +		return -EINVAL;
>>>> +
>>>> +	mutex_lock(&bridge->lock);
>>>> +
>>>> +	if (bridge->streaming) {
>>>> +		ret = -EBUSY;
>>>> +		goto error;
>>>> +	}
>>>> +
>>>> +	if (format->which == V4L2_SUBDEV_FORMAT_TRY)
>>>> +		fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
>>>> +	else
>>>> +		fmt = &bridge->fmt;
>>>> +
>>>> +	*fmt = *mbus_fmt;
>>>
>>> What are the limits of the hardware regarding the size of the image? Aren't
>>> there any?
>>>
>> There are no limits for image size.
>>> The format on the sink pad needs to be propagated to the source pad as
>>> well. I presume there's nothing to set on the sink pad for this device, is
>>> there?
>>  User only need to set format code so the driver can configure hardware.
>>  In the mipid02 we have always the same format for sink and source. So I
>>  only store one configuration during set_fmt when called from either pad0
>> (sink) or pad2 (source). Is it the correct way to implement it ? or
>> should I only accept set_fmt on pad0 ?
>>  For get_fmt I return stored configuration for pad0 and pad2.
> 
> Only 76 or so characters per line, please.
> 
> For pad 0 (sink) the format must be settable freely (as you don't have any
> hardware restrictions) and on the pad 2 (source) the driver converts the
> format set on the pad 0 according to the hardware functionality. This is
> what the link validation from the source pad onwards is based on.
> 
 So for a set_fmt on pad 2 I return current configuration ? (as
in my case I have the same configuration for pad 0 and pad2)
 And I only update format when set_fmt is called for pad 0 ?

Thanks for your help

Rgs
Mickael

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ