[media] v4l: vsp1: Don't create LIF entity when the userspace API is enabled
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 13 May 2016 16:10:57 +0000 (13:10 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 28 Jun 2016 15:11:24 +0000 (12:11 -0300)
The LIF is only used when feeding the VSP output to the DU. The only way
to do so is by controlling the VSP directly from the DU driver and
disabling the VSP userspace API. There is thus no need to create a LIF
entity when the userspace API is enabled, as it can't be used in that
case.

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_drv.c

index 71fd614c1412be9278088ed198b925d41c438d3e..0b0e73685a24f7224904656c104c278fd5f6b50d 100644 (file)
@@ -170,19 +170,15 @@ static int vsp1_uapi_create_links(struct vsp1_device *vsp1)
 
        for (i = 0; i < vsp1->info->wpf_count; ++i) {
                /* Connect the video device to the WPF. All connections are
-                * immutable except for the WPF0 source link if a LIF is
-                * present.
+                * immutable.
                 */
                struct vsp1_rwpf *wpf = vsp1->wpf[i];
-               unsigned int flags = MEDIA_LNK_FL_ENABLED;
-
-               if (!(vsp1->info->features & VSP1_HAS_LIF) || i != 0)
-                       flags |= MEDIA_LNK_FL_IMMUTABLE;
 
                ret = media_create_pad_link(&wpf->entity.subdev.entity,
                                            RWPF_PAD_SOURCE,
                                            &wpf->video->video.entity, 0,
-                                           flags);
+                                           MEDIA_LNK_FL_IMMUTABLE |
+                                           MEDIA_LNK_FL_ENABLED);
                if (ret < 0)
                        return ret;
        }
@@ -271,7 +267,11 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
 
        list_add_tail(&vsp1->hst->entity.list_dev, &vsp1->entities);
 
-       if (vsp1->info->features & VSP1_HAS_LIF) {
+       /* The LIF is only supported when used in conjunction with the DU, in
+        * which case the userspace API is disabled. If the userspace API is
+        * enabled skip the LIF, even when present.
+        */
+       if (vsp1->info->features & VSP1_HAS_LIF && !vsp1->info->uapi) {
                vsp1->lif = vsp1_lif_create(vsp1);
                if (IS_ERR(vsp1->lif)) {
                        ret = PTR_ERR(vsp1->lif);
This page took 0.02612 seconds and 5 git commands to generate.