]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
media: ov5640: Fix set format, v4l2_mbus_pixelcode not updated
authorMirela Rabulea <mirela.rabulea@nxp.com>
Mon, 1 Nov 2021 19:52:51 +0000 (21:52 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:16 +0000 (11:57 +0200)
commit2c2c6e42cbbe388d4a842bf147a232b6ebac7d85
treef5c97fe61c3399eb0f5c3fdf79c0f9bf0245b7a1
parent27a8e0c45f0a18e29e5c58f85add4f229c248114
media: ov5640: Fix set format, v4l2_mbus_pixelcode not updated

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit e738f5dd67eb8098d75345908a5e73782d0569a5 ]

In ov5640_set_fmt, pending_fmt_change will always be false, because the
sensor format is saved before comparing it with the previous format:
fmt = &sensor->fmt;...
*fmt = *mbus_fmt;...
if (mbus_fmt->code != sensor->fmt.code)
sensor->pending_fmt_change = true;
This causes the sensor to capture with the previous pixelcode.

Also, changes might happen even for V4L2_SUBDEV_FORMAT_TRY, so fix that.

Basically, revert back to the state before
commit 071154499193 ("media: ov5640: Fix set format regression")
as it was more clear, and then update format even when pixelcode does
not change, as resolution might change.

Fixes: 071154499193 ("media: ov5640: Fix set format regression")
Fixes: 6949d864776e ("media: ov5640: do not change mode if format or frame interval is unchanged")
Fixes: fb98e29ff1ea5 ("media: ov5640: fix mode change regression")
Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Tested-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit f58159509b6251a2f80e281dffb8be338ed3c039)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/media/i2c/ov5640.c