]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: common: Add v4l2_find_nearest_size_conditional()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 5 Mar 2025 09:22:01 +0000 (11:22 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 6 May 2025 11:06:30 +0000 (13:06 +0200)
commit454ad0169cf7bb09e622c5bc40275ea725ab3a8a
tree59d48370f07f4c2916b37e5a348fa4e2be13aba4
parent65e52d07f1aada509c85c1bb86ce80dd8a5ce0c8
media: common: Add v4l2_find_nearest_size_conditional()

v4l2_find_nearest_size() returns a mode from sensor driver's mode list
that is a best match width and height wise for the sensor. Some drivers
have different set of available modes depending on the number of lanes.
While this could be handled within a driver by providing different lists
of modes, provide a helper v4l2_find_nearest_size_conditional() to ignore
modes that aren't available.

Also use size_t for the array index and remove extra commas while at it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/v4l2-core/v4l2-common.c
include/media/v4l2-common.h