public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Robert Mader <robert.mader@collabora.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 0/3] media: imx258: Remove rotation=<80 requirement
Date: Thu, 26 Jan 2023 18:01:18 +0200	[thread overview]
Message-ID: <Y9Kjzm2PqSRBuoBT@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAPY8ntCWUSbvUKziuq0ABX2vOGJyCwtQN7MEt5LXQf0yKpfMKA@mail.gmail.com>

Hi Dave,

On Thu, Jan 26, 2023 at 03:48:04PM +0000, Dave Stevenson wrote:
> On Thu, 26 Jan 2023 at 14:52, Sakari Ailus wrote:
> > On Tue, Jan 17, 2023 at 11:06:00AM +0100, Jacopo Mondi wrote:
> > > Currently the imx258 driver requires to have the 'rotation' device node
> > > property specified in DTS with a fixed value of 180 degrees.
> > >
> > > The "rotation" fwnode device property is intended to allow specify the
> > > sensor's physical mounting rotation, so that it can be exposed through
> > > the read-only V4L2_CID_CAMERA_SENSOR_ROTATION control and applications
> > > can decide how to compensate for that.
> > >
> > > The imx258 driver has read-only VFLIP and HFLIP enabled, resulting in
> > > a 180 degrees image rotation being produced by the sensor. But this
> > > doesn't imply that the physical mounting rotation should match the
> > > driver's implementation.
> > >
> > > I took into the series Robert's patch that register device node properties and
> > > on top of that register flips controls, in order to remove the hard requirement
> > > of the 180 degrees rotation property presence.
> >
> > Reconsidering these patches after the flipping vs. rotation discussion,
> > they seem fine. The only thing I'd like to see, after removing the rotation
> > property check, would be to add support for the actual flipping controls.
> > I'm pretty sure they can be found in the same registers as on CCS --- the
> > rest of the registers look very much like that. Would you like to send a
> > patch? :-)
> 
> Yes it is register 0x0101, bits 0 (H) & 1 (V).
> 
> Do watch out as there are register errors in the driver. Currently
> Y_ADD_STA is set to 0, and Y_ADD_END to 3118, giving 3119 lines total.
> That means that when you initially implement flips the Bayer order
> won't change, but you change the field of view by one line.
> The start and end values also break the requirements listed in the
> datasheets for STA/END values being multiples of X (table 4-2 of the
> datasheet). Correcting that will change the Bayer order when inverted.
> Does that count as a regression to userspace? I hope not. Memory says
> that if you don't correct Y_ADD_END then some of the binned modes
> misbehave.

As long as the driver reports the correct bayer pattern, it should be
fine.

Interactions between formats and flip controls is something we still
need to clarify. I plan to have a follow-up discussion on this with
Jacopo and Sakari after sending documentation patches for the
interactions between rotation and flips. If you would like to join the
fun, please let me know.

Also, if you have any comment on the rotation & flip discussion notes,
and especially if there's anything that doesn't seem right to you,
feedback would be appreciated. If everything is good, you can just ack
the documentation patches when I'll post them :-)

> I have been through this loop before as Soho Enterprise [1] make an
> IMX258 board for the Pi. I haven't upstreamed the patches [2] though
> (sorry).

Thanks for sharing the branch.

> [1] https://soho-enterprise.com/
> [2] https://github.com/raspberrypi/linux/commits/rpi-5.15.y/drivers/media/i2c/imx258.c

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-01-26 16:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 10:06 [PATCH 0/3] media: imx258: Remove rotation=<80 requirement Jacopo Mondi
2023-01-17 10:06 ` [PATCH 1/3] media: imx258: Parse and register properties Jacopo Mondi
2023-01-25 12:35   ` Laurent Pinchart
2023-01-17 10:06 ` [PATCH 2/3] media: imx258: Register H/V flip controls Jacopo Mondi
2023-01-17 10:17   ` Sakari Ailus
2023-01-17 10:28     ` Jacopo Mondi
2023-01-25 12:49       ` Laurent Pinchart
2023-01-17 10:06 ` [PATCH 3/3] media: imx258: Remove mandatory 180 degrees rotation Jacopo Mondi
2023-01-25 12:39   ` Laurent Pinchart
2023-01-26 14:52 ` [PATCH 0/3] media: imx258: Remove rotation=<80 requirement Sakari Ailus
2023-01-26 15:48   ` Dave Stevenson
2023-01-26 16:01     ` Laurent Pinchart [this message]
2023-01-26 16:13       ` Dave Stevenson
2023-01-26 16:02     ` Sakari Ailus
2023-01-26 16:44       ` Dave Stevenson
2023-01-26 17:31       ` Jacopo Mondi
2023-01-26 17:58         ` Dave Stevenson
2023-01-26 20:03           ` Jacopo Mondi
2023-01-27 11:08             ` Dave Stevenson
2023-02-27 17:11 ` Jacopo Mondi
2023-02-27 22:09   ` Sakari Ailus
2023-03-17  9:32     ` Robert Mader
2023-03-22 12:27     ` Jacopo Mondi
2023-03-22 12:30       ` Sakari Ailus
2023-03-22 12:32         ` 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=Y9Kjzm2PqSRBuoBT@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=robert.mader@collabora.com \
    --cc=sakari.ailus@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox