diff options
| author | Daniel Scally <dan.scally@ideasonboard.com> | 2023-05-02 13:35:47 +0300 |
|---|---|---|
| committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-05-25 17:21:23 +0300 |
| commit | 6c01e6f3f27b7baee6264e490eb608939fec9bbf (patch) | |
| tree | 7adefecf6d509c9c77d942ef96ebc3ef2b6cbfe5 | |
| parent | 306c3190b30d4d6a098888b9d7d4cefaa0ddcb91 (diff) | |
| download | linux-6c01e6f3f27b7baee6264e490eb608939fec9bbf.tar.xz | |
media: st-mipid02: Propagate format from sink to source pad
When setting formats on the sink pad, propagate the adjusted format over
to the subdev's source pad. Use the MIPID02_SOURCE macro to fetch the
pad's try format rather than relying on the pad field of the format to
facilitate this - the function is specific to the source pad anyway.
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
[Sakari Ailus: Line wrap, fix subject]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
| -rw-r--r-- | drivers/media/i2c/st-mipid02.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index dcd3ff2bbde9..906553a28676 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -750,7 +750,8 @@ static void mipid02_set_fmt_source(struct v4l2_subdev *sd, if (format->which != V4L2_SUBDEV_FORMAT_TRY) return; - *v4l2_subdev_get_try_format(sd, sd_state, format->pad) = format->format; + *v4l2_subdev_get_try_format(sd, sd_state, MIPID02_SOURCE) = + format->format; } static void mipid02_set_fmt_sink(struct v4l2_subdev *sd, @@ -768,6 +769,9 @@ static void mipid02_set_fmt_sink(struct v4l2_subdev *sd, fmt = &bridge->fmt; *fmt = format->format; + + /* Propagate the format change to the source pad */ + mipid02_set_fmt_source(sd, sd_state, format); } static int mipid02_set_fmt(struct v4l2_subdev *sd, |
