linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mickael GUENE <mickael.guene@st.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"Hugues FRUCHET" <hugues.fruchet@st.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Matt Ranostay <matt.ranostay@konsulko.com>,
	Petr Cvek <petrcvekcz@gmail.com>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Ben Kao" <ben.kao@intel.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	"Todor Tomov" <todor.tomov@linaro.org>,
	Rui Miguel Silva <rui.silva@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Ricardo Ribalda Delgado <ricardo@ribalda.com>,
	"Jacopo Mondi" <jacopo+renesas@jmondi.org>,
	Tianshu Qiu <tian.shu.qiu@intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>
Subject: Re: [PATCH v3 2/2] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver
Date: Tue, 26 Mar 2019 14:12:52 +0000	[thread overview]
Message-ID: <23f2f17c-7c3d-30c0-d191-1a5c7a4a2989@st.com> (raw)
In-Reply-To: <20190326135439.oju2k6idndjaulfj@paasikivi.fi.intel.com>

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

  reply	other threads:[~2019-03-26 14:13 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  6:44 [PATCH v1 0/3] Add support for MIPID02 CSI-2 to PARALLEL bridge I2C device Mickael Guene
2019-03-12  6:44 ` [PATCH v1 1/3] dt-bindings: Document MIPID02 bindings Mickael Guene
2019-03-16 21:46   ` Sakari Ailus
2019-03-18  8:28     ` Mickael GUENE
2019-03-18  8:48       ` Sakari Ailus
2019-03-18  9:08         ` Mickael GUENE
2019-03-12  6:44 ` [PATCH v1 2/3] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver Mickael Guene
2019-03-16 22:14   ` Sakari Ailus
2019-03-18  9:57     ` Mickael GUENE
2019-03-25 11:17       ` Sakari Ailus
2019-03-25 12:14         ` Mickael GUENE
2019-03-26 11:37           ` Sakari Ailus
2019-03-26 12:07             ` Mickael GUENE
2019-03-12  6:44 ` [PATCH v1 3/3] media: MAINTAINERS: add entry for STMicroelectronics MIPID02 media driver Mickael Guene
2019-03-16 21:47   ` Sakari Ailus
2019-03-18 10:01     ` Mickael GUENE
2019-03-25  7:55 ` [PATCH v2 0/2] Add support for MIPID02 CSI-2 to PARALLEL bridge I2C device Mickael Guene
2019-03-25  7:55   ` [PATCH v2 1/2] dt-bindings: Document MIPID02 bindings Mickael Guene
2019-03-25  7:55   ` [PATCH v2 2/2] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver Mickael Guene
2019-03-25 11:44     ` Sakari Ailus
2019-03-25 12:22       ` Mickael GUENE
2019-03-26 11:34         ` Sakari Ailus
2019-03-26 12:32           ` Mickael GUENE
2019-03-26 10:03 ` [PATCH v3 0/2] Add support for MIPID02 CSI-2 to PARALLEL bridge I2C device Mickael Guene
2019-03-26 10:03   ` [PATCH v3 1/2] dt-bindings: Document MIPID02 bindings Mickael Guene
2019-03-26 12:17     ` Sakari Ailus
2019-03-26 13:40       ` Mickael GUENE
2019-03-26 13:44         ` Sakari Ailus
2019-03-26 10:03   ` [PATCH v3 2/2] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver Mickael Guene
2019-03-26 11:33     ` Sakari Ailus
2019-03-26 12:57       ` Mickael GUENE
2019-03-26 13:54         ` Sakari Ailus
2019-03-26 14:12           ` Mickael GUENE [this message]
2019-03-26 14:14             ` Sakari Ailus
2019-03-26 14:36       ` Mickael GUENE
2019-04-06 11:01         ` Sakari Ailus
2019-04-08  6:17           ` Mickael GUENE
2019-04-08  9:21             ` Sakari Ailus
2019-03-27  9:55 ` [PATCH v4 0/2] Add support for MIPID02 CSI-2 to PARALLEL bridge I2C device Mickael Guene
2019-03-27  9:55   ` [PATCH v4 1/2] dt-bindings: Document MIPID02 bindings Mickael Guene
2019-03-28 17:43     ` Rob Herring
2019-04-06 10:35     ` Sakari Ailus
2019-04-06 10:38       ` Sakari Ailus
2019-04-08  6:20         ` Mickael GUENE
2019-03-27  9:55   ` [PATCH v4 2/2] media:st-mipid02: MIPID02 CSI-2 to PARALLEL bridge driver Mickael Guene
     [not found]     ` <20190406105606.rciacao5d4hljbbu@kekkonen.localdomain>
2019-04-08  8:20       ` Mickael GUENE
2019-04-08  9:17         ` Sakari Ailus

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=23f2f17c-7c3d-30c0-d191-1a5c7a4a2989@st.com \
    --to=mickael.guene@st.com \
    --cc=akinobu.mita@gmail.com \
    --cc=ben.kao@intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hugues.fruchet@st.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=matt.ranostay@konsulko.com \
    --cc=mchehab@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=petrcvekcz@gmail.com \
    --cc=ricardo@ribalda.com \
    --cc=rui.silva@linaro.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tian.shu.qiu@intel.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).