All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Arun Kumar K <arunkk.samsung@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	LMML <linux-media@vger.kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	kilyeon.im@samsung.com, shaik.ameer@samsung.com
Subject: Re: [RFC v2 05/10] exynos5-fimc-is: Adds the sensor subdev
Date: Wed, 17 Jul 2013 16:14:23 +0200	[thread overview]
Message-ID: <51E6A6BF.9060501@samsung.com> (raw)
In-Reply-To: <CALt3h7-2Wip8f6fmwAnDdxL+hnze8YFQNYHyAZy5Rn+viySmHQ@mail.gmail.com>

On 07/17/2013 06:55 AM, Arun Kumar K wrote:
> On Wed, Jul 17, 2013 at 3:33 AM, Sylwester Nawrocki
> <sylvester.nawrocki@gmail.com> wrote:
>> On 07/09/2013 02:04 PM, Arun Kumar K wrote:
>>>
>>> On Wed, Jun 26, 2013 at 12:57 PM, Hans Verkuil<hverkuil@xs4all.nl>  wrote:
>>>>
>>>> On Fri May 31 2013 15:03:23 Arun Kumar K wrote:
>>>>>
>>>>> FIMC-IS uses certain sensors which are exclusively controlled
>>>>> from the IS firmware. This patch adds the sensor subdev for the
>>>>> fimc-is sensors.
>>>>>
>>>>> Signed-off-by: Arun Kumar K<arun.kk@samsung.com>
>>>>> Signed-off-by: Kilyeon Im<kilyeon.im@samsung.com>
>>>>
>>>>
>>>> Not surprisingly I really hate the idea of sensor drivers that are tied
>>>> to
>>>> a specific SoC, since it completely destroys the reusability of such
>>>> drivers.
>>>>
>>>
>>> Yes agree to it.
>>>
>>>> I understand that you have little choice to do something special here,
>>>> but
>>>> I was wondering whether there is a way of keeping things as generic as
>>>> possible.
>>>>
>>>> I'm just brainstorming here, but as far as I can see this driver is
>>>> basically
>>>> a partial sensor driver: it handles the clock, the format negotiation and
>>>> power management. Any sensor driver needs that.
>>>>
>>>> What would be nice is if the fmic specific parts are replaced by
>>>> callbacks
>>>> into the bridge driver using v4l2_subdev_notify().
>>>>
>>>> The platform data (or DT) can also state if this sensor is firmware
>>>> controlled
>>>> or not. If not, then the missing bits can be implemented in the future by
>>>> someone who needs that.
>>>>
>>>> That way the driver itself remains independent from fimc.
>>>>
>>>> And existing sensor drivers can be adapted to be usable with fimc as well
>>>> by
>>>> adding support for the notify callback.
>>>>
>>>> Would a scheme along those lines work?
>>>>
>>>
>>> Yes this should make the implementation very generic.
>>> Will check the feasibility of this approach.
>>
>>
>> Is I suggested earlier, you likely could do without this call back to the
>> FIMC-IS from within the sensor subdev. Look at your call chain right now:
>>
>>  /dev/video?     media-dev-driver    sensor-subdev         FIMC-IS
>>     |                 |                   |                  |
>>     | VIDIOC_STREAMON |                   |                  |
>>     |---------------->#     s_stream()    |                  |
>>     |                 #------------------># pipeline_open()  |
>>     |                 |                   # ---------------->|
>>     |                 |                   # pipeline_start() |
>>     |                 |                   # ---------------->|
>>     |                 |                   |                  |
>>
>> Couldn't you move pipeline_open(), pipeline_start() to s_stream handler
>> of the ISP subdev ? It is currently empty. The media device driver could
>> call s_stream on the ISP subdev each time it sees s_stream request on
>> the sensor subdev. And you wouldn't need any hacks to get the pipeline
>> pointer in the sensor subdev. Then it would be something like:
>>
>>  /dev/video?     media-dev-driver    sensor-subdev  FIMC-IS-ISP-subdev
>>     |                 |                   |             |
>>     | VIDIOC_STREAMON |                   |             |
>>     |---------------->#     s_stream()    |             |
>>     |                 #------------------>|             |
>>     |                 #     s_stream()    |             |
>>     |                 #-------------------+------------># pipeline_open()
>>     |                 |                   |             # pipeline_start()
>>     |                 |                   |             #
>>
>> I suppose pipeline_open() is better candidate for the s_power callback.
>> It just needs to be ensured at the media device level the subdev
>> operations sequences are correct.
>>
> 
> It can be done this way. But my intention of putting these calls in
> the sensor subdev was to use the sensor subdev independent of
> isp subdev. This is for the usecase where the pipeline will only contain
> 
> is-sensor --> mipi-csis --> fimc-lite ---> memory
> 
> This way you can capture the bayer rgb data from sensor without using
> any isp components at all.
> 
> The second pipeline which is isp --> scc --> scp
> can be used for processing the sensor data and can be created and
> used if needed.
> 
> In the method you mentioned, the isp subdev has to be used even
> when it is not part of the pipeline. Is that allowed?
> If its allowed as per media pipeline guidelines, then this definitely
> is a better approach. Please suggest on this.

Sure, I'm aware of those two relatively separate pipelines. s_power,
s_stream callbacks belong to the kernel so I don't think it would be
an issue to do it as I described. Please note s_power, s_stream are
normally reference counted.
Alternatively you could create a separate subdev for the FIMC-IS
firmware interface. Such subdev wouldn't be exposing device node
and would be used by the media pipeline controller driver to ensure
proper hardware configuration sequences. I don't know the Exynos5
FIMC-IS firmware architecture very well so I'm not sure if it is
worth to create such a separate subdev as the firmware interface
obstruction layer ;) I guess we could do only with subdevs that
are exposed to user space.

Regards,
Sylwester

  reply	other threads:[~2013-07-17 14:14 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 13:03 [RFC v2 00/10] Exynos5 FIMC-IS driver Arun Kumar K
2013-05-31 13:03 ` [RFC v2 01/10] exynos5-fimc-is: Add Exynos5 FIMC-IS device tree bindings documentation Arun Kumar K
2013-06-20 22:45   ` Sylwester Nawrocki
2013-07-09 11:08     ` Arun Kumar K
2013-07-16 21:23       ` Sylwester Nawrocki
2013-07-17  4:42         ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 02/10] exynos5-fimc-is: Adds fimc-is driver core files Arun Kumar K
2013-06-06  5:20   ` Sachin Kamat
2013-06-07 10:26     ` Arun Kumar K
2013-06-20 22:46   ` Sylwester Nawrocki
2013-07-09 11:10     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 03/10] exynos5-fimc-is: Adds common driver header files Arun Kumar K
2013-06-20 22:46   ` Sylwester Nawrocki
2013-06-21  7:14     ` Arun Kumar K
2013-07-09 11:20     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 04/10] exynos5-fimc-is: Adds the register definition and context header Arun Kumar K
2013-06-06  6:24   ` Sachin Kamat
2013-06-07 10:27     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 05/10] exynos5-fimc-is: Adds the sensor subdev Arun Kumar K
2013-06-06  6:39   ` Sachin Kamat
2013-06-07 10:30     ` Arun Kumar K
2013-06-20 23:04   ` Sylwester Nawrocki
2013-07-09 12:01     ` Arun Kumar K
2013-06-26  7:27   ` Hans Verkuil
2013-07-09 12:04     ` Arun Kumar K
2013-07-16 22:03       ` Sylwester Nawrocki
2013-07-17  4:55         ` Arun Kumar K
2013-07-17 14:14           ` Sylwester Nawrocki [this message]
2013-07-18  4:35             ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 06/10] exynos5-fimc-is: Adds isp subdev Arun Kumar K
2013-06-06  6:18   ` Sachin Kamat
2013-06-07 10:28     ` Arun Kumar K
2013-06-20 23:25   ` Sylwester Nawrocki
2013-07-09 11:42     ` Arun Kumar K
2013-07-16 22:11       ` Sylwester Nawrocki
2013-07-17  4:56         ` Arun Kumar K
2013-08-02  4:31     ` Arun Kumar K
2013-08-03 21:38       ` Sylwester Nawrocki
2013-06-26  7:15   ` Hans Verkuil
2013-07-09 11:42     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 07/10] exynos5-fimc-is: Adds scaler subdev Arun Kumar K
2013-06-06  6:45   ` Sachin Kamat
2013-06-26  7:13   ` Hans Verkuil
2013-07-09 11:30     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 08/10] exynos5-fimc-is: Adds the hardware pipeline control Arun Kumar K
2013-05-31 13:03 ` [RFC v2 09/10] exynos5-fimc-is: Adds the hardware interface module Arun Kumar K
2013-06-21 11:23   ` Andrzej Hajda
2013-07-09 11:26     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 10/10] exynos5-fimc-is: Adds the Kconfig and Makefile Arun Kumar K

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=51E6A6BF.9060501@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=arunkk.samsung@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kilyeon.im@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=shaik.ameer@samsung.com \
    /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.