]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: mt9m114: Update source pad selection and format when sink pad format changes
authorHans de Goede <johannes.goede@oss.qualcomm.com>
Tue, 30 Dec 2025 17:03:07 +0000 (18:03 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 14 Jan 2026 22:33:04 +0000 (23:33 +0100)
Call mt9m114_ifp_update_sel_and_src_fmt() on sink pad format changes to
propagate these downstream.

This is necessary in 2 different scenarios:

1. When passing through RAW10 bypassing the scaler then any sink pad format
changes must be propagated to the crop/compose selections and to the source
pad format.

2. When the scaler is active, then the crop-rectangle cannot be bigger then
the sink pad format minus a 4 pixel border all around. If the sink format
change reduces the size then things also needs to be propagated downstream.

Rather then adding extra code to check for these conditions, simply always
propagate sink pad format changes downstream.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/mt9m114.c

index 6dd8e1cbe99e6c1c61bdf5996f562d13e7de9aa4..c107e9f26618d6b0dd398065fc28789055190fe6 100644 (file)
@@ -1892,6 +1892,9 @@ static int mt9m114_ifp_set_fmt(struct v4l2_subdev *sd,
                format->height = clamp(ALIGN(fmt->format.height, 8),
                                       MT9M114_PIXEL_ARRAY_MIN_OUTPUT_HEIGHT,
                                       MT9M114_PIXEL_ARRAY_HEIGHT);
+
+               /* Propagate changes downstream. */
+               mt9m114_ifp_update_sel_and_src_fmt(state);
        } else {
                const struct mt9m114_format_info *info;