]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] v4l: vsp1: Use pipeline display list to decide how to write to modules
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 1 Nov 2015 12:46:25 +0000 (10:46 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 13 Apr 2016 20:31:22 +0000 (17:31 -0300)
This allows getting rid of the vsp1_device::use_dl field.

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.h
drivers/media/platform/vsp1/vsp1_dl.c
drivers/media/platform/vsp1/vsp1_dl.h
drivers/media/platform/vsp1/vsp1_drv.c
drivers/media/platform/vsp1/vsp1_entity.c
drivers/media/platform/vsp1/vsp1_entity.h

index 910d6b8e8b5017b478177479c2ab569a841c1943..bea232820ead6adeb9690e472bd97341491fcf86 100644 (file)
@@ -85,8 +85,6 @@ struct vsp1_device {
        struct media_entity_operations media_ops;
 
        struct vsp1_drm *drm;
-
-       bool use_dl;
 };
 
 int vsp1_device_get(struct vsp1_device *vsp1);
@@ -104,14 +102,4 @@ static inline void vsp1_write(struct vsp1_device *vsp1, u32 reg, u32 data)
        iowrite32(data, vsp1->mmio + reg);
 }
 
-#include "vsp1_dl.h"
-
-static inline void vsp1_mod_write(struct vsp1_entity *e, u32 reg, u32 data)
-{
-       if (e->vsp1->use_dl)
-               vsp1_dl_add(e, reg, data);
-       else
-               vsp1_write(e->vsp1, reg, data);
-}
-
 #endif /* __VSP1_H__ */
index 1a9a58588f84989a166ef3556581508f249e4207..5518a81f5792d0813e58d5346ca2903644ab3eeb 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "vsp1.h"
 #include "vsp1_dl.h"
-#include "vsp1_pipe.h"
 
 /*
  * Global resources
@@ -129,10 +128,8 @@ void vsp1_dl_begin(struct vsp1_dl *dl)
        list->reg_count = 0;
 }
 
-void vsp1_dl_add(struct vsp1_entity *e, u32 reg, u32 data)
+void vsp1_dl_add(struct vsp1_dl *dl, u32 reg, u32 data)
 {
-       struct vsp1_pipeline *pipe = to_vsp1_pipeline(&e->subdev.entity);
-       struct vsp1_dl *dl = pipe->dl;
        struct vsp1_dl_list *list = dl->lists.write;
 
        list->body[list->reg_count].addr = reg;
index 448c4250e54c4adec61c112c1b7acedf56011928..f4116ca59c28d41faf81016421b3a01ea49999ed 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef __VSP1_DL_H__
 #define __VSP1_DL_H__
 
-#include "vsp1_entity.h"
+#include <linux/types.h>
 
 struct vsp1_device;
 struct vsp1_dl;
@@ -25,18 +25,10 @@ void vsp1_dl_setup(struct vsp1_device *vsp1);
 
 void vsp1_dl_reset(struct vsp1_dl *dl);
 void vsp1_dl_begin(struct vsp1_dl *dl);
-void vsp1_dl_add(struct vsp1_entity *e, u32 reg, u32 data);
+void vsp1_dl_add(struct vsp1_dl *dl, u32 reg, u32 data);
 void vsp1_dl_commit(struct vsp1_dl *dl);
 
 void vsp1_dl_irq_display_start(struct vsp1_dl *dl);
 void vsp1_dl_irq_frame_end(struct vsp1_dl *dl);
 
-static inline void vsp1_dl_mod_write(struct vsp1_entity *e, u32 reg, u32 data)
-{
-       if (e->vsp1->use_dl)
-               vsp1_dl_add(e, reg, data);
-       else
-               vsp1_write(e->vsp1, reg, data);
-}
-
 #endif /* __VSP1_DL_H__ */
index da43e3f35610962755f67507ce84ff228dd1f498..58632d766a2a62412670a271fdac728d82464941 100644 (file)
@@ -387,13 +387,10 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
        /* Register subdev nodes if the userspace API is enabled or initialize
         * the DRM pipeline otherwise.
         */
-       if (vsp1->info->uapi) {
-               vsp1->use_dl = false;
+       if (vsp1->info->uapi)
                ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev);
-       } else {
-               vsp1->use_dl = true;
+       else
                ret = vsp1_drm_init(vsp1);
-       }
        if (ret < 0)
                goto done;
 
@@ -465,7 +462,7 @@ static int vsp1_device_init(struct vsp1_device *vsp1)
        vsp1_write(vsp1, VI6_DPR_HGT_SMPPT, (7 << VI6_DPR_SMPPT_TGW_SHIFT) |
                   (VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
 
-       if (vsp1->use_dl)
+       if (!vsp1->info->uapi)
                vsp1_dl_setup(vsp1);
 
        return 0;
index 20a78fbd36910cf3358bd6083d9449bb1a31c1f7..4006f0d28bac417de0f3726a8cb99abb0cb65555 100644 (file)
 #include <media/v4l2-subdev.h>
 
 #include "vsp1.h"
+#include "vsp1_dl.h"
 #include "vsp1_entity.h"
+#include "vsp1_pipe.h"
+
+void vsp1_mod_write(struct vsp1_entity *e, u32 reg, u32 data)
+{
+       struct vsp1_pipeline *pipe = to_vsp1_pipeline(&e->subdev.entity);
+
+       if (pipe->dl)
+               vsp1_dl_add(pipe->dl, reg, data);
+       else
+               vsp1_write(e->vsp1, reg, data);
+}
 
 bool vsp1_entity_is_streaming(struct vsp1_entity *entity)
 {
index 83570dfde8eca9b2a11913a0c44128094dbb3b1a..311d5b64c9a5d284ae291c5513537ba7c513aa25 100644 (file)
@@ -103,4 +103,6 @@ int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming);
 
 void vsp1_entity_route_setup(struct vsp1_entity *source);
 
+void vsp1_mod_write(struct vsp1_entity *e, u32 reg, u32 data);
+
 #endif /* __VSP1_ENTITY_H__ */