From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Kate Hsuan <hpa@redhat.com>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH] media: atomisp: Avoid picking too big sensor resolution
Date: Thu, 7 Nov 2024 10:09:26 +0200 [thread overview]
Message-ID: <Zyx1tlwysnNJmcEi@smile.fi.intel.com> (raw)
In-Reply-To: <20241106215509.40205-1-hdegoede@redhat.com>
On Wed, Nov 06, 2024 at 10:55:09PM +0100, Hans de Goede wrote:
> atomisp_try_fmt() is limiting the width of the requested resolution to 1920
> before calling the sensor's try_fmt() method. But it is not limiting
> the height. In case of the old mode-list based t4ka3 driver which has
> a mode list of:
>
> 736x496
> 896x736
> 1936x1096
> 3280x2464
>
> This results in 3280x2464 being selected when try_fmt is called
> with a requested resolution of 3280x2464, which is not supported because
> its width > 1920 .
>
> Fix this by also limiting the height when in preview mode.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
...
> + /*
> + * The preview pipeline does not support width > 1920. Also limit height
> + * to avoid sensor drivers still picking a too wide resolution.
> + */
> + if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) {
> f->width = min_t(u32, f->width, 1920);
> + f->height = min_t(u32, f->height, 1440);
Perhaps umin() instead of min_t() in both cases?
> + }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-11-07 8:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 21:55 [PATCH] media: atomisp: Avoid picking too big sensor resolution Hans de Goede
2024-11-07 8:09 ` Andy Shevchenko [this message]
2024-11-07 8:10 ` Andy Shevchenko
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=Zyx1tlwysnNJmcEi@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=hpa@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--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