[media] v4l: vsp1: Simplify alpha propagation
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Mon, 20 Jun 2016 02:19:43 +0000 (23:19 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 28 Jun 2016 15:29:33 +0000 (12:29 -0300)
We don't need to walk the pipeline when propagating the alpha value as
all the information needed for propagation is already available from the
pipeline structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vsp1/vsp1_pipe.c
drivers/media/platform/vsp1/vsp1_pipe.h
drivers/media/platform/vsp1/vsp1_rpf.c
drivers/media/platform/vsp1/vsp1_uds.c
drivers/media/platform/vsp1/vsp1_uds.h

index 3c6f623f056ce7a1e2ea23ffd6a0b3d0551f0f53..3e75fb3fcace3a75ee68816b9c6f27a06b2bd3cb 100644 (file)
@@ -301,42 +301,20 @@ void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe)
  * to be scaled, we disable alpha scaling when the UDS input has a fixed alpha
  * value. The UDS then outputs a fixed alpha value which needs to be programmed
  * from the input RPF alpha.
- *
- * This function can only be called from a subdev s_stream handler as it
- * requires a valid display list context.
  */
 void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
-                                  struct vsp1_entity *input,
-                                  struct vsp1_dl_list *dl,
-                                  unsigned int alpha)
+                                  struct vsp1_dl_list *dl, unsigned int alpha)
 {
-       struct vsp1_entity *entity;
-       struct media_pad *pad;
-
-       pad = media_entity_remote_pad(&input->pads[RWPF_PAD_SOURCE]);
-
-       while (pad) {
-               if (!is_media_entity_v4l2_subdev(pad->entity))
-                       break;
-
-               entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
-
-               /* The BRU background color has a fixed alpha value set to 255,
-                * the output alpha value is thus always equal to 255.
-                */
-               if (entity->type == VSP1_ENTITY_BRU)
-                       alpha = 255;
-
-               if (entity->type == VSP1_ENTITY_UDS) {
-                       struct vsp1_uds *uds = to_uds(&entity->subdev);
+       if (!pipe->uds)
+               return;
 
-                       vsp1_uds_set_alpha(uds, dl, alpha);
-                       break;
-               }
+       /* The BRU background color has a fixed alpha value set to 255, the
+        * output alpha value is thus always equal to 255.
+        */
+       if (pipe->uds_input->type == VSP1_ENTITY_BRU)
+               alpha = 255;
 
-               pad = &entity->pads[entity->source_pad];
-               pad = media_entity_remote_pad(pad);
-       }
+       vsp1_uds_set_alpha(pipe->uds, dl, alpha);
 }
 
 void vsp1_pipelines_suspend(struct vsp1_device *vsp1)
index fc9825d3d64cf1a2a698ec7ba4090873ff1355b1..d20d997b1fdaa9489aa42198001f35aaa3166fec 100644 (file)
@@ -117,9 +117,7 @@ bool vsp1_pipeline_ready(struct vsp1_pipeline *pipe);
 void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe);
 
 void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
-                                  struct vsp1_entity *input,
-                                  struct vsp1_dl_list *dl,
-                                  unsigned int alpha);
+                                  struct vsp1_dl_list *dl, unsigned int alpha);
 
 void vsp1_pipelines_suspend(struct vsp1_device *vsp1);
 void vsp1_pipelines_resume(struct vsp1_device *vsp1);
index 390040a22b0ce57e2598f063758c3d8b205e9f53..b8e801edf84c6c702468a927ad3c7e7450cc38af 100644 (file)
@@ -206,7 +206,7 @@ static void rpf_configure(struct vsp1_entity *entity,
                vsp1_rpf_write(rpf, dl, VI6_RPF_MULT_ALPHA, mult);
        }
 
-       vsp1_pipeline_propagate_alpha(pipe, &rpf->entity, dl, rpf->alpha);
+       vsp1_pipeline_propagate_alpha(pipe, dl, rpf->alpha);
 
        vsp1_rpf_write(rpf, dl, VI6_RPF_MSK_CTRL, 0);
        vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL, 0);
index 5d5720f2e5fee755f033f1ddc805a2983a118529..652dcd895022ecf08355f4e36825277f128aaf38 100644 (file)
@@ -40,9 +40,11 @@ static inline void vsp1_uds_write(struct vsp1_uds *uds, struct vsp1_dl_list *dl,
  * Scaling Computation
  */
 
-void vsp1_uds_set_alpha(struct vsp1_uds *uds, struct vsp1_dl_list *dl,
+void vsp1_uds_set_alpha(struct vsp1_entity *entity, struct vsp1_dl_list *dl,
                        unsigned int alpha)
 {
+       struct vsp1_uds *uds = to_uds(&entity->subdev);
+
        vsp1_uds_write(uds, dl, VI6_UDS_ALPVAL,
                       alpha << VI6_UDS_ALPVAL_VAL0_SHIFT);
 }
index 5c8cbfcad4cc54ae64743b0ef5f9fdfdde68dcaa..7bf3cdcffc65981d3a8163301731a51544972ff1 100644 (file)
@@ -35,7 +35,7 @@ static inline struct vsp1_uds *to_uds(struct v4l2_subdev *subdev)
 
 struct vsp1_uds *vsp1_uds_create(struct vsp1_device *vsp1, unsigned int index);
 
-void vsp1_uds_set_alpha(struct vsp1_uds *uds, struct vsp1_dl_list *dl,
+void vsp1_uds_set_alpha(struct vsp1_entity *uds, struct vsp1_dl_list *dl,
                        unsigned int alpha);
 
 #endif /* __VSP1_UDS_H__ */
This page took 0.028849 seconds and 5 git commands to generate.