[media] Set vfl_dir for all display or m2m drivers
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 5 Sep 2012 09:05:50 +0000 (06:05 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 26 Sep 2012 14:57:06 +0000 (11:57 -0300)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
17 files changed:
drivers/media/pci/ivtv/ivtv-streams.c
drivers/media/pci/zoran/zoran_card.c
drivers/media/platform/coda.c
drivers/media/platform/davinci/vpbe_display.c
drivers/media/platform/davinci/vpif_display.c
drivers/media/platform/m2m-deinterlace.c
drivers/media/platform/mem2mem_testdev.c
drivers/media/platform/mx2_emmaprp.c
drivers/media/platform/omap/omap_vout.c
drivers/media/platform/omap3isp/ispvideo.c
drivers/media/platform/s5p-fimc/fimc-m2m.c
drivers/media/platform/s5p-g2d/g2d.c
drivers/media/platform/s5p-jpeg/jpeg-core.c
drivers/media/platform/s5p-mfc/s5p_mfc.c
drivers/media/platform/s5p-tv/mixer_video.c
drivers/media/platform/sh_vou.c
drivers/media/usb/uvc/uvc_driver.c

index 0ff264e0e0f67097ccd8ff94a2087f6c0da13763..7b8648a827f547a9b4db134f384d9836af30462f 100644 (file)
@@ -222,6 +222,9 @@ static int ivtv_prep_dev(struct ivtv *itv, int type)
 
        s->vdev->num = num;
        s->vdev->v4l2_dev = &itv->v4l2_dev;
+       if (ivtv_stream_info[type].v4l2_caps &
+                       (V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_SLICED_VBI_OUTPUT))
+               s->vdev->vfl_dir = VFL_DIR_TX;
        s->vdev->fops = ivtv_stream_info[type].fops;
        s->vdev->ctrl_handler = itv->v4l2_dev.ctrl_handler;
        s->vdev->release = video_device_release;
index c3602d6cd48e839f9fa1cadbad9e8ab9e4e9bcc6..fffc54b452c8aa8f510928eaa40c7e99171f8d3f 100644 (file)
@@ -1055,6 +1055,10 @@ zr36057_init (struct zoran *zr)
        memcpy(zr->video_dev, &zoran_template, sizeof(zoran_template));
        zr->video_dev->parent = &zr->pci_dev->dev;
        strcpy(zr->video_dev->name, ZR_DEVNAME(zr));
+       /* It's not a mem2mem device, but you can both capture and output from
+          one and the same device. This should really be split up into two
+          device nodes, but that's a job for another day. */
+       zr->video_dev->vfl_dir = VFL_DIR_M2M;
        err = video_register_device(zr->video_dev, VFL_TYPE_GRABBER, video_nr[zr->id]);
        if (err < 0)
                goto exit_free;
index 0d4b5c0b37ee56d86a5948f9f9a0478acbd68cc6..10eaf1189d89998489e8b77f6aaa613b420f2728 100644 (file)
@@ -1639,6 +1639,7 @@ static void coda_fw_callback(const struct firmware *fw, void *context)
        dev->vfd.release        = video_device_release_empty,
        dev->vfd.lock   = &dev->dev_mutex;
        dev->vfd.v4l2_dev       = &dev->v4l2_dev;
+       dev->vfd.vfl_dir        = VFL_DIR_M2M;
        snprintf(dev->vfd.name, sizeof(dev->vfd.name), "%s", CODA_NAME);
        video_set_drvdata(&dev->vfd, dev);
 
index e712d6734ac8a0314557701ecdda6ad7c1760a34..239f37bfa313b40903d8ac4d54192747165cd87d 100644 (file)
@@ -1633,6 +1633,7 @@ static __devinit int init_vpbe_layer(int i, struct vpbe_display *disp_dev,
        vbd->minor      = -1;
        vbd->v4l2_dev   = &disp_dev->vpbe_dev->v4l2_dev;
        vbd->lock       = &vpbe_display_layer->opslock;
+       vbd->vfl_dir    = VFL_DIR_TX;
 
        if (disp_dev->vpbe_dev->current_timings.timings_type &
                        VPBE_ENC_STD) {
index 4a24848c1a665df0df0e05eb610550e49231fb6f..ff6e43293ce49e5896a7881fc48bffa6b7372ecf 100644 (file)
@@ -1745,6 +1745,7 @@ static __init int vpif_probe(struct platform_device *pdev)
                *vfd = vpif_video_template;
                vfd->v4l2_dev = &vpif_obj.v4l2_dev;
                vfd->release = video_device_release;
+               vfd->vfl_dir = VFL_DIR_TX;
                snprintf(vfd->name, sizeof(vfd->name),
                         "VPIF_Display_DRIVER_V%s",
                         VPIF_DISPLAY_VERSION);
index 9afd93075b61e690ed6351d00df7f150d274b31f..c4ad9fca5dbf31704e239b25a65d3c0a1bdc2689 100644 (file)
@@ -980,6 +980,7 @@ static struct video_device deinterlace_videodev = {
        .ioctl_ops      = &deinterlace_ioctl_ops,
        .minor          = -1,
        .release        = video_device_release,
+       .vfl_dir        = VFL_DIR_M2M,
 };
 
 static struct v4l2_m2m_ops m2m_ops = {
index c1229bef153c9f1ee5d54803ae88a33d9de7ee46..d03637537118047a6ced26241cb55842de398d02 100644 (file)
@@ -999,6 +999,7 @@ static const struct v4l2_file_operations m2mtest_fops = {
 
 static struct video_device m2mtest_videodev = {
        .name           = MEM2MEM_NAME,
+       .vfl_dir        = VFL_DIR_M2M,
        .fops           = &m2mtest_fops,
        .ioctl_ops      = &m2mtest_ioctl_ops,
        .minor          = -1,
index 2236315778c3828c5387c0632d743c9c0773ae54..8f22ce543cf704315399b751371d79f8dfbd2c6e 100644 (file)
@@ -877,6 +877,7 @@ static struct video_device emmaprp_videodev = {
        .ioctl_ops      = &emmaprp_ioctl_ops,
        .minor          = -1,
        .release        = video_device_release,
+       .vfl_dir        = VFL_DIR_M2M,
 };
 
 static struct v4l2_m2m_ops m2m_ops = {
index 36c3be85649d13c63033bd8bdd626d16e42a21e9..196e5167005081f5d3c424928a3e71b83274fded 100644 (file)
@@ -1951,6 +1951,7 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout)
 
        vfd->fops = &omap_vout_fops;
        vfd->v4l2_dev = &vout->vid_dev->v4l2_dev;
+       vfd->vfl_dir = VFL_DIR_TX;
        mutex_init(&vout->lock);
 
        vfd->minor = -1;
index 3a5085e9002465e13e0283260ed26c0a1087c567..c78f60a0220db7bf00c8db25eed032ea32c432a4 100644 (file)
@@ -1342,6 +1342,7 @@ int omap3isp_video_init(struct isp_video *video, const char *name)
        case V4L2_BUF_TYPE_VIDEO_OUTPUT:
                direction = "input";
                video->pad.flags = MEDIA_PAD_FL_SOURCE;
+               video->video.vfl_dir = VFL_DIR_TX;
                break;
 
        default:
index c67e53bfa43a7ddd19ad8cb728c88d3b95a4146f..9237e53cf6df3572d9999bfaeb962d8e64ea64e6 100644 (file)
@@ -804,6 +804,7 @@ int fimc_register_m2m_device(struct fimc_dev *fimc,
        vfd->minor = -1;
        vfd->release = video_device_release;
        vfd->lock = &fimc->lock;
+       vfd->vfl_dir = VFL_DIR_M2M;
 
        snprintf(vfd->name, sizeof(vfd->name), "fimc.%d.m2m", fimc->id);
        video_set_drvdata(vfd, fimc);
index 69c9f22ee52a684aefb63646fe34f9641f468ee7..1e3b9dd014c094655d7e5b6719c60d06c48d49a8 100644 (file)
@@ -680,6 +680,7 @@ static struct video_device g2d_videodev = {
        .ioctl_ops      = &g2d_ioctl_ops,
        .minor          = -1,
        .release        = video_device_release,
+       .vfl_dir        = VFL_DIR_M2M,
 };
 
 static struct v4l2_m2m_ops g2d_m2m_ops = {
index 90459cefb2b84003a66da14d86f0d7a2fbbca102..bf2d94bb0f6e0109a22e8a87c6fde9ad91c16504 100644 (file)
@@ -1392,6 +1392,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
        jpeg->vfd_encoder->release      = video_device_release;
        jpeg->vfd_encoder->lock         = &jpeg->lock;
        jpeg->vfd_encoder->v4l2_dev     = &jpeg->v4l2_dev;
+       jpeg->vfd_encoder->vfl_dir      = VFL_DIR_M2M;
 
        ret = video_register_device(jpeg->vfd_encoder, VFL_TYPE_GRABBER, -1);
        if (ret) {
index e3e616d8a09d2eafd0537d29987e76c1bd1d146b..0476be4ee5671dbe18f26ceb6afa42762d0e16dc 100644 (file)
@@ -1048,6 +1048,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
        vfd->release    = video_device_release,
        vfd->lock       = &dev->mfc_mutex;
        vfd->v4l2_dev   = &dev->v4l2_dev;
+       vfd->vfl_dir    = VFL_DIR_M2M;
        snprintf(vfd->name, sizeof(vfd->name), "%s", S5P_MFC_DEC_NAME);
        dev->vfd_dec    = vfd;
        ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
index a9c6be39246dac426e41cea3a35a550fff15c8ce..bd42ea30165014c6639f5802823341a73ecf7a03 100644 (file)
@@ -1081,6 +1081,7 @@ struct mxr_layer *mxr_base_layer_create(struct mxr_device *mdev,
                .minor = -1,
                .release = mxr_vfd_release,
                .fops = &mxr_fops,
+               .vfl_dir = VFL_DIR_TX,
                .ioctl_ops = &mxr_ioctl_ops,
        };
        strlcpy(layer->vfd.name, name, sizeof(layer->vfd.name));
index 00cd52c61fe025ae8927825305d142fff83f6917..ba3de3e02d47d847bea0efe71b609c841d5e3a19 100644 (file)
@@ -1320,6 +1320,7 @@ static const struct video_device sh_vou_video_template = {
        .ioctl_ops      = &sh_vou_ioctl_ops,
        .tvnorms        = V4L2_STD_525_60, /* PAL only supported in 8-bit non-bt656 mode */
        .current_norm   = V4L2_STD_NTSC_M,
+       .vfl_dir        = VFL_DIR_TX,
 };
 
 static int __devinit sh_vou_probe(struct platform_device *pdev)
index 287f73182a6990c4a1c1a943295bc397fa4209fc..5967081747ceb974814a5818ad8cccb43aacf64a 100644 (file)
@@ -1722,6 +1722,8 @@ static int uvc_register_video(struct uvc_device *dev,
        vdev->v4l2_dev = &dev->vdev;
        vdev->fops = &uvc_fops;
        vdev->release = uvc_release;
+       if (stream->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
+               vdev->vfl_dir = VFL_DIR_TX;
        strlcpy(vdev->name, dev->name, sizeof vdev->name);
 
        /* Set the driver data before calling video_register_device, otherwise