]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] v4l: vsp1: Pass pipe pointer to entity configure functions
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 14 Jan 2016 16:17:32 +0000 (14:17 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 13 Apr 2016 21:59:55 +0000 (18:59 -0300)
Pass the pipe explicitly instead of retrieving it through media
entities. This decouples device state stored in the pipeline from the
active state stored in entities, preparing for dynamic pipeline
creation.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/vsp1/vsp1_bru.c
drivers/media/platform/vsp1/vsp1_drm.c
drivers/media/platform/vsp1/vsp1_entity.h
drivers/media/platform/vsp1/vsp1_hsit.c
drivers/media/platform/vsp1/vsp1_lif.c
drivers/media/platform/vsp1/vsp1_lut.c
drivers/media/platform/vsp1/vsp1_rpf.c
drivers/media/platform/vsp1/vsp1_sru.c
drivers/media/platform/vsp1/vsp1_uds.c
drivers/media/platform/vsp1/vsp1_video.c
drivers/media/platform/vsp1/vsp1_wpf.c

index 9795e621eb8e60f7b755d800f7f1d10e1217b33f..3ece402453969fc0f8f30e9a7372be496367d17a 100644 (file)
@@ -305,9 +305,10 @@ static struct v4l2_subdev_ops bru_ops = {
  * VSP1 Entity Operations
  */
 
-static void bru_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void bru_configure(struct vsp1_entity *entity,
+                         struct vsp1_pipeline *pipe,
+                         struct vsp1_dl_list *dl)
 {
-       struct vsp1_pipeline *pipe = to_vsp1_pipeline(&entity->subdev.entity);
        struct vsp1_bru *bru = to_bru(&entity->subdev);
        struct v4l2_mbus_framefmt *format;
        unsigned int flags;
index a9735b199a4b91f0b39ff100e6accd68cabc6871..7cde2d970dba03b6a0ea955fcdd74295d233a4db 100644 (file)
@@ -464,7 +464,7 @@ void vsp1_du_atomic_flush(struct device *dev)
                vsp1_entity_route_setup(entity, pipe->dl);
 
                if (entity->ops->configure)
-                       entity->ops->configure(entity, pipe->dl);
+                       entity->ops->configure(entity, pipe, pipe->dl);
 
                if (entity->type == VSP1_ENTITY_RPF)
                        vsp1_rwpf_set_memory(to_rwpf(&entity->subdev),
index f0a718ceaefe966443d51bb58fcf68494d9ab2c0..bbf378437c3b474b830cc9693468578056836275 100644 (file)
@@ -20,6 +20,7 @@
 
 struct vsp1_device;
 struct vsp1_dl_list;
+struct vsp1_pipeline;
 
 enum vsp1_entity_type {
        VSP1_ENTITY_BRU,
@@ -66,7 +67,8 @@ struct vsp1_route {
 struct vsp1_entity_operations {
        void (*destroy)(struct vsp1_entity *);
        void (*set_memory)(struct vsp1_entity *, struct vsp1_dl_list *dl);
-       void (*configure)(struct vsp1_entity *, struct vsp1_dl_list *dl);
+       void (*configure)(struct vsp1_entity *, struct vsp1_pipeline *,
+                         struct vsp1_dl_list *);
 };
 
 struct vsp1_entity {
index 4fcdb30d08c47df5a8376209bee70bb07ae1e91b..f02e4ca77a7cc3c7094b1583bf521ef44fbaf1dd 100644 (file)
@@ -166,7 +166,9 @@ static struct v4l2_subdev_ops hsit_ops = {
  * VSP1 Entity Operations
  */
 
-static void hsit_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void hsit_configure(struct vsp1_entity *entity,
+                          struct vsp1_pipeline *pipe,
+                          struct vsp1_dl_list *dl)
 {
        struct vsp1_hsit *hsit = to_hsit(&entity->subdev);
 
index bed1784cccb913728f43c4f1764d30ade88aeafd..42ed8f80cc888f2328518fb2166ff0f346d38793 100644 (file)
@@ -185,7 +185,9 @@ static struct v4l2_subdev_ops lif_ops = {
  * VSP1 Entity Operations
  */
 
-static void lif_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void lif_configure(struct vsp1_entity *entity,
+                         struct vsp1_pipeline *pipe,
+                         struct vsp1_dl_list *dl)
 {
        const struct v4l2_mbus_framefmt *format;
        struct vsp1_lif *lif = to_lif(&entity->subdev);
index ec0b9bf53d1f199bb9cd7dfb2e08ab0b60a97d8b..596537a95210d75c6e4ef178087be16524bf0520 100644 (file)
@@ -221,7 +221,9 @@ static struct v4l2_subdev_ops lut_ops = {
  * VSP1 Entity Operations
  */
 
-static void lut_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void lut_configure(struct vsp1_entity *entity,
+                         struct vsp1_pipeline *pipe,
+                         struct vsp1_dl_list *dl)
 {
        struct vsp1_lut *lut = to_lut(&entity->subdev);
 
index ce408e4467af9446b85a1e8fb7490f07db29d133..e7b6abbb00244d216ad9c6bf5e4ef3d3a0351a0e 100644 (file)
@@ -57,9 +57,10 @@ static void rpf_set_memory(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
                       rpf->mem.addr[2] + rpf->offsets[1]);
 }
 
-static void rpf_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void rpf_configure(struct vsp1_entity *entity,
+                         struct vsp1_pipeline *pipe,
+                         struct vsp1_dl_list *dl)
 {
-       struct vsp1_pipeline *pipe = to_vsp1_pipeline(&entity->subdev.entity);
        struct vsp1_rwpf *rpf = to_rwpf(&entity->subdev);
        const struct vsp1_format_info *fmtinfo = rpf->fmtinfo;
        const struct v4l2_pix_format_mplane *format = &rpf->format;
index 6c1cb4ccba221f93635210228f96d2be435b407d..00edd95093e37d5bee0999fdd2a25296a1005e5e 100644 (file)
@@ -297,7 +297,9 @@ static struct v4l2_subdev_ops sru_ops = {
  * VSP1 Entity Operations
  */
 
-static void sru_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void sru_configure(struct vsp1_entity *entity,
+                         struct vsp1_pipeline *pipe,
+                         struct vsp1_dl_list *dl)
 {
        const struct vsp1_sru_param *param;
        struct vsp1_sru *sru = to_sru(&entity->subdev);
index 90e7d714116087d3c6e629e986dacceb6176119d..42f2d0465bd6ca1a8edb24ca43b6dbff8d8cf183 100644 (file)
@@ -284,7 +284,9 @@ static struct v4l2_subdev_ops uds_ops = {
  * VSP1 Entity Operations
  */
 
-static void uds_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void uds_configure(struct vsp1_entity *entity,
+                         struct vsp1_pipeline *pipe,
+                         struct vsp1_dl_list *dl)
 {
        struct vsp1_uds *uds = to_uds(&entity->subdev);
        const struct v4l2_mbus_framefmt *output;
index ddf440dc9a9c05ab645d37fc0d8afcdd0e474593..a16a661e5b691cce6dc0adc9967c207e07cd0a16 100644 (file)
@@ -619,7 +619,7 @@ static int vsp1_video_setup_pipeline(struct vsp1_pipeline *pipe)
                vsp1_entity_route_setup(entity, pipe->dl);
 
                if (entity->ops->configure)
-                       entity->ops->configure(entity, pipe->dl);
+                       entity->ops->configure(entity, pipe, pipe->dl);
        }
 
        return 0;
index e2c558dbac13342bb852cc880794a0c0d09d3996..d1d5c08ca35e30de246977781a052ea063eff3a2 100644 (file)
@@ -88,9 +88,10 @@ static void wpf_set_memory(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
        vsp1_wpf_write(wpf, dl, VI6_WPF_DSTM_ADDR_C1, wpf->mem.addr[2]);
 }
 
-static void wpf_configure(struct vsp1_entity *entity, struct vsp1_dl_list *dl)
+static void wpf_configure(struct vsp1_entity *entity,
+                         struct vsp1_pipeline *pipe,
+                         struct vsp1_dl_list *dl)
 {
-       struct vsp1_pipeline *pipe = to_vsp1_pipeline(&entity->subdev.entity);
        struct vsp1_rwpf *wpf = to_rwpf(&entity->subdev);
        struct vsp1_device *vsp1 = wpf->entity.vsp1;
        const struct v4l2_mbus_framefmt *source_format;