From: Hans Verkuil <hverkuil@xs4all.nl>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Jonathan Corbet <corbet@lwn.net>,
Sakari Ailus <sakari.ailus@iki.fi>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Heungjun Kim <riverful.kim@samsung.com>,
Prabhakar Lad <prabhakar.csengg@gmail.com>,
Andrzej Hajda <a.hajda@samsung.com>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Boris BREZILLON <boris.brezillon@free-electrons.com>,
linux-doc@vger.kernel.org, linux-api@vger.kernel.org
Subject: Re: [PATCH 04/18] media controller: Rename camera entities
Date: Fri, 08 May 2015 15:13:20 +0200 [thread overview]
Message-ID: <554CB670.70107@xs4all.nl> (raw)
In-Reply-To: <20150508095347.3f6e2a5a@recife.lan>
On 05/08/2015 02:53 PM, Mauro Carvalho Chehab wrote:
> Em Fri, 08 May 2015 14:03:01 +0200
> Hans Verkuil <hverkuil@xs4all.nl> escreveu:
>
>> On 05/08/2015 03:12 AM, Mauro Carvalho Chehab wrote:
>>> As explained before, the hole idea of subtypes at entities was
>>
>> hole -> whole
>>
>>> not nice. All V4L2 subdevs may have a device node associated.
>>>
>>> Also, the hole idea is to expose hardware IP blocks, so calling
>>> them as V4L2 is a very bad practice, as they were not designed
>>> for the V4L2 API. It is just the reverse.
>>>
>>> So, instead of using V4L2_SUBDEV, let's call the camera sub-
>>> devices with CAM, instead:
>>>
>>> MEDIA_ENT_T_V4L2_SUBDEV_SENSOR -> MEDIA_ENT_T_CAM_SENSOR
>>> MEDIA_ENT_T_V4L2_SUBDEV_FLASH -> MEDIA_ENT_T_CAM_FLASH
>>> MEDIA_ENT_T_V4L2_SUBDEV_LENS -> MEDIA_ENT_T_CAM_LENS
>>
>> I would actually postpone this until Laurent has a properties API ready.
>> These entity types are fatally flawed since an entity can combine functions
>> in one. E.g. an i2c device (generally represented as a single entity) might
>> provide for both sensor and flash. Or combine tuner and video decoder, etc.
>
> Mapping one I2C address as one entity is plain wrong.
I said 'i2c device', not i2c address. That would definitely be wrong. I'm also
not saying that each i2c device (chip) maps always to one entity, although this
is generally true. In the end it depends on the driver author to decide how
to split up the functionality of the device into entities. There is no hard
and fast rule for that.
> So, if a single piece of hardware has the functions of two entities
> (sensor and flash), it should be represented as two separate entities.
Perhaps, perhaps not. There is in the general case no clear rule at what
level you design your entities. In a complex pipeline it would be madness
to map every little HW block to an entity since you would get a zillion
entities, which is highly impractical. The cx25840 combines multiple
functions (tuner, audio/video decoders), and I am not at all sure you
would gain anything from splitting that up into smaller entities. In the
end, if you would write a block diagram of your board the cx25840 would be
a single block. And experience has shown that that is typically the right
level for deciding what will be an entity or not.
Also, in such devices the various functions are often intertwined and
generally not easy to separate.
>
> The I2C bus would matter if we were mapping the control plane of the
> entities, adding PADs for the control lines. But last time I checked,
> Laurent was still strongly opposed to that.
>
>> Basically an entity like this is a sub-device (as in the literal meaning
>> of being a part of a larger device) that has one or more functions and may
>> have device node(s) associated with it. That is best expressed as properties.
>>
>> And you really do have to tell userspace that these entities expose a
>> v4l-subdev device node. Renaming them doesn't make that go away.
>
> Well, we should decide if we want the namespace and the entities
> representing the hardware or representing the Linux API.
> V4L2_SUBDEV has nothing to do with hardware. It is just an abstraction
> that we've created on one of our subsystems.
I agree. MEDIA_ENT_T_V4L2_SUBDEV_SENSOR basically contains two bits of
information: the linux API used to access the entity and the function.
Since you don't combine multiple APIs (e.g. ALSA and V4L2) for a single
device node (I would certainly never allow such code in the kernel!) there
is only one of those, but one entity can certainly combine multiple functions
as I argued for above. Hence, those should be properties.
Anyway, let's wait what Laurent thinks and setup an irc session for this.
Regards,
Hans
next prev parent reply other threads:[~2015-05-08 13:13 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 1:12 [PATCH 00/18] Remove media controller entity subtypes and rename types Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 01/18] media controller: add EXPERIMENTAL to Kconfig option for DVB support Mauro Carvalho Chehab
2015-05-08 11:33 ` Hans Verkuil
2015-05-11 12:46 ` Laurent Pinchart
2015-05-08 1:12 ` [PATCH 02/18] media controller: deprecate entity subtype Mauro Carvalho Chehab
2015-05-08 11:39 ` Hans Verkuil
2015-05-08 1:12 ` [PATCH 03/18] media controller: use MEDIA_ENT_T_AV_DMA for A/V DMA engines Mauro Carvalho Chehab
2015-05-08 11:54 ` Hans Verkuil
2015-05-08 12:32 ` Mauro Carvalho Chehab
2015-05-08 12:57 ` Hans Verkuil
2015-05-08 1:12 ` [PATCH 04/18] media controller: Rename camera entities Mauro Carvalho Chehab
2015-05-08 12:03 ` Hans Verkuil
2015-05-08 12:53 ` Mauro Carvalho Chehab
2015-05-08 13:13 ` Hans Verkuil [this message]
2015-05-08 1:12 ` [PATCH 05/18] media controller: rename MEDIA_ENT_T_DEVNODE_DVB entities Mauro Carvalho Chehab
2015-05-08 12:10 ` Hans Verkuil
2015-05-08 12:56 ` Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 06/18] media controller: rename analog TV decoder Mauro Carvalho Chehab
2015-05-08 12:12 ` Hans Verkuil
2015-05-08 1:12 ` [PATCH 07/18] media controller: rename the tuner entity Mauro Carvalho Chehab
2015-05-08 12:13 ` Hans Verkuil
2015-05-08 12:57 ` Mauro Carvalho Chehab
2015-05-08 13:21 ` Hans Verkuil
2015-05-08 14:08 ` Mauro Carvalho Chehab
2015-05-08 14:32 ` Hans Verkuil
2015-05-08 15:46 ` Mauro Carvalho Chehab
2015-05-09 9:31 ` Hans Verkuil
2015-05-11 9:31 ` Mauro Carvalho Chehab
2015-05-11 9:38 ` Hans Verkuil
2015-05-08 1:12 ` [PATCH 08/18] media controller: add comments for the entity types Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 09/18] media controller: add macros to check if subdev or A/V DMA Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 10/18] media controller: use macros to check for V4L2 subdev entities Mauro Carvalho Chehab
2015-05-08 12:46 ` Hans Verkuil
2015-05-08 13:20 ` Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 11/18] omap3/omap4/davinci: get rid of MEDIA_ENT_T_V4L2_SUBDEV abuse Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 12/18] s5c73m3: fix subdev type Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 13/18] s5k5baf: " Mauro Carvalho Chehab
2015-05-08 13:51 ` Andrzej Hajda
2015-05-08 14:25 ` Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 14/18] davinci_vbpe: stop MEDIA_ENT_T_V4L2_SUBDEV abuse Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 15/18] omap4iss: " Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 16/18] v4l2-subdev: use MEDIA_ENT_T_UNKNOWN for new subdevs Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 17/18] media controller: get rid of entity subtype on Kernel Mauro Carvalho Chehab
2015-05-08 1:12 ` [PATCH 18/18] DocBook: update descriptions for the media controller entities Mauro Carvalho Chehab
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=554CB670.70107@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=a.hajda@samsung.com \
--cc=boris.brezillon@free-electrons.com \
--cc=corbet@lwn.net \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mchehab@osg.samsung.com \
--cc=prabhakar.csengg@gmail.com \
--cc=riverful.kim@samsung.com \
--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