From: Philipp Zabel <p.zabel@pengutronix.de>
To: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org
Cc: Rui Miguel Silva <rui.silva@linaro.org>, kernel@pengutronix.de
Subject: Re: [PATCH] media: video-mux: fix compliance failures
Date: Wed, 23 May 2018 11:30:47 +0200 [thread overview]
Message-ID: <1527067847.6875.3.camel@pengutronix.de> (raw)
In-Reply-To: <322fa7c6-451e-bb81-eaa6-8677350b64ee@xs4all.nl>
On Wed, 2018-05-23 at 10:53 +0200, Hans Verkuil wrote:
> On 23/05/18 10:47, Philipp Zabel wrote:
> > Hi Hans,
> >
> > thank you for the review comments.
> >
> > On Tue, 2018-05-22 at 19:47 +0200, Hans Verkuil wrote:
> > > On 22/05/18 18:29, Philipp Zabel wrote:
> > > > Limit frame sizes to the [1, UINT_MAX-1] interval, media bus formats to
> > > > the available list of formats, and initialize pad and try formats.
> > > >
> > > > Reported-by: Rui Miguel Silva <rui.silva@linaro.org>
> > > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > > > ---
> > > > drivers/media/platform/video-mux.c | 110 +++++++++++++++++++++++++++++
> > > > 1 file changed, 110 insertions(+)
> > > >
> > > > diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c
> > > > index 1fb887293337..ade1dae706aa 100644
> > > > --- a/drivers/media/platform/video-mux.c
> > > > +++ b/drivers/media/platform/video-mux.c
> > > > @@ -180,6 +180,87 @@ static int video_mux_set_format(struct v4l2_subdev *sd,
> > > > if (!source_mbusformat)
> > > > return -EINVAL;
> > > >
> > > > + /* No size limitations except V4L2 compliance requirements */
> > > > + v4l_bound_align_image(&sdformat->format.width, 1, UINT_MAX - 1, 0,
> > > > + &sdformat->format.height, 1, UINT_MAX - 1, 0, 0);
> > >
> > > This is a bit dubious. I would pick more realistic min/max values like 16 and
> >
> > Why 16? A grayscale or RGB sensor could crop down to 1x1, see mt9v032
> > for example.
>
> Was that ever tested? Just because the software allows it, doesn't mean it actually
> works.
I don't know. I'll test this when I get access to a sensor that could
support such low cropping.
I'd just prefer this artificial limit not to be imposed by the generic
video mux driver, as a mux doesn't care about framing.
For example the i.MX media driver currently has an (also artificial)
limit to 16 pixel aligned frame sizes in the CSI subdev anyway.
regards
Philipp
prev parent reply other threads:[~2018-05-23 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 16:29 [PATCH] media: video-mux: fix compliance failures Philipp Zabel
2018-05-22 17:47 ` Hans Verkuil
2018-05-23 8:47 ` Philipp Zabel
2018-05-23 8:53 ` Hans Verkuil
2018-05-23 9:30 ` Philipp Zabel [this message]
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=1527067847.6875.3.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=hverkuil@xs4all.nl \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=rui.silva@linaro.org \
/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