Re: [PATCH v7 03/18] media: sony-starvis2: Always program the sensor in window mode

From: Laurent Pinchart

Date: Mon Nov 30 2026 - 22:50:55 EST


On Mon, Nov 30, 2026 at 03:47:39PM +0000, Dave Stevenson wrote:
> On Mon, 30 Nov 2026 at 02:46, Laurent Pinchart wrote:
> > On Thu, Oct 29, 2026 at 02:18:24PM +0000, Dave Stevenson wrote:
> > > If the requested region matched the defined active area then
> > > the driver switched to all-pixel mode. This left the possibility
> > > that the active area was incorrect and not reading out the area
> > > expected.
> >
> > That would be a bug in the driver that should be fixed, wouldn't it ?
>
> If you can find documentation from Sony for all these sensors that
> says exactly which pixels their "All-pixel" mode reads out, then
> you're a better man than me.

Have you noticed where the "all-pixel mode" differs from the active area
the driver reports to userspace ?

> It was partly self-preservation having got it wrong for imx675 at one
> point resulting in weird images, and not wanting to go down the same
> path with the others.
>
> > > Switch to always requesting window mode to avoid this potential
> > > mismatch.
> >
> > This simplifies the code and (hopefully) has no negative side effect, so
> > no objection.
>
> No negative side effects that I've found documentation for.
>
> > > Signed-off-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>
> > > ---
> > > drivers/media/i2c/sony-starvis2.c | 4 +---
> > > 1 file changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/media/i2c/sony-starvis2.c b/drivers/media/i2c/sony-starvis2.c
> > > index 134fececac5c..31aa1ec6ba40 100644
> > > --- a/drivers/media/i2c/sony-starvis2.c
> > > +++ b/drivers/media/i2c/sony-starvis2.c
> > > @@ -923,9 +923,7 @@ static int starvis2_program_window(struct starvis2 *starvis2,
> > > int ret = 0;
> > >
> > > cci_write(starvis2->cci, STARVIS2_REG_ADDMODE, 0x00, &ret);
> > > - cci_write(starvis2->cci, STARVIS2_REG_WINMODE,
> > > - v4l2_rect_equal(crop, &imx678_active_area) ? 0x00 : 0x04,
> > > - &ret);
> > > + cci_write(starvis2->cci, STARVIS2_REG_WINMODE, 0x04, &ret);
> > > cci_write(starvis2->cci, STARVIS2_REG_PIX_HST,
> > > crop->left - imx678_active_area.left, &ret);
> > > cci_write(starvis2->cci, STARVIS2_REG_PIX_HWIDTH, crop->width, &ret);

--
Regards,

Laurent Pinchart