bcm27xx: update 6.1 patches to latest version
[openwrt/staging/svanheule.git] / target / linux / bcm27xx / patches-6.1 / 950-1211-media-rp1-fe-Use-standard-link_validate.patch
1 From 0eeb351222adbc5b534c86f7815ee787babc3485 Mon Sep 17 00:00:00 2001
2 From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
3 Date: Tue, 3 Oct 2023 14:34:43 +0300
4 Subject: [PATCH] media: rp1: fe: Use standard link_validate
5
6 The current pisp_fe_link_validate() skips some important checks. Let's
7 rather use the standard v4l2_subdev_link_validate_default() as the
8 link_validate hook.
9
10 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
11 ---
12 .../platform/raspberrypi/rp1_cfe/pisp_fe.c | 36 +------------------
13 1 file changed, 1 insertion(+), 35 deletions(-)
14
15 --- a/drivers/media/platform/raspberrypi/rp1_cfe/pisp_fe.c
16 +++ b/drivers/media/platform/raspberrypi/rp1_cfe/pisp_fe.c
17 @@ -388,11 +388,6 @@ void pisp_fe_stop(struct pisp_fe_device
18 pisp_fe_reg_write(fe, FE_INT_STATUS, ~0);
19 }
20
21 -static struct pisp_fe_device *to_pisp_fe_device(struct v4l2_subdev *subdev)
22 -{
23 - return container_of(subdev, struct pisp_fe_device, sd);
24 -}
25 -
26 static int pisp_fe_init_cfg(struct v4l2_subdev *sd,
27 struct v4l2_subdev_state *state)
28 {
29 @@ -492,40 +487,11 @@ static int pisp_fe_pad_set_fmt(struct v4
30 }
31 }
32
33 -static int pisp_fe_link_validate(struct v4l2_subdev *sd,
34 - struct media_link *link,
35 - struct v4l2_subdev_format *source_fmt,
36 - struct v4l2_subdev_format *sink_fmt)
37 -{
38 - struct pisp_fe_device *fe = to_pisp_fe_device(sd);
39 -
40 - pisp_fe_dbg("%s: link \"%s\":%u -> \"%s\":%u\n", __func__,
41 - link->source->entity->name, link->source->index,
42 - link->sink->entity->name, link->sink->index);
43 -
44 - /* The width, height and code must match. */
45 - if (source_fmt->format.width != sink_fmt->format.width ||
46 - source_fmt->format.width != sink_fmt->format.width ||
47 - source_fmt->format.code != sink_fmt->format.code) {
48 - pisp_fe_err("%s: format does not match (source %ux%u 0x%x, sink %ux%u 0x%x)\n",
49 - __func__,
50 - source_fmt->format.width,
51 - source_fmt->format.height,
52 - source_fmt->format.code,
53 - sink_fmt->format.width,
54 - sink_fmt->format.height,
55 - sink_fmt->format.code);
56 - return -EPIPE;
57 - }
58 -
59 - return 0;
60 -}
61 -
62 static const struct v4l2_subdev_pad_ops pisp_fe_subdev_pad_ops = {
63 .init_cfg = pisp_fe_init_cfg,
64 .get_fmt = v4l2_subdev_get_fmt,
65 .set_fmt = pisp_fe_pad_set_fmt,
66 - .link_validate = pisp_fe_link_validate,
67 + .link_validate = v4l2_subdev_link_validate_default,
68 };
69
70 static const struct media_entity_operations pisp_fe_entity_ops = {