Skip to content
/ linux Public

Commit 7ab5e86

Browse files
Hans VerkuilSasha Levin
authored andcommitted
media: omap3isp: isppreview: always clamp in preview_try_format()
[ Upstream commit 17e1e16 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent dd1bdab commit 7ab5e86

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

drivers/media/platform/ti/omap3isp/isppreview.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,22 +1742,17 @@ static void preview_try_format(struct isp_prev_device *prev,
17421742

17431743
switch (pad) {
17441744
case PREV_PAD_SINK:
1745-
/* When reading data from the CCDC, the input size has already
1746-
* been mangled by the CCDC output pad so it can be accepted
1747-
* as-is.
1748-
*
1749-
* When reading data from memory, clamp the requested width and
1750-
* height. The TRM doesn't specify a minimum input height, make
1745+
/*
1746+
* Clamp the requested width and height.
1747+
* The TRM doesn't specify a minimum input height, make
17511748
* sure we got enough lines to enable the noise filter and color
17521749
* filter array interpolation.
17531750
*/
1754-
if (prev->input == PREVIEW_INPUT_MEMORY) {
1755-
fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
1756-
preview_max_out_width(prev));
1757-
fmt->height = clamp_t(u32, fmt->height,
1758-
PREV_MIN_IN_HEIGHT,
1759-
PREV_MAX_IN_HEIGHT);
1760-
}
1751+
fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
1752+
preview_max_out_width(prev));
1753+
fmt->height = clamp_t(u32, fmt->height,
1754+
PREV_MIN_IN_HEIGHT,
1755+
PREV_MAX_IN_HEIGHT);
17611756

17621757
fmt->colorspace = V4L2_COLORSPACE_SRGB;
17631758

0 commit comments

Comments
 (0)