From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Kate Hsuan <hpa@redhat.com>
Cc: Hans de Goede <johannes.goede@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Serin Yeh <serin.yeh@intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] media: i2c: imx471: Add Sony IMX471 image sensor driver
Date: Tue, 28 Apr 2026 11:49:42 +0300 [thread overview]
Message-ID: <afB0pi_kv-DoCpTS@kekkonen.localdomain> (raw)
In-Reply-To: <CAEth8oGAgn9i3Fh_hes+KPhEwZCTNxKJdyOeQyt9i40inX0Kng@mail.gmail.com>
Hi Kate,
On Tue, Apr 28, 2026 at 11:08:56AM +0800, Kate Hsuan wrote:
> > > >> Updating both offsets here is wrong when hflip != vflip, you
> > > >> should only update V_WIN_OFFSET when changing vflip and
> > > >> H_WIN_OFFSET when changing hflip.
> > > >
> > > > The cropping configuration should reflect the values on the sensor's pixel
> > > > array and should not be affected by flipping. At least the crop window
> > > > needs to be adjusted accordingly by the driver. Is there a need to change
> > > > flipping while streaming?
> > >
> > > Ah, that is a very valid question, no I don't think we do need to
> > > set them while streaming.
> > >
> > > Kate if you cannot get the start_x / start_y coordinate changes
> > > when changing flipping to work to get a stable bayer output
> > > pattern, then another way to fix this is to only allow changing
> > > the flip controls while not streaming and return -EBUSY otherwise.
> > >
> > > This can then be combined with reporting a flip-ctrl dependend
> > > bayer-order so that userspace sees the right bayer-order after
> > > flipping is applied as long as userspace reads the subdev format
> > > after setting the controls (which libcamera does I believe).
> >
> > It's indeed currently a bit annoying to implement this. The common raw
> > sensor model will make this easier as the driver just indicates the native
> > pattern to userspace. I don't have an estimate currently when that set
> > would be in so the wait could be very long. Libcamera will need changes,
> > too.
> >
> > >
> > > For an example of an imx driver which reports a different
> > > bayer order depending in flipping see: imx214.c and
> > > the imx214_get_format_code() helper, a call to which should
> > > be used to replace any hardcoded mbus-formats in the driver.
> >
>
> After many configuration attempts, tweaking the X, Y coordinates can
> not get the right Bayer order for the hflip, and also breaks the
> sensor's requirement (multiple by 4). However, changing the Bayer
> format for each kind of flipping works, and the colour is correct for
> every kind of flip, including h/v flipping. The side-effect is that
> the user can't flip the image during runtime.
>
> It also worked with libcamera. Qcam shows the right colour when
> rotating the image 180 degrees.
> I'll continue to work on this approach, :)
Sounds good. Thanks for confirming this.
--
Kind regards,
Sakari Ailus
next prev parent reply other threads:[~2026-04-28 8:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 8:32 [PATCH 0/2] Add Sony IMX471 camera sensor driver Kate Hsuan
2026-04-17 8:32 ` [PATCH 1/2] media: ipu-bridge: Add DMI information of Lenovo X9 to the image upside-down list Kate Hsuan
2026-04-17 10:37 ` Hans de Goede
2026-04-20 7:40 ` Kate Hsuan
2026-04-17 8:32 ` [PATCH 2/2] media: i2c: imx471: Add Sony IMX471 image sensor driver Kate Hsuan
2026-04-17 10:16 ` Hans de Goede
2026-04-20 4:05 ` Kate Hsuan
2026-04-20 6:48 ` Yeh, Serin
2026-04-20 7:23 ` Yeh, Serin
2026-04-20 8:59 ` Hans de Goede
2026-04-21 9:26 ` Sakari Ailus
2026-04-21 9:02 ` Sakari Ailus
2026-04-21 9:47 ` Hans de Goede
2026-04-21 20:05 ` Sakari Ailus
2026-04-28 3:08 ` Kate Hsuan
2026-04-28 8:49 ` Sakari Ailus [this message]
2026-04-21 9:23 ` Sakari Ailus
2026-04-28 4:05 ` Kate Hsuan
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=afB0pi_kv-DoCpTS@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=hpa@redhat.com \
--cc=hverkuil+cisco@kernel.org \
--cc=johannes.goede@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=serin.yeh@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