All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo@jmondi.org>
Cc: Rob Herring <robh@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	tfiga@google.com,
	"open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)"
	<linux-media@vger.kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 01/10] media: dt-bindings: Document 'location' property
Date: Tue, 3 Sep 2019 16:22:44 +0300	[thread overview]
Message-ID: <20190903132244.GB4812@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190902190949.3zhbg6fcudfdmu4z@uno.localdomain>

Hi Jacopo,

On Mon, Sep 02, 2019 at 09:48:30PM +0200, Jacopo Mondi wrote:
> On Mon, Sep 02, 2019 at 07:49:37PM +0300, Laurent Pinchart wrote:
> > On Mon, Sep 02, 2019 at 06:40:31PM +0200, Jacopo Mondi wrote:
> >> On Mon, Sep 02, 2019 at 02:38:40PM +0100, Rob Herring wrote:
> >>> On Thu, Aug 29, 2019 at 02:46:40PM +0200, Jacopo Mondi wrote:
> >>>> On Tue, Aug 27, 2019 at 03:21:26PM +0300, Laurent Pinchart wrote:
> >>>>> On Tue, Aug 27, 2019 at 11:23:27AM +0200, Jacopo Mondi wrote:
> >>>>>> Add the 'location' device property, used to specify the camera device
> >>>>>> mounting position. The property is particularly meaningful for mobile
> >>>>>> devices with a well defined usage orientation.
> >>>>>>
> >>>>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> >>>>>> ---
> >>>>>>  .../devicetree/bindings/media/video-interfaces.txt     | 10 ++++++++++
> >>>>>>  1 file changed, 10 insertions(+)
> >>>>>>
> >>>>>> diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
> >>>>>> index f884ada0bffc..865f4142f432 100644
> >>>>>> --- a/Documentation/devicetree/bindings/media/video-interfaces.txt
> >>>>>> +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
> >>>>>> @@ -89,6 +89,16 @@ Optional properties
> >>>>>>    but a number of degrees counter clockwise. Typical values are 0 and 180
> >>>>>>    (upside down).
> >>>>>>
> >>>>>> +- location: The camera sensor mounting location, expressed as a position
> >>>>>> +  relative to the usage orientation of the device the sensor is installed on.
> >>>>>
> >>>>> DT bindings being ABIs, we need to be precise and thorough there. One
> >>>>> particular point that bothers me is that the property is named location,
> >>>>> and its description refers to camera sensor mounting location.
> >>>>>
> >>>>> I see two options to fix this. One of them is to rename the property to
> >>>>> camera-location, but that would limit its future usage for other types
> >>>>> of devices. The other one is to document the property as applying to a
> >>>>> "device" instead of a "camera sensor", and add one sentence stating that
> >>>>> this property is valid for camera sensors only.
> >>>>>
> >>>>> This will require finding another name for the device that the device is
> >>>>> mounted on though, as using device twice would be very confusing.
> >>>>
> >>>> I had the same concern, but I cannot find another term to convey
> >>>> this... suggestions?
> >>>
> >>> For accelerometers and/or gyroscopes, we already have 'mount-matrix'.
> >>
> >> Pardon my ignorance, but I could not find it documented. Some binding
> >> files refers to an iio/mount-matrix.txt file which I cannot find. Has
> >> it been removed? Anyway, some individual bindings report examples of
> >> mount matrices (ie
> >> Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt)
> >>
> >>> That would replace 'rotation'. Maybe we can do something similar here?
> >>
> >> I think 'rotation' simply expressed as degrees is fine here, our
> >> problem was to find a term that would make it possible to specify that
> >> rotation/location are applied to a 'device' mounted on a 'device'.
> >> Sakari suggested on irc to use 'system' in place of the second
> >> 'device' and that seems to work well to me.
> >>
> >> Or were you suggesting to use a construct similar to mount-matrix for
> >> a purpose I didn't get :) ?
> >
> > mount-matrix would allow exposing the rotation in a more generic way,
> > and if there are standard DT bindings, I think this would make sense,
> > especially given that we could have device with camera sensors not
> > mounted parallel to the device side.
> 
> After reading this entry you pointed me to
> https://lore.kernel.org/patchwork/patch/1044786/
> I understand why Rob suggested that, but it seems a bit far fetched to
> me... The devices that could make use of 'mount-matrix', such as the
> ones IIO deal with, sample data in a 3D space, and to compensate their
> mounting displacement a rotation matrix is required.
> 
> Do you see use cases for compensating mounting displacement in a 3-d
> space for a camera ? I'm not saying it's not possible, but seems -a
> bit- far fetched.

360° cameras come to mind, they can use multiple sensors mounted with
different angles.

> If we consider cameras as always mounted parallel to the device used
> to take picturea, the correction you could apply to the possible mounting
> displacements are just rotations along the origin (or the z axis you want
> to consider a 3 dimensional space) and requiring to supply a 2-dimensions
> rotation matrix (with only a few combinations of 0, 1 and -1, if we only
> accept multiples of 90 degrees as we agreed) it seems a bit an overkill.
> 
> True, we could also handle image flipping, not just rotation with a rotation
> matrix but an image sensor mounted flipped upside down kind of defeat its
> purpose, doesn't it ? (it would point to the inside of the device :)
> 
> When we'll have devices with movable sensors like the one Pavel
> linked, rotation matrices could be used to report the current camera
> position maybe, but to represent a mounting displacement compensation,
> for devices working in a 2 dimensional space and with fixed rotations
> of 90 degrees multiples it seems an overkill to ask to developers to
> me.
> 
> That said, there are devices out there which do things I cannot even
> imagine, and maybe could actually compensate rotations in the 3D
> space, sample 3D point maps or other advanced things. Indeed they
> could use a rotation matrix if they need to, but the purpose of
> 'rotation' is much more humble and even if it could be represented
> with 'mount-matrix' it seems to me a non justifiable effort.

Most devices will only need to report a 0, 90, 180 or 270 rotation angle
along an axis perpendicular to the device. For those, mount-matrix is
indeed a bit overkill, and a rotation property would be enough. However,
when we will need to express more than those simple configurations,
mount-matrix will become needed, and all of a sudden we will have
multiple ways to express the same information. That's what I would like
to avoid by going for mount-matrix already.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2019-09-03 13:22 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27  9:23 [PATCH v2 00/10] media: Report camera sensor properties Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 01/10] media: dt-bindings: Document 'location' property Jacopo Mondi
2019-08-27  9:23   ` Jacopo Mondi
2019-08-27 12:21   ` Laurent Pinchart
2019-08-27 12:21     ` Laurent Pinchart
2019-08-29 12:46     ` Jacopo Mondi
2019-08-29 12:46       ` Jacopo Mondi
2019-09-02 13:38       ` Rob Herring
2019-09-02 13:38         ` Rob Herring
2019-09-02 16:40         ` Jacopo Mondi
2019-09-02 16:40           ` Jacopo Mondi
2019-09-02 16:49           ` Laurent Pinchart
2019-09-02 16:49             ` Laurent Pinchart
2019-09-02 19:48             ` Jacopo Mondi
2019-09-02 19:48               ` Jacopo Mondi
2019-09-03 13:22               ` Laurent Pinchart [this message]
2019-09-03 13:22                 ` Laurent Pinchart
2019-09-12 12:51     ` Mauro Carvalho Chehab
2019-09-12 16:36       ` Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 02/10] media: v4l2-ctrl: Document V4L2_CID_CAMERA_SENSOR_LOCATION Jacopo Mondi
2019-08-27 12:50   ` Laurent Pinchart
2019-08-29 12:47     ` Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 03/10] media: v4l2-ctrl: Document V4L2_CID_CAMERA_SENSOR_ROTATION Jacopo Mondi
2019-08-27 12:51   ` Laurent Pinchart
2019-09-02 11:20     ` Jacopo Mondi
2019-09-02 16:43       ` Laurent Pinchart
2019-09-03  4:16         ` Tomasz Figa
2019-09-03 13:17           ` Laurent Pinchart
2019-09-03 15:22           ` Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 04/10] media: v4l2-ctrl: Add V4L2_CID_CAMERA_SENSOR_LOCATION Jacopo Mondi
2019-08-27 12:53   ` Laurent Pinchart
2019-08-27  9:23 ` [PATCH v2 04/10] media: v4l2-ctrls: " Jacopo Mondi
2019-08-27  9:36   ` Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 05/10] media: v4l2-ctrl: Add V4L2_CID_CAMERA_SENSOR_ROTATION Jacopo Mondi
2019-08-27 13:07   ` Laurent Pinchart
2019-08-27  9:23 ` [PATCH v2 05/10] media: v4l2-ctrls: " Jacopo Mondi
2019-08-27  9:36   ` Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 06/10] media: v4l2-fwnode: Add helper to register controls from fw Jacopo Mondi
2019-08-27 13:16   ` Laurent Pinchart
2019-08-29 12:55     ` Jacopo Mondi
2019-08-29 10:31   ` Hans Verkuil
2019-08-29 12:45     ` Jacopo Mondi
2019-08-29 13:04       ` Hans Verkuil
2019-08-29 15:05         ` Laurent Pinchart
2019-08-29 15:32           ` Hans Verkuil
2019-09-02  9:39             ` Jacopo Mondi
2019-09-02  9:46             ` Laurent Pinchart
2019-08-27  9:23 ` [PATCH v2 07/10] media: i2c: ov5670: Register controls from firmware Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 08/10] media: i2c: ov13858: " Jacopo Mondi
2019-08-27  9:23 ` [PATCH v2 09/10] media: i2c: ov5670: Report native size and crop bounds Jacopo Mondi
2019-08-29 10:20   ` Hans Verkuil
2019-08-29 12:40     ` Jacopo Mondi
2019-08-29 12:55       ` Hans Verkuil
2019-08-29 13:18         ` Jacopo Mondi
2019-08-29 13:39           ` Hans Verkuil
2019-08-29 16:43             ` Jacopo Mondi
2019-09-02 10:05               ` Laurent Pinchart
2019-09-03 13:06         ` Sakari Ailus
2019-09-03 16:49           ` Jacopo Mondi
2019-09-26  8:11             ` Hans Verkuil
2019-09-26 18:56               ` Jacopo Mondi
2019-10-07 14:23                 ` Tomasz Figa
2019-08-27  9:23 ` [PATCH v2 10/10] media: i2c: ov13858: " Jacopo Mondi
2019-08-27  9:23 ` [DO NOT MERGE] mb/google/poppy/variant/soraka: Add camera properties Jacopo Mondi

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=20190903132244.GB4812@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo@jmondi.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@google.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.