]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: atomisp: Remove isp_subdev_propagate()
authorHans de Goede <hdegoede@redhat.com>
Sat, 3 Feb 2024 11:42:06 +0000 (12:42 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 11 Apr 2024 13:40:28 +0000 (15:40 +0200)
isp_subdev_propagate() is a wrapper around atomisp_subdev_set_selection()
which gets only used in a single place.

Call atomisp_subdev_set_selection() directly in that single place instead.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_subdev.c

index a87fc74159e2056ce250d35696bb62520634333a..8293bda0c6810d8b60dd95ccaa8e53211b53ead7 100644 (file)
@@ -287,35 +287,6 @@ static void isp_get_fmt_rect(struct v4l2_subdev *sd,
        }
 }
 
-static void isp_subdev_propagate(struct v4l2_subdev *sd,
-                                struct v4l2_subdev_state *sd_state,
-                                u32 which, uint32_t pad, uint32_t target,
-                                uint32_t flags)
-{
-       struct v4l2_mbus_framefmt *ffmt[ATOMISP_SUBDEV_PADS_NUM];
-       struct v4l2_rect *crop[ATOMISP_SUBDEV_PADS_NUM],
-                      *comp[ATOMISP_SUBDEV_PADS_NUM];
-
-       if (flags & V4L2_SEL_FLAG_KEEP_CONFIG)
-               return;
-
-       isp_get_fmt_rect(sd, sd_state, which, ffmt, crop, comp);
-
-       switch (pad) {
-       case ATOMISP_SUBDEV_PAD_SINK: {
-               struct v4l2_rect r = {0};
-
-               /* Only crop target supported on sink pad. */
-               r.width = ffmt[pad]->width;
-               r.height = ffmt[pad]->height;
-
-               atomisp_subdev_set_selection(sd, sd_state, which, pad,
-                                            target, flags, &r);
-               break;
-       }
-       }
-}
-
 static int isp_subdev_get_selection(struct v4l2_subdev *sd,
                                    struct v4l2_subdev_state *sd_state,
                                    struct v4l2_subdev_selection *sel)
@@ -541,6 +512,7 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
        case ATOMISP_SUBDEV_PAD_SINK: {
                const struct atomisp_in_fmt_conv *fc =
                    atomisp_find_in_fmt_conv(ffmt->code);
+               struct v4l2_rect r = {};
 
                if (!fc) {
                        fc = atomisp_in_fmt_conv;
@@ -551,8 +523,12 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
 
                *__ffmt = *ffmt;
 
-               isp_subdev_propagate(sd, sd_state, which, pad,
-                                    V4L2_SEL_TGT_CROP, 0);
+               /* Propagate new ffmt to selection */
+               r.width = ffmt->width;
+               r.height = ffmt->height;
+               /* Only crop target supported on sink pad. */
+               atomisp_subdev_set_selection(sd, sd_state, which, pad,
+                                            V4L2_SEL_TGT_CROP, 0, &r);
 
                if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
                        atomisp_css_input_set_resolution(isp_sd,