media: renesas: vsp1: Drop vsp1_rwpf_get_crop() wrapper
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 12 Nov 2023 02:14:05 +0000 (04:14 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 19 Jun 2024 22:36:47 +0000 (01:36 +0300)
The vsp1_rwpf_get_crop() function is just a wrapper around
v4l2_subdev_state_get_crop() without any added value. Drop it and call
v4l2_subdev_state_get_crop() directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
drivers/media/platform/renesas/vsp1/vsp1_rpf.c
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
drivers/media/platform/renesas/vsp1/vsp1_rwpf.h

index 4efcec5253d60f1c3065e1fba94faaae3ab51fe3..3e62638fdce606ff4380a0da009b7e8b942766a2 100644 (file)
@@ -298,7 +298,7 @@ static void rpf_configure_partition(struct vsp1_entity *entity,
         * offsets are needed, as planes 2 and 3 always have identical
         * strides.
         */
-       crop = *vsp1_rwpf_get_crop(rpf, rpf->entity.state);
+       crop = *v4l2_subdev_state_get_crop(rpf->entity.state, RWPF_PAD_SINK);
 
        /*
         * Partition Algorithm Control
index 574623a48a3d6f7053a01489bf69eb3863c50983..9d38203e73d00b82a1a7db0353e2f0b5a94084f6 100644 (file)
 #define RWPF_MIN_WIDTH                         1
 #define RWPF_MIN_HEIGHT                                1
 
-struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
-                                    struct v4l2_subdev_state *sd_state)
-{
-       return v4l2_subdev_state_get_crop(sd_state, RWPF_PAD_SINK);
-}
-
 /* -----------------------------------------------------------------------------
  * V4L2 Subdevice Operations
  */
@@ -105,7 +99,7 @@ static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
                struct v4l2_rect *crop;
 
                /* Update the sink crop rectangle. */
-               crop = vsp1_rwpf_get_crop(rwpf, state);
+               crop = v4l2_subdev_state_get_crop(state, RWPF_PAD_SINK);
                crop->left = 0;
                crop->top = 0;
                crop->width = fmt->format.width;
@@ -152,7 +146,7 @@ static int vsp1_rwpf_get_selection(struct v4l2_subdev *subdev,
 
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP:
-               sel->r = *vsp1_rwpf_get_crop(rwpf, state);
+               sel->r = *v4l2_subdev_state_get_crop(state, RWPF_PAD_SINK);
                break;
 
        case V4L2_SEL_TGT_CROP_BOUNDS:
@@ -222,7 +216,7 @@ static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
        sel->r.height = min_t(unsigned int, sel->r.height,
                              format->height - sel->r.top);
 
-       crop = vsp1_rwpf_get_crop(rwpf, state);
+       crop = v4l2_subdev_state_get_crop(state, RWPF_PAD_SINK);
        *crop = sel->r;
 
        /* Propagate the format to the source pad. */
index e0d212c70b2f99bfd693a1ea169621a282c73237..5ac9f0a6fafcee955f32d768aafe8a87516908ae 100644 (file)
@@ -85,7 +85,4 @@ int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf, unsigned int ncontrols);
 
 extern const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops;
 
-struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
-                                    struct v4l2_subdev_state *sd_state);
-
 #endif /* __VSP1_RWPF_H__ */