From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo@jmondi.org>
Cc: "Krzysztof Hałasa" <khalasa@piap.pl>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Sakari Ailus" <sakari.ailus@iki.fi>,
linux-media@vger.kernel.org
Subject: Re: [PATCH 01/10] media: ar0521: Implement enum_frame_sizes
Date: Fri, 7 Oct 2022 11:11:28 +0300 [thread overview]
Message-ID: <Yz/fMH5iEWtKDWNF@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20221007072959.n52j2bzrn6xstjnd@uno.localdomain>
Hi Jacopo,
On Fri, Oct 07, 2022 at 09:29:59AM +0200, Jacopo Mondi wrote:
> On Thu, Oct 06, 2022 at 07:33:45PM +0300, Laurent Pinchart wrote:
> > On Wed, Oct 05, 2022 at 09:06:04PM +0200, Jacopo Mondi wrote:
> > > Implement the enum_frame_size pad operation.
> > >
> > > The sensor supports a continuous size range of resolutions.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> > > ---
> > > drivers/media/i2c/ar0521.c | 19 +++++++++++++++++++
> > > 1 file changed, 19 insertions(+)
> > >
> > > diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c
> > > index c7bdfc69b9be..89f3c01f18ce 100644
> > > --- a/drivers/media/i2c/ar0521.c
> > > +++ b/drivers/media/i2c/ar0521.c
> > > @@ -798,6 +798,24 @@ static int ar0521_enum_mbus_code(struct v4l2_subdev *sd,
> > > return 0;
> > > }
> > >
> > > +static int ar0521_enum_frame_size(struct v4l2_subdev *sd,
> > > + struct v4l2_subdev_state *sd_state,
> > > + struct v4l2_subdev_frame_size_enum *fse)
> > > +{
> > > + if (fse->index)
> > > + return -EINVAL;
> > > +
> > > + if (fse->code != MEDIA_BUS_FMT_SGRBG8_1X8)
> > > + return -EINVAL;
> > > +
> > > + fse->min_width = AR0521_WIDTH_MIN;
> > > + fse->max_width = AR0521_WIDTH_MAX;
> > > + fse->min_height = AR0521_HEIGHT_MIN;
> > > + fse->max_height = AR0521_HEIGHT_MAX;
> >
> > This matches the driver implementation of .set_fmt(), but that's because
> > the driver is *really* wrong :-( It uses the format to configure the
> > crop rectangle, which is not right. This needs to be fixed.
>
> As far as I understand it, the driver supports smaller resolutions by
> cropping only, while the sensor would be actually capable of binning.
>
> As the driver currently only crops, the analog rectangle always matches the
> output size hence adding s_selection(CROP) just to replicate what
> s_ftm() does feels a little dumb ?
>
> I concur that ideally the driver should be capable of producing
> smaller resolution by binning, and in that case being able to
> configure the analog crop rectangle would be useful. But as long as it
> doesn't...
We have enough issues with sensor drivers implementing binning or
skipping in different ways to not make it worse by implementing cropping
in a creative way as wall :-)
The first step is to fix the driver to implement the selection API. Then
binning and skipping can be implemented on top, if anyone becomes
interested in them.
> > > +
> > > + return 0;
> > > +}
> > > +
> > > static int ar0521_pre_streamon(struct v4l2_subdev *sd, u32 flags)
> > > {
> > > struct ar0521_dev *sensor = to_ar0521_dev(sd);
> > > @@ -864,6 +882,7 @@ static const struct v4l2_subdev_video_ops ar0521_video_ops = {
> > >
> > > static const struct v4l2_subdev_pad_ops ar0521_pad_ops = {
> > > .enum_mbus_code = ar0521_enum_mbus_code,
> > > + .enum_frame_size = ar0521_enum_frame_size,
> > > .get_fmt = ar0521_get_fmt,
> > > .set_fmt = ar0521_set_fmt,
> > > };
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2022-10-07 8:11 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 19:06 [PATCH 00/10] media: ar0521: Add analog gain, rework clock tree Jacopo Mondi
2022-10-05 19:06 ` [PATCH 01/10] media: ar0521: Implement enum_frame_sizes Jacopo Mondi
2022-10-06 14:37 ` Dave Stevenson
2022-10-06 16:33 ` Laurent Pinchart
2022-10-07 4:57 ` Krzysztof Hałasa
2022-10-07 8:08 ` Laurent Pinchart
2022-10-07 7:29 ` Jacopo Mondi
2022-10-07 8:11 ` Laurent Pinchart [this message]
2022-10-07 10:32 ` Dave Stevenson
2022-10-07 12:05 ` Sakari Ailus
2022-10-07 12:12 ` Laurent Pinchart
2022-10-05 19:06 ` [PATCH 02/10] media: ar0521: Add V4L2_CID_ANALOG_GAIN Jacopo Mondi
2022-10-06 14:44 ` Dave Stevenson
2022-10-06 15:00 ` Jacopo Mondi
2022-10-06 15:05 ` Laurent Pinchart
2022-10-07 5:28 ` Krzysztof Hałasa
2022-10-07 8:20 ` Laurent Pinchart
2022-10-12 18:54 ` Sakari Ailus
2022-10-13 9:30 ` Laurent Pinchart
2022-10-07 5:20 ` Krzysztof Hałasa
2022-10-07 7:17 ` Jacopo Mondi
2022-10-07 8:30 ` Laurent Pinchart
2022-10-07 12:01 ` Krzysztof Hałasa
2022-10-07 12:07 ` Laurent Pinchart
2022-10-07 14:02 ` Krzysztof Hałasa
2022-10-17 15:10 ` Jacopo Mondi
2022-10-17 15:57 ` Sakari Ailus
2022-10-17 16:31 ` Jacopo Mondi
2022-10-17 16:37 ` Sakari Ailus
2022-10-17 16:42 ` Dave Stevenson
2022-10-07 11:56 ` Krzysztof Hałasa
2022-10-07 12:11 ` Laurent Pinchart
2022-10-07 14:00 ` Krzysztof Hałasa
2022-10-05 19:06 ` [PATCH 03/10] media: ar0521: Set maximum resolution to 2592x1944 Jacopo Mondi
2022-10-06 14:57 ` Dave Stevenson
2022-10-07 13:06 ` Laurent Pinchart
2022-10-20 11:23 ` Jacopo Mondi
2022-10-07 5:33 ` Krzysztof Hałasa
2022-10-07 12:42 ` Jacopo Mondi
2022-10-07 14:07 ` Krzysztof Hałasa
2022-10-05 19:06 ` [PATCH 04/10] media: ar0521: Rework PLL computation Jacopo Mondi
2022-10-07 13:56 ` Laurent Pinchart
2022-10-12 19:02 ` Sakari Ailus
2022-10-13 9:31 ` Laurent Pinchart
2022-10-05 19:06 ` [PATCH 05/10] media: ar0521: Add LINK_FREQ control Jacopo Mondi
2022-10-06 15:10 ` Dave Stevenson
2022-10-07 14:01 ` Laurent Pinchart
2022-10-07 14:26 ` Dave Stevenson
2022-10-16 1:53 ` Laurent Pinchart
2022-10-17 11:21 ` Dave Stevenson
2022-10-17 9:24 ` Jacopo Mondi
2022-10-17 11:00 ` Dave Stevenson
2022-10-17 12:00 ` Jacopo Mondi
2022-10-05 19:06 ` [PATCH 06/10] media: ar0521: Configure pixel rate using LINK_FREQ Jacopo Mondi
2022-10-06 5:51 ` kernel test robot
2022-10-06 15:42 ` Sakari Ailus
2022-10-07 7:25 ` Jacopo Mondi
2022-10-07 5:52 ` Krzysztof Hałasa
2022-10-05 19:06 ` [PATCH 07/10] media: ar0521: Adjust exposure and blankings limits Jacopo Mondi
2022-10-06 2:08 ` kernel test robot
2022-10-06 4:17 ` kernel test robot
2022-10-06 15:41 ` Dave Stevenson
2022-10-05 19:06 ` [PATCH 08/10] media: ar0521: Setup controls at s_stream time Jacopo Mondi
2022-10-06 15:43 ` Dave Stevenson
2022-10-07 7:23 ` Jacopo Mondi
2022-10-05 19:06 ` [PATCH 09/10] media: ar0521: Rework startup sequence Jacopo Mondi
2022-10-06 15:45 ` Dave Stevenson
2022-10-05 19:06 ` [PATCH 10/10] media: ar0521: Tab-align definitions Jacopo Mondi
2022-10-06 15:48 ` Dave Stevenson
2022-10-06 16:11 ` Laurent Pinchart
2022-10-07 5:42 ` Krzysztof Hałasa
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=Yz/fMH5iEWtKDWNF@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=jacopo@jmondi.org \
--cc=khalasa@piap.pl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--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