media: renesas: vsp1: Drop vsp1_entity_get_pad_format() 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:46 +0000 (01:36 +0300)
The vsp1_entity_get_pad_format() function is just a wrapper around
v4l2_subdev_state_get_format() without any added value. Drop it and call
v4l2_subdev_state_get_format() directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
14 files changed:
drivers/media/platform/renesas/vsp1/vsp1_brx.c
drivers/media/platform/renesas/vsp1/vsp1_clu.c
drivers/media/platform/renesas/vsp1/vsp1_entity.c
drivers/media/platform/renesas/vsp1/vsp1_entity.h
drivers/media/platform/renesas/vsp1/vsp1_histo.c
drivers/media/platform/renesas/vsp1/vsp1_hsit.c
drivers/media/platform/renesas/vsp1/vsp1_lif.c
drivers/media/platform/renesas/vsp1/vsp1_rpf.c
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
drivers/media/platform/renesas/vsp1/vsp1_sru.c
drivers/media/platform/renesas/vsp1/vsp1_uds.c
drivers/media/platform/renesas/vsp1/vsp1_uif.c
drivers/media/platform/renesas/vsp1/vsp1_video.c
drivers/media/platform/renesas/vsp1/vsp1_wpf.c

index a8535c6e2c464bb6a40ed26b3158551e937139d4..0eb4d8fe42859e3e9cd50a38129b0054e38bb234 100644 (file)
@@ -119,8 +119,8 @@ static void brx_try_format(struct vsp1_brx *brx,
 
        default:
                /* The BRx can't perform format conversion. */
-               format = vsp1_entity_get_pad_format(&brx->entity, sd_state,
-                                                   BRX_PAD_SINK(0));
+               format = v4l2_subdev_state_get_format(sd_state,
+                                                     BRX_PAD_SINK(0));
                fmt->code = format->code;
                break;
        }
@@ -150,7 +150,7 @@ static int brx_set_format(struct v4l2_subdev *subdev,
 
        brx_try_format(brx, state, fmt->pad, &fmt->format);
 
-       format = vsp1_entity_get_pad_format(&brx->entity, state, fmt->pad);
+       format = v4l2_subdev_state_get_format(state, fmt->pad);
        *format = fmt->format;
 
        /* Reset the compose rectangle. */
@@ -169,8 +169,7 @@ static int brx_set_format(struct v4l2_subdev *subdev,
                unsigned int i;
 
                for (i = 0; i <= brx->entity.source_pad; ++i) {
-                       format = vsp1_entity_get_pad_format(&brx->entity,
-                                                           state, i);
+                       format = v4l2_subdev_state_get_format(state, i);
                        format->code = fmt->format.code;
                }
        }
@@ -242,8 +241,7 @@ static int brx_set_selection(struct v4l2_subdev *subdev,
         * The compose rectangle top left corner must be inside the output
         * frame.
         */
-       format = vsp1_entity_get_pad_format(&brx->entity, state,
-                                           brx->entity.source_pad);
+       format = v4l2_subdev_state_get_format(state, brx->entity.source_pad);
        sel->r.left = clamp_t(unsigned int, sel->r.left, 0, format->width - 1);
        sel->r.top = clamp_t(unsigned int, sel->r.top, 0, format->height - 1);
 
@@ -251,7 +249,7 @@ static int brx_set_selection(struct v4l2_subdev *subdev,
         * Scaling isn't supported, the compose rectangle size must be identical
         * to the sink format size.
         */
-       format = vsp1_entity_get_pad_format(&brx->entity, state, sel->pad);
+       format = v4l2_subdev_state_get_format(state, sel->pad);
        sel->r.width = format->width;
        sel->r.height = format->height;
 
@@ -290,8 +288,8 @@ static void brx_configure_stream(struct vsp1_entity *entity,
        unsigned int flags;
        unsigned int i;
 
-       format = vsp1_entity_get_pad_format(&brx->entity, brx->entity.state,
-                                           brx->entity.source_pad);
+       format = v4l2_subdev_state_get_format(brx->entity.state,
+                                             brx->entity.source_pad);
 
        /*
         * The hardware is extremely flexible but we have no userspace API to
index 625776a9bda416e30f069295bcb062382d1a74db..1e57676a420c581d3c7bd085604a1e56e342f85e 100644 (file)
@@ -181,8 +181,7 @@ static void clu_configure_stream(struct vsp1_entity *entity,
         * The yuv_mode can't be changed during streaming. Cache it internally
         * for future runtime configuration calls.
         */
-       format = vsp1_entity_get_pad_format(&clu->entity, clu->entity.state,
-                                           CLU_PAD_SINK);
+       format = v4l2_subdev_state_get_format(clu->entity.state, CLU_PAD_SINK);
        clu->yuv_mode = format->code == MEDIA_BUS_FMT_AYUV8_1X32;
 }
 
index 0a5a7f9cc8706ed63135f656eba10efd4a657e91..fa748cf89d44f53a4331449c5782896484164f91 100644 (file)
@@ -127,23 +127,6 @@ vsp1_entity_get_state(struct vsp1_entity *entity,
        }
 }
 
-/**
- * vsp1_entity_get_pad_format - Get a pad format from storage for an entity
- * @entity: the entity
- * @sd_state: the state storage
- * @pad: the pad number
- *
- * Return the format stored in the given configuration for an entity's pad. The
- * configuration can be an ACTIVE or TRY configuration.
- */
-struct v4l2_mbus_framefmt *
-vsp1_entity_get_pad_format(struct vsp1_entity *entity,
-                          struct v4l2_subdev_state *sd_state,
-                          unsigned int pad)
-{
-       return v4l2_subdev_state_get_format(sd_state, pad);
-}
-
 /**
  * vsp1_entity_get_pad_selection - Get a pad selection from storage for entity
  * @entity: the entity
@@ -191,7 +174,7 @@ int vsp1_subdev_get_pad_format(struct v4l2_subdev *subdev,
                return -EINVAL;
 
        mutex_lock(&entity->lock);
-       fmt->format = *vsp1_entity_get_pad_format(entity, state, fmt->pad);
+       fmt->format = *v4l2_subdev_state_get_format(state, fmt->pad);
        mutex_unlock(&entity->lock);
 
        return 0;
@@ -238,7 +221,7 @@ int vsp1_subdev_enum_mbus_code(struct v4l2_subdev *subdev,
                        return -EINVAL;
 
                mutex_lock(&entity->lock);
-               format = vsp1_entity_get_pad_format(entity, state, 0);
+               format = v4l2_subdev_state_get_format(state, 0);
                code->code = format->code;
                mutex_unlock(&entity->lock);
        }
@@ -276,7 +259,7 @@ int vsp1_subdev_enum_frame_size(struct v4l2_subdev *subdev,
        if (!state)
                return -EINVAL;
 
-       format = vsp1_entity_get_pad_format(entity, state, fse->pad);
+       format = v4l2_subdev_state_get_format(state, fse->pad);
 
        mutex_lock(&entity->lock);
 
@@ -346,7 +329,7 @@ int vsp1_subdev_set_pad_format(struct v4l2_subdev *subdev,
                goto done;
        }
 
-       format = vsp1_entity_get_pad_format(entity, state, fmt->pad);
+       format = v4l2_subdev_state_get_format(state, fmt->pad);
 
        if (fmt->pad == entity->source_pad) {
                /* The output format can't be modified. */
@@ -374,7 +357,7 @@ int vsp1_subdev_set_pad_format(struct v4l2_subdev *subdev,
        fmt->format = *format;
 
        /* Propagate the format to the source pad. */
-       format = vsp1_entity_get_pad_format(entity, state, entity->source_pad);
+       format = v4l2_subdev_state_get_format(state, entity->source_pad);
        *format = fmt->format;
 
        /* Reset the crop and compose rectangles. */
index 735f32dde4b563ded1684cef335634d94a91df02..e913befe7fc8c2e3c6d597e89f9e6f12c37d91f0 100644 (file)
@@ -138,10 +138,6 @@ struct v4l2_subdev_state *
 vsp1_entity_get_state(struct vsp1_entity *entity,
                      struct v4l2_subdev_state *sd_state,
                      enum v4l2_subdev_format_whence which);
-struct v4l2_mbus_framefmt *
-vsp1_entity_get_pad_format(struct vsp1_entity *entity,
-                          struct v4l2_subdev_state *sd_state,
-                          unsigned int pad);
 struct v4l2_rect *
 vsp1_entity_get_pad_selection(struct vsp1_entity *entity,
                              struct v4l2_subdev_state *sd_state,
index cd1c8778662e684e1ca4c6d39ad11ca32ca27f10..0d7e4afae0f84650f8e1f07d844463e0cdb4fb26 100644 (file)
@@ -229,8 +229,7 @@ static int histo_get_selection(struct v4l2_subdev *subdev,
 
        case V4L2_SEL_TGT_CROP_BOUNDS:
        case V4L2_SEL_TGT_CROP_DEFAULT:
-               format = vsp1_entity_get_pad_format(&histo->entity, state,
-                                                   HISTO_PAD_SINK);
+               format = v4l2_subdev_state_get_format(state, HISTO_PAD_SINK);
                sel->r.left = 0;
                sel->r.top = 0;
                sel->r.width = format->width;
@@ -262,8 +261,7 @@ static int histo_set_crop(struct v4l2_subdev *subdev,
        struct v4l2_rect *selection;
 
        /* The crop rectangle must be inside the input frame. */
-       format = vsp1_entity_get_pad_format(&histo->entity, sd_state,
-                                           HISTO_PAD_SINK);
+       format = v4l2_subdev_state_get_format(sd_state, HISTO_PAD_SINK);
        sel->r.left = clamp_t(unsigned int, sel->r.left, 0, format->width - 1);
        sel->r.top = clamp_t(unsigned int, sel->r.top, 0, format->height - 1);
        sel->r.width = clamp_t(unsigned int, sel->r.width, HISTO_MIN_SIZE,
index bc1299c29ac9c51c846697a1cc3a8e2e0ced68a7..4a8cce808c93ecec789c9c57a3428ea386c295a4 100644 (file)
@@ -78,7 +78,7 @@ static int hsit_set_format(struct v4l2_subdev *subdev,
                goto done;
        }
 
-       format = vsp1_entity_get_pad_format(&hsit->entity, state, fmt->pad);
+       format = v4l2_subdev_state_get_format(state, fmt->pad);
 
        if (fmt->pad == HSIT_PAD_SOURCE) {
                /*
@@ -101,8 +101,7 @@ static int hsit_set_format(struct v4l2_subdev *subdev,
        fmt->format = *format;
 
        /* Propagate the format to the source pad. */
-       format = vsp1_entity_get_pad_format(&hsit->entity, state,
-                                           HSIT_PAD_SOURCE);
+       format = v4l2_subdev_state_get_format(state, HSIT_PAD_SOURCE);
        *format = fmt->format;
        format->code = hsit->inverse ? MEDIA_BUS_FMT_ARGB8888_1X32
                     : MEDIA_BUS_FMT_AHSV8888_1X32;
index b1d21a54837bf574ff07ea7cb47209682519ad98..29d4c1521e6a5cc924965cff2a64243bf4be29e5 100644 (file)
@@ -93,8 +93,8 @@ static void lif_configure_stream(struct vsp1_entity *entity,
        unsigned int obth;
        unsigned int lbth;
 
-       format = vsp1_entity_get_pad_format(&lif->entity, lif->entity.state,
-                                           LIF_PAD_SOURCE);
+       format = v4l2_subdev_state_get_format(lif->entity.state,
+                                             LIF_PAD_SOURCE);
 
        switch (entity->vsp1->version & VI6_IP_VERSION_MODEL_MASK) {
        case VI6_IP_VERSION_MODEL_VSPD_GEN2:
index c47579efc65f68f126956a99d8f01b1bc2b8c46a..19d9f078748ce612c25cac1603e2e7b3d4f7d797 100644 (file)
@@ -80,12 +80,10 @@ static void rpf_configure_stream(struct vsp1_entity *entity,
        vsp1_rpf_write(rpf, dlb, VI6_RPF_SRCM_PSTRIDE, pstride);
 
        /* Format */
-       sink_format = vsp1_entity_get_pad_format(&rpf->entity,
-                                                rpf->entity.state,
-                                                RWPF_PAD_SINK);
-       source_format = vsp1_entity_get_pad_format(&rpf->entity,
-                                                  rpf->entity.state,
-                                                  RWPF_PAD_SOURCE);
+       sink_format = v4l2_subdev_state_get_format(rpf->entity.state,
+                                                  RWPF_PAD_SINK);
+       source_format = v4l2_subdev_state_get_format(rpf->entity.state,
+                                                    RWPF_PAD_SOURCE);
 
        infmt = VI6_RPF_INFMT_CIPM
              | (fmtinfo->hwfmt << VI6_RPF_INFMT_RDFMT_SHIFT);
index 09fb6ffa14e2dc3935df92b6cb5caae12e623fed..574623a48a3d6f7053a01489bf69eb3863c50983 100644 (file)
@@ -79,7 +79,7 @@ static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
            fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32)
                fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32;
 
-       format = vsp1_entity_get_pad_format(&rwpf->entity, state, fmt->pad);
+       format = v4l2_subdev_state_get_format(state, fmt->pad);
 
        if (fmt->pad == RWPF_PAD_SOURCE) {
                /*
@@ -113,8 +113,7 @@ static int vsp1_rwpf_set_format(struct v4l2_subdev *subdev,
        }
 
        /* Propagate the format to the source pad. */
-       format = vsp1_entity_get_pad_format(&rwpf->entity, state,
-                                           RWPF_PAD_SOURCE);
+       format = v4l2_subdev_state_get_format(state, RWPF_PAD_SOURCE);
        *format = fmt->format;
 
        if (rwpf->flip.rotate) {
@@ -157,8 +156,7 @@ static int vsp1_rwpf_get_selection(struct v4l2_subdev *subdev,
                break;
 
        case V4L2_SEL_TGT_CROP_BOUNDS:
-               format = vsp1_entity_get_pad_format(&rwpf->entity, state,
-                                                   RWPF_PAD_SINK);
+               format = v4l2_subdev_state_get_format(state, RWPF_PAD_SINK);
                sel->r.left = 0;
                sel->r.top = 0;
                sel->r.width = format->width;
@@ -204,8 +202,7 @@ static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
        }
 
        /* Make sure the crop rectangle is entirely contained in the image. */
-       format = vsp1_entity_get_pad_format(&rwpf->entity, state,
-                                           RWPF_PAD_SINK);
+       format = v4l2_subdev_state_get_format(state, RWPF_PAD_SINK);
 
        /*
         * Restrict the crop rectangle coordinates to multiples of 2 to avoid
@@ -229,8 +226,7 @@ static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
        *crop = sel->r;
 
        /* Propagate the format to the source pad. */
-       format = vsp1_entity_get_pad_format(&rwpf->entity, state,
-                                           RWPF_PAD_SOURCE);
+       format = v4l2_subdev_state_get_format(state, RWPF_PAD_SOURCE);
        format->width = crop->width;
        format->height = crop->height;
 
index 11e008aa9f20a705c143166a925c0d401f00c23b..749ba7705000b2d134b737720fcec41164371e37 100644 (file)
@@ -131,7 +131,7 @@ static int sru_enum_frame_size(struct v4l2_subdev *subdev,
        if (!state)
                return -EINVAL;
 
-       format = vsp1_entity_get_pad_format(&sru->entity, state, SRU_PAD_SINK);
+       format = v4l2_subdev_state_get_format(state, SRU_PAD_SINK);
 
        mutex_lock(&sru->entity.lock);
 
@@ -184,8 +184,7 @@ static void sru_try_format(struct vsp1_sru *sru,
 
        case SRU_PAD_SOURCE:
                /* The SRU can't perform format conversion. */
-               format = vsp1_entity_get_pad_format(&sru->entity, sd_state,
-                                                   SRU_PAD_SINK);
+               format = v4l2_subdev_state_get_format(sd_state, SRU_PAD_SINK);
                fmt->code = format->code;
 
                /*
@@ -234,13 +233,12 @@ static int sru_set_format(struct v4l2_subdev *subdev,
 
        sru_try_format(sru, state, fmt->pad, &fmt->format);
 
-       format = vsp1_entity_get_pad_format(&sru->entity, state, fmt->pad);
+       format = v4l2_subdev_state_get_format(state, fmt->pad);
        *format = fmt->format;
 
        if (fmt->pad == SRU_PAD_SINK) {
                /* Propagate the format to the source pad. */
-               format = vsp1_entity_get_pad_format(&sru->entity, state,
-                                                   SRU_PAD_SOURCE);
+               format = v4l2_subdev_state_get_format(state, SRU_PAD_SOURCE);
                *format = fmt->format;
 
                sru_try_format(sru, state, SRU_PAD_SOURCE, format);
@@ -277,10 +275,9 @@ static void sru_configure_stream(struct vsp1_entity *entity,
        struct v4l2_mbus_framefmt *output;
        u32 ctrl0;
 
-       input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state,
-                                          SRU_PAD_SINK);
-       output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state,
-                                           SRU_PAD_SOURCE);
+       input = v4l2_subdev_state_get_format(sru->entity.state, SRU_PAD_SINK);
+       output = v4l2_subdev_state_get_format(sru->entity.state,
+                                             SRU_PAD_SOURCE);
 
        if (input->code == MEDIA_BUS_FMT_ARGB8888_1X32)
                ctrl0 = VI6_SRU_CTRL0_PARAM2 | VI6_SRU_CTRL0_PARAM3
@@ -307,10 +304,9 @@ static unsigned int sru_max_width(struct vsp1_entity *entity,
        struct v4l2_mbus_framefmt *input;
        struct v4l2_mbus_framefmt *output;
 
-       input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state,
-                                          SRU_PAD_SINK);
-       output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state,
-                                           SRU_PAD_SOURCE);
+       input = v4l2_subdev_state_get_format(sru->entity.state, SRU_PAD_SINK);
+       output = v4l2_subdev_state_get_format(sru->entity.state,
+                                             SRU_PAD_SOURCE);
 
        /*
         * The maximum input width of the SRU is 288 input pixels, but 32
@@ -333,10 +329,9 @@ static void sru_partition(struct vsp1_entity *entity,
        struct v4l2_mbus_framefmt *input;
        struct v4l2_mbus_framefmt *output;
 
-       input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state,
-                                          SRU_PAD_SINK);
-       output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.state,
-                                           SRU_PAD_SOURCE);
+       input = v4l2_subdev_state_get_format(sru->entity.state, SRU_PAD_SINK);
+       output = v4l2_subdev_state_get_format(sru->entity.state,
+                                             SRU_PAD_SOURCE);
 
        /* Adapt if SRUx2 is enabled. */
        if (input->width != output->width) {
index d89f1197b86ce564b44219185bddd2c69f85195c..887b1f70611adf3059c5aa7f6a35d631cb03fe7a 100644 (file)
@@ -136,7 +136,7 @@ static int uds_enum_frame_size(struct v4l2_subdev *subdev,
        if (!state)
                return -EINVAL;
 
-       format = vsp1_entity_get_pad_format(&uds->entity, state, UDS_PAD_SINK);
+       format = v4l2_subdev_state_get_format(state, UDS_PAD_SINK);
 
        mutex_lock(&uds->entity.lock);
 
@@ -183,8 +183,7 @@ static void uds_try_format(struct vsp1_uds *uds,
 
        case UDS_PAD_SOURCE:
                /* The UDS scales but can't perform format conversion. */
-               format = vsp1_entity_get_pad_format(&uds->entity, sd_state,
-                                                   UDS_PAD_SINK);
+               format = v4l2_subdev_state_get_format(sd_state, UDS_PAD_SINK);
                fmt->code = format->code;
 
                uds_output_limits(format->width, &minimum, &maximum);
@@ -217,13 +216,12 @@ static int uds_set_format(struct v4l2_subdev *subdev,
 
        uds_try_format(uds, state, fmt->pad, &fmt->format);
 
-       format = vsp1_entity_get_pad_format(&uds->entity, state, fmt->pad);
+       format = v4l2_subdev_state_get_format(state, fmt->pad);
        *format = fmt->format;
 
        if (fmt->pad == UDS_PAD_SINK) {
                /* Propagate the format to the source pad. */
-               format = vsp1_entity_get_pad_format(&uds->entity, state,
-                                                   UDS_PAD_SOURCE);
+               format = v4l2_subdev_state_get_format(state, UDS_PAD_SOURCE);
                *format = fmt->format;
 
                uds_try_format(uds, state, UDS_PAD_SOURCE, format);
@@ -265,10 +263,9 @@ static void uds_configure_stream(struct vsp1_entity *entity,
        unsigned int vscale;
        bool multitap;
 
-       input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state,
-                                          UDS_PAD_SINK);
-       output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state,
-                                           UDS_PAD_SOURCE);
+       input = v4l2_subdev_state_get_format(uds->entity.state, UDS_PAD_SINK);
+       output = v4l2_subdev_state_get_format(uds->entity.state,
+                                             UDS_PAD_SOURCE);
 
        hscale = uds_compute_ratio(input->width, output->width);
        vscale = uds_compute_ratio(input->height, output->height);
@@ -310,8 +307,8 @@ static void uds_configure_partition(struct vsp1_entity *entity,
        struct vsp1_partition *partition = pipe->partition;
        const struct v4l2_mbus_framefmt *output;
 
-       output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state,
-                                           UDS_PAD_SOURCE);
+       output = v4l2_subdev_state_get_format(uds->entity.state,
+                                             UDS_PAD_SOURCE);
 
        /* Input size clipping. */
        vsp1_uds_write(uds, dlb, VI6_UDS_HSZCLIP, VI6_UDS_HSZCLIP_HCEN |
@@ -335,10 +332,9 @@ static unsigned int uds_max_width(struct vsp1_entity *entity,
        const struct v4l2_mbus_framefmt *input;
        unsigned int hscale;
 
-       input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state,
-                                          UDS_PAD_SINK);
-       output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state,
-                                           UDS_PAD_SOURCE);
+       input = v4l2_subdev_state_get_format(uds->entity.state, UDS_PAD_SINK);
+       output = v4l2_subdev_state_get_format(uds->entity.state,
+                                             UDS_PAD_SOURCE);
        hscale = output->width / input->width;
 
        /*
@@ -377,10 +373,9 @@ static void uds_partition(struct vsp1_entity *entity,
        partition->uds_sink = *window;
        partition->uds_source = *window;
 
-       input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state,
-                                          UDS_PAD_SINK);
-       output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.state,
-                                           UDS_PAD_SOURCE);
+       input = v4l2_subdev_state_get_format(uds->entity.state, UDS_PAD_SINK);
+       output = v4l2_subdev_state_get_format(uds->entity.state,
+                                             UDS_PAD_SOURCE);
 
        partition->uds_sink.width = window->width * input->width
                                  / output->width;
index f66936a28a2aa70a4a28eeb5fc0fc3883cbefbba..ee5b6ba228981c4a0a4ce9a7a663e9ffcf35e1b8 100644 (file)
@@ -104,8 +104,7 @@ static int uif_get_selection(struct v4l2_subdev *subdev,
        switch (sel->target) {
        case V4L2_SEL_TGT_CROP_BOUNDS:
        case V4L2_SEL_TGT_CROP_DEFAULT:
-               format = vsp1_entity_get_pad_format(&uif->entity, state,
-                                                   UIF_PAD_SINK);
+               format = v4l2_subdev_state_get_format(state, UIF_PAD_SINK);
                sel->r.left = 0;
                sel->r.top = 0;
                sel->r.width = format->width;
@@ -150,7 +149,7 @@ static int uif_set_selection(struct v4l2_subdev *subdev,
        }
 
        /* The crop rectangle must be inside the input frame. */
-       format = vsp1_entity_get_pad_format(&uif->entity, state, UIF_PAD_SINK);
+       format = v4l2_subdev_state_get_format(state, UIF_PAD_SINK);
 
        sel->r.left = clamp_t(unsigned int, sel->r.left, 0, format->width - 1);
        sel->r.top = clamp_t(unsigned int, sel->r.top, 0, format->height - 1);
index 28cee0304e77f713bdc3414588056cfb438906f5..4801fd0088d89e6a91090748ef0a148726a796a7 100644 (file)
@@ -203,9 +203,8 @@ static void vsp1_video_calculate_partition(struct vsp1_pipeline *pipe,
         * Partitions are computed on the size before rotation, use the format
         * at the WPF sink.
         */
-       format = vsp1_entity_get_pad_format(&pipe->output->entity,
-                                           pipe->output->entity.state,
-                                           RWPF_PAD_SINK);
+       format = v4l2_subdev_state_get_format(pipe->output->entity.state,
+                                             RWPF_PAD_SINK);
 
        /* A single partition simply processes the output size in full. */
        if (pipe->partitions <= 1) {
@@ -268,9 +267,8 @@ static int vsp1_video_pipeline_setup_partitions(struct vsp1_pipeline *pipe)
         * Partitions are computed on the size before rotation, use the format
         * at the WPF sink.
         */
-       format = vsp1_entity_get_pad_format(&pipe->output->entity,
-                                           pipe->output->entity.state,
-                                           RWPF_PAD_SINK);
+       format = v4l2_subdev_state_get_format(pipe->output->entity.state,
+                                             RWPF_PAD_SINK);
        div_size = format->width;
 
        /*
index 9693aeab1cac462d5ae39e59a813c48b75d0587a..5129181b82170589bd9d2888c41230ca162f8b25 100644 (file)
@@ -65,12 +65,10 @@ static int vsp1_wpf_set_rotation(struct vsp1_rwpf *wpf, unsigned int rotation)
                goto done;
        }
 
-       sink_format = vsp1_entity_get_pad_format(&wpf->entity,
-                                                wpf->entity.state,
-                                                RWPF_PAD_SINK);
-       source_format = vsp1_entity_get_pad_format(&wpf->entity,
-                                                  wpf->entity.state,
-                                                  RWPF_PAD_SOURCE);
+       sink_format = v4l2_subdev_state_get_format(wpf->entity.state,
+                                                  RWPF_PAD_SINK);
+       source_format = v4l2_subdev_state_get_format(wpf->entity.state,
+                                                    RWPF_PAD_SOURCE);
 
        mutex_lock(&wpf->entity.lock);
 
@@ -245,12 +243,10 @@ static void wpf_configure_stream(struct vsp1_entity *entity,
        u32 srcrpf = 0;
        int ret;
 
-       sink_format = vsp1_entity_get_pad_format(&wpf->entity,
-                                                wpf->entity.state,
-                                                RWPF_PAD_SINK);
-       source_format = vsp1_entity_get_pad_format(&wpf->entity,
-                                                  wpf->entity.state,
-                                                  RWPF_PAD_SOURCE);
+       sink_format = v4l2_subdev_state_get_format(wpf->entity.state,
+                                                  RWPF_PAD_SINK);
+       source_format = v4l2_subdev_state_get_format(wpf->entity.state,
+                                                    RWPF_PAD_SOURCE);
 
        /* Format */
        if (!pipe->lif || wpf->writeback) {
@@ -383,9 +379,8 @@ static void wpf_configure_partition(struct vsp1_entity *entity,
        unsigned int flip;
        unsigned int i;
 
-       sink_format = vsp1_entity_get_pad_format(&wpf->entity,
-                                                wpf->entity.state,
-                                                RWPF_PAD_SINK);
+       sink_format = v4l2_subdev_state_get_format(wpf->entity.state,
+                                                  RWPF_PAD_SINK);
        width = sink_format->width;
        height = sink_format->height;
        left = 0;