]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: renesas: vsp1: brx: Fix format propagation
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 18 Mar 2026 23:59:01 +0000 (01:59 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 25 Mar 2026 09:25:48 +0000 (10:25 +0100)
The format width and height is never propagated to the BRX source pad,
leaving its initial configuration invalid. Propagate the whole format
from the first sink pad to the source pad instead of only propagating
the media bus code. This fixes compliance with the subdev format
propagation rules.

Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M
Link: https://patch.msgid.link/20260318235907.831556-8-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/renesas/vsp1/vsp1_brx.c

index dd651cef93e4e452afdcf396427f33bd678b50af..911359faa6000ea579fb581ae7b144e992f2dffd 100644 (file)
@@ -156,14 +156,20 @@ static int brx_set_format(struct v4l2_subdev *subdev,
                compose->height = format->height;
        }
 
-       /* Propagate the format code to all pads. */
+       /*
+        * Propagate the format code to all pads, and the whole format to the
+        * source pad.
+        */
        if (fmt->pad == BRX_PAD_SINK(0)) {
                unsigned int i;
 
-               for (i = 0; i <= brx->entity.source_pad; ++i) {
+               for (i = 0; i < brx->entity.source_pad; ++i) {
                        format = v4l2_subdev_state_get_format(state, i);
                        format->code = fmt->format.code;
                }
+
+               format = v4l2_subdev_state_get_format(state, i);
+               *format = fmt->format;
        }
 
 done: