mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
media: omap3isp: isppreview: always clamp in preview_try_format()
If prev->input != PREVIEW_INPUT_MEMORY the width and height weren't clamped. Just always clamp. This fixes a v4l2-compliance error: fail: v4l2-test-subdevs.cpp(171): fse.max_width == ~0U || fse.max_height == ~0U fail: v4l2-test-subdevs.cpp(270): ret && ret != ENOTTY test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: FAIL Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
This commit is contained in:
parent
ccd7979689
commit
17e1e1641f
|
|
@ -1742,22 +1742,17 @@ static void preview_try_format(struct isp_prev_device *prev,
|
|||
|
||||
switch (pad) {
|
||||
case PREV_PAD_SINK:
|
||||
/* When reading data from the CCDC, the input size has already
|
||||
* been mangled by the CCDC output pad so it can be accepted
|
||||
* as-is.
|
||||
*
|
||||
* When reading data from memory, clamp the requested width and
|
||||
* height. The TRM doesn't specify a minimum input height, make
|
||||
/*
|
||||
* Clamp the requested width and height.
|
||||
* The TRM doesn't specify a minimum input height, make
|
||||
* sure we got enough lines to enable the noise filter and color
|
||||
* filter array interpolation.
|
||||
*/
|
||||
if (prev->input == PREVIEW_INPUT_MEMORY) {
|
||||
fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
|
||||
preview_max_out_width(prev));
|
||||
fmt->height = clamp_t(u32, fmt->height,
|
||||
PREV_MIN_IN_HEIGHT,
|
||||
PREV_MAX_IN_HEIGHT);
|
||||
}
|
||||
fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
|
||||
preview_max_out_width(prev));
|
||||
fmt->height = clamp_t(u32, fmt->height,
|
||||
PREV_MIN_IN_HEIGHT,
|
||||
PREV_MAX_IN_HEIGHT);
|
||||
|
||||
fmt->colorspace = V4L2_COLORSPACE_SRGB;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user