[media] media/platform: fix querycap
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 24 Nov 2014 09:37:26 +0000 (06:37 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 2 Dec 2014 13:32:35 +0000 (11:32 -0200)
Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

In addition, remove the CAPTURE and OUTPUT caps for M2M devices. These
were already slated for removal, so it's time to do so.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Kamil Debski <k.debski@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/davinci/vpbe_display.c
drivers/media/platform/davinci/vpfe_capture.c
drivers/media/platform/s5p-g2d/g2d.c
drivers/media/platform/s5p-jpeg/jpeg-core.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

index 78b9ffebc94e836cacccc6690deb6198531f37b1..21a5a56eb5eab15609835f2291ab5a5250412af7 100644 (file)
@@ -639,7 +639,6 @@ static int vpbe_display_querycap(struct file *file, void  *priv,
        struct vpbe_layer *layer = video_drvdata(file);
        struct vpbe_device *vpbe_dev = layer->disp_dev->vpbe_dev;
 
-       cap->version = VPBE_DISPLAY_VERSION_CODE;
        cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        snprintf(cap->driver, sizeof(cap->driver), "%s",
index 3d0e3ae1795c9f121fc7fc78989cb69d3ad2400d..271c4600432d145a851a6664bf496ac43cdad873 100644 (file)
@@ -930,8 +930,8 @@ static int vpfe_querycap(struct file *file, void  *priv,
 
        v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_querycap\n");
 
-       cap->version = VPFE_CAPTURE_VERSION_CODE;
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        strlcpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
        strlcpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
        strlcpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
index d79e214ce8ce3e7526027aea3141c16f9a609a39..51e4edc92d28459b1adeb2ee3e4f161bc616730f 100644 (file)
@@ -297,14 +297,8 @@ static int vidioc_querycap(struct file *file, void *priv,
        strncpy(cap->driver, G2D_NAME, sizeof(cap->driver) - 1);
        strncpy(cap->card, G2D_NAME, sizeof(cap->card) - 1);
        cap->bus_info[0] = 0;
-       cap->version = KERNEL_VERSION(1, 0, 0);
-       /*
-        * This is only a mem-to-mem video device. The capture and output
-        * device capability flags are left only for backward compatibility
-        * and are scheduled for removal.
-        */
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
-                           V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+       cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 6fcc7f072acea885816d30c95068c77942b17fde..d6f75b126364c9ecd903c0834f2b8cd00dfb0ce0 100644 (file)
@@ -1001,13 +1001,8 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
                        sizeof(cap->card));
        }
        cap->bus_info[0] = 0;
-       /*
-        * This is only a mem-to-mem video device. The capture and output
-        * device capability flags are left only for backward compatibility
-        * and are scheduled for removal.
-        */
-       cap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M |
-                           V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
+       cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index 74bcec8228eed98804c49ab0547dde9c89b71d00..c6c3452ccca16d8f93babd124db74ca3b3391553 100644 (file)
@@ -269,15 +269,13 @@ static int vidioc_querycap(struct file *file, void *priv,
        strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
        strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
        cap->bus_info[0] = 0;
-       cap->version = KERNEL_VERSION(1, 0, 0);
        /*
         * This is only a mem-to-mem video device. The capture and output
         * device capability flags are left only for backward compatibility
         * and are scheduled for removal.
         */
-       cap->capabilities = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING |
-                           V4L2_CAP_VIDEO_CAPTURE_MPLANE |
-                           V4L2_CAP_VIDEO_OUTPUT_MPLANE;
+       cap->device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }
 
index e7240cb76af95d5129eba4257b39cd60fa57bfa3..bd64f1dcbdb50f6b7123cac8759d70d2ed62bb10 100644 (file)
@@ -947,15 +947,13 @@ static int vidioc_querycap(struct file *file, void *priv,
        strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
        strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
        cap->bus_info[0] = 0;
-       cap->version = KERNEL_VERSION(1, 0, 0);
        /*
         * This is only a mem-to-mem video device. The capture and output
         * device capability flags are left only for backward compatibility
         * and are scheduled for removal.
         */
-       cap->capabilities = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING |
-                           V4L2_CAP_VIDEO_CAPTURE_MPLANE |
-                           V4L2_CAP_VIDEO_OUTPUT_MPLANE;
+       cap->device_caps = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }