media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap, out}_mplane
authorBoris Brezillon <boris.brezillon@collabora.com>
Tue, 4 Jun 2019 07:06:25 +0000 (03:06 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 5 Jun 2019 11:48:32 +0000 (07:48 -0400)
Support for multiplanar and singleplanar formats is mutually exclusive,
at least in practice. In our attempt to unify support for support for
mplane and !mplane in v4l, let's get rid of the
->vidioc_enum_fmt_{vid,out}_cap_mplane() hooks and call
->vidioc_enum_fmt_{vid,out}_cap() instead.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[hverkuil-cisco@xs4all.nl: fix typos: pirv -> priv and prov -> priv]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
30 files changed:
drivers/media/pci/intel/ipu3/ipu3-cio2.c
drivers/media/platform/exynos-gsc/gsc-core.c
drivers/media/platform/exynos-gsc/gsc-core.h
drivers/media/platform/exynos-gsc/gsc-m2m.c
drivers/media/platform/exynos4-is/fimc-capture.c
drivers/media/platform/exynos4-is/fimc-isp-video.c
drivers/media/platform/exynos4-is/fimc-lite.c
drivers/media/platform/exynos4-is/fimc-m2m.c
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
drivers/media/platform/qcom/camss/camss-video.c
drivers/media/platform/qcom/venus/vdec.c
drivers/media/platform/qcom/venus/venc.c
drivers/media/platform/rcar_fdp1.c
drivers/media/platform/rcar_jpu.c
drivers/media/platform/renesas-ceu.c
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
drivers/media/platform/ti-vpe/vpe.c
drivers/media/platform/vicodec/vicodec-core.c
drivers/media/platform/vivid/vivid-core.c
drivers/media/platform/vivid/vivid-vid-common.c
drivers/media/platform/vivid/vivid-vid-common.h
drivers/media/v4l2-core/v4l2-dev.c
drivers/media/v4l2-core/v4l2-ioctl.c
drivers/staging/media/ipu3/ipu3-v4l2.c
drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c
include/media/v4l2-ioctl.h

index 2a52a393fe7465185086e11a905b64b155d107a4..c1d133e17e4b8bfc794784f1b828845f4ca154df 100644 (file)
@@ -1174,7 +1174,7 @@ static const struct v4l2_file_operations cio2_v4l2_fops = {
 
 static const struct v4l2_ioctl_ops cio2_v4l2_ioctl_ops = {
        .vidioc_querycap = cio2_v4l2_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = cio2_v4l2_enum_fmt,
+       .vidioc_enum_fmt_vid_cap = cio2_v4l2_enum_fmt,
        .vidioc_g_fmt_vid_cap_mplane = cio2_v4l2_g_fmt,
        .vidioc_s_fmt_vid_cap_mplane = cio2_v4l2_s_fmt,
        .vidioc_try_fmt_vid_cap_mplane = cio2_v4l2_try_fmt,
index 0fa3ec04ab7b4d624b7fc5c01e6ae2adc32f0f90..f1d555f47ce364fe6f87bad96900b5c99c622034 100644 (file)
@@ -331,7 +331,7 @@ void gsc_check_src_scale_info(struct gsc_variant *var,
        }
 }
 
-int gsc_enum_fmt_mplane(struct v4l2_fmtdesc *f)
+int gsc_enum_fmt(struct v4l2_fmtdesc *f)
 {
        const struct gsc_fmt *fmt;
 
index c81f0a17d286418d6c8bcdaa099bdd33424c21a2..8ea49ca004fd16e94841b11fb3855cc10e2168f7 100644 (file)
@@ -387,7 +387,7 @@ void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state);
 u32 get_plane_size(struct gsc_frame *fr, unsigned int plane);
 const struct gsc_fmt *get_format(int index);
 const struct gsc_fmt *find_fmt(u32 *pixelformat, u32 *mbus_code, u32 index);
-int gsc_enum_fmt_mplane(struct v4l2_fmtdesc *f);
+int gsc_enum_fmt(struct v4l2_fmtdesc *f);
 int gsc_try_fmt_mplane(struct gsc_ctx *ctx, struct v4l2_format *f);
 void gsc_set_frame_size(struct gsc_frame *frame, int width, int height);
 int gsc_g_fmt_mplane(struct gsc_ctx *ctx, struct v4l2_format *f);
index cd02e3c233fce52aeafd7a51c19232d6826a35a2..6346694f7de84f4ded65ef04c9d46d98a0f21e4e 100644 (file)
@@ -301,10 +301,10 @@ static int gsc_m2m_querycap(struct file *file, void *fh,
        return 0;
 }
 
-static int gsc_m2m_enum_fmt_mplane(struct file *file, void *priv,
-                               struct v4l2_fmtdesc *f)
+static int gsc_m2m_enum_fmt(struct file *file, void *priv,
+                           struct v4l2_fmtdesc *f)
 {
-       return gsc_enum_fmt_mplane(f);
+       return gsc_enum_fmt(f);
 }
 
 static int gsc_m2m_g_fmt_mplane(struct file *file, void *fh,
@@ -560,8 +560,8 @@ static int gsc_m2m_s_selection(struct file *file, void *fh,
 
 static const struct v4l2_ioctl_ops gsc_m2m_ioctl_ops = {
        .vidioc_querycap                = gsc_m2m_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = gsc_m2m_enum_fmt_mplane,
-       .vidioc_enum_fmt_vid_out_mplane = gsc_m2m_enum_fmt_mplane,
+       .vidioc_enum_fmt_vid_cap        = gsc_m2m_enum_fmt,
+       .vidioc_enum_fmt_vid_out        = gsc_m2m_enum_fmt,
        .vidioc_g_fmt_vid_cap_mplane    = gsc_m2m_g_fmt_mplane,
        .vidioc_g_fmt_vid_out_mplane    = gsc_m2m_g_fmt_mplane,
        .vidioc_try_fmt_vid_cap_mplane  = gsc_m2m_try_fmt_mplane,
index ecfa6ab4a19d9caea64f70c1ee9231362b790780..84b91e248c5ad6e19c12aba6fb92229bbba314a0 100644 (file)
@@ -732,8 +732,8 @@ static int fimc_cap_querycap(struct file *file, void *priv,
        return 0;
 }
 
-static int fimc_cap_enum_fmt_mplane(struct file *file, void *priv,
-                                   struct v4l2_fmtdesc *f)
+static int fimc_cap_enum_fmt(struct file *file, void *priv,
+                            struct v4l2_fmtdesc *f)
 {
        struct fimc_fmt *fmt;
 
@@ -1360,7 +1360,7 @@ static int fimc_cap_s_selection(struct file *file, void *fh,
 static const struct v4l2_ioctl_ops fimc_capture_ioctl_ops = {
        .vidioc_querycap                = fimc_cap_querycap,
 
-       .vidioc_enum_fmt_vid_cap_mplane = fimc_cap_enum_fmt_mplane,
+       .vidioc_enum_fmt_vid_cap        = fimc_cap_enum_fmt,
        .vidioc_try_fmt_vid_cap_mplane  = fimc_cap_try_fmt_mplane,
        .vidioc_s_fmt_vid_cap_mplane    = fimc_cap_s_fmt_mplane,
        .vidioc_g_fmt_vid_cap_mplane    = fimc_cap_g_fmt_mplane,
index ad8dd672d4a71cfb4376c1797e57762cf3ed3c8f..2226a13ac89bb5b9518fcdd452917296061581ef 100644 (file)
@@ -353,8 +353,8 @@ static int isp_video_querycap(struct file *file, void *priv,
        return 0;
 }
 
-static int isp_video_enum_fmt_mplane(struct file *file, void *priv,
-                                       struct v4l2_fmtdesc *f)
+static int isp_video_enum_fmt(struct file *file, void *priv,
+                             struct v4l2_fmtdesc *f)
 {
        const struct fimc_fmt *fmt;
 
@@ -551,7 +551,7 @@ static int isp_video_reqbufs(struct file *file, void *priv,
 
 static const struct v4l2_ioctl_ops isp_video_ioctl_ops = {
        .vidioc_querycap                = isp_video_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = isp_video_enum_fmt_mplane,
+       .vidioc_enum_fmt_vid_cap        = isp_video_enum_fmt,
        .vidioc_try_fmt_vid_cap_mplane  = isp_video_try_fmt_mplane,
        .vidioc_s_fmt_vid_cap_mplane    = isp_video_s_fmt_mplane,
        .vidioc_g_fmt_vid_cap_mplane    = isp_video_g_fmt_mplane,
index a16b5bed59bbe09cfa38c53a2b840f6ac339ba3e..e71342756d886cde00589a4436b8166daece114f 100644 (file)
@@ -661,8 +661,8 @@ static int fimc_lite_querycap(struct file *file, void *priv,
        return 0;
 }
 
-static int fimc_lite_enum_fmt_mplane(struct file *file, void *priv,
-                                    struct v4l2_fmtdesc *f)
+static int fimc_lite_enum_fmt(struct file *file, void *priv,
+                             struct v4l2_fmtdesc *f)
 {
        const struct fimc_fmt *fmt;
 
@@ -951,7 +951,7 @@ static int fimc_lite_s_selection(struct file *file, void *fh,
 
 static const struct v4l2_ioctl_ops fimc_lite_ioctl_ops = {
        .vidioc_querycap                = fimc_lite_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = fimc_lite_enum_fmt_mplane,
+       .vidioc_enum_fmt_vid_cap        = fimc_lite_enum_fmt,
        .vidioc_try_fmt_vid_cap_mplane  = fimc_lite_try_fmt_mplane,
        .vidioc_s_fmt_vid_cap_mplane    = fimc_lite_s_fmt_mplane,
        .vidioc_g_fmt_vid_cap_mplane    = fimc_lite_g_fmt_mplane,
index 17e5bf4810f49f76508d4dd0bc0aaac9cf7cfc4d..0d1d8b717d9a6b41e0ea07d57aa65e052d41a676 100644 (file)
@@ -241,8 +241,8 @@ static int fimc_m2m_querycap(struct file *file, void *fh,
        return 0;
 }
 
-static int fimc_m2m_enum_fmt_mplane(struct file *file, void *priv,
-                                   struct v4l2_fmtdesc *f)
+static int fimc_m2m_enum_fmt(struct file *file, void *priv,
+                            struct v4l2_fmtdesc *f)
 {
        struct fimc_fmt *fmt;
 
@@ -532,8 +532,8 @@ static int fimc_m2m_s_selection(struct file *file, void *fh,
 
 static const struct v4l2_ioctl_ops fimc_m2m_ioctl_ops = {
        .vidioc_querycap                = fimc_m2m_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = fimc_m2m_enum_fmt_mplane,
-       .vidioc_enum_fmt_vid_out_mplane = fimc_m2m_enum_fmt_mplane,
+       .vidioc_enum_fmt_vid_cap        = fimc_m2m_enum_fmt,
+       .vidioc_enum_fmt_vid_out        = fimc_m2m_enum_fmt,
        .vidioc_g_fmt_vid_cap_mplane    = fimc_m2m_g_fmt_mplane,
        .vidioc_g_fmt_vid_out_mplane    = fimc_m2m_g_fmt_mplane,
        .vidioc_try_fmt_vid_cap_mplane  = fimc_m2m_try_fmt_mplane,
index f761e4d8bf2ade11d2eb44423fb94452d09b3ebf..3b199662cb340f852580cbc50bd48d131680d417 100644 (file)
@@ -536,8 +536,8 @@ end:
 
 static const struct v4l2_ioctl_ops mtk_jpeg_ioctl_ops = {
        .vidioc_querycap                = mtk_jpeg_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = mtk_jpeg_enum_fmt_vid_cap,
-       .vidioc_enum_fmt_vid_out_mplane = mtk_jpeg_enum_fmt_vid_out,
+       .vidioc_enum_fmt_vid_cap        = mtk_jpeg_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_out        = mtk_jpeg_enum_fmt_vid_out,
        .vidioc_try_fmt_vid_cap_mplane  = mtk_jpeg_try_fmt_vid_cap_mplane,
        .vidioc_try_fmt_vid_out_mplane  = mtk_jpeg_try_fmt_vid_out_mplane,
        .vidioc_g_fmt_vid_cap_mplane    = mtk_jpeg_g_fmt_vid_mplane,
index 7d15c06e9db93fcc9bf70420d37d33e8179829e8..365d3f92fd9e799cb1a3507c3250f300bfe494d2 100644 (file)
@@ -620,7 +620,7 @@ static int mtk_mdp_m2m_querycap(struct file *file, void *fh,
        return 0;
 }
 
-static int mtk_mdp_enum_fmt_mplane(struct v4l2_fmtdesc *f, u32 type)
+static int mtk_mdp_enum_fmt(struct v4l2_fmtdesc *f, u32 type)
 {
        const struct mtk_mdp_fmt *fmt;
 
@@ -633,16 +633,16 @@ static int mtk_mdp_enum_fmt_mplane(struct v4l2_fmtdesc *f, u32 type)
        return 0;
 }
 
-static int mtk_mdp_m2m_enum_fmt_mplane_vid_cap(struct file *file, void *priv,
-                                      struct v4l2_fmtdesc *f)
+static int mtk_mdp_m2m_enum_fmt_vid_cap(struct file *file, void *priv,
+                                       struct v4l2_fmtdesc *f)
 {
-       return mtk_mdp_enum_fmt_mplane(f, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
+       return mtk_mdp_enum_fmt(f, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
 }
 
-static int mtk_mdp_m2m_enum_fmt_mplane_vid_out(struct file *file, void *priv,
-                                      struct v4l2_fmtdesc *f)
+static int mtk_mdp_m2m_enum_fmt_vid_out(struct file *file, void *priv,
+                                       struct v4l2_fmtdesc *f)
 {
-       return mtk_mdp_enum_fmt_mplane(f, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+       return mtk_mdp_enum_fmt(f, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
 }
 
 static int mtk_mdp_m2m_g_fmt_mplane(struct file *file, void *fh,
@@ -935,8 +935,8 @@ static int mtk_mdp_m2m_s_selection(struct file *file, void *fh,
 
 static const struct v4l2_ioctl_ops mtk_mdp_m2m_ioctl_ops = {
        .vidioc_querycap                = mtk_mdp_m2m_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = mtk_mdp_m2m_enum_fmt_mplane_vid_cap,
-       .vidioc_enum_fmt_vid_out_mplane = mtk_mdp_m2m_enum_fmt_mplane_vid_out,
+       .vidioc_enum_fmt_vid_cap        = mtk_mdp_m2m_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_out        = mtk_mdp_m2m_enum_fmt_vid_out,
        .vidioc_g_fmt_vid_cap_mplane    = mtk_mdp_m2m_g_fmt_mplane,
        .vidioc_g_fmt_vid_out_mplane    = mtk_mdp_m2m_g_fmt_mplane,
        .vidioc_try_fmt_vid_cap_mplane  = mtk_mdp_m2m_try_fmt_mplane,
index 851903867bc9a170a5e971716b075610e971494a..ebf919509e8cbd43a26b81d698823bce5df9bba9 100644 (file)
@@ -957,14 +957,14 @@ static int vidioc_enum_fmt(struct v4l2_fmtdesc *f, bool output_queue)
        return 0;
 }
 
-static int vidioc_vdec_enum_fmt_vid_cap_mplane(struct file *file, void *pirv,
-                                              struct v4l2_fmtdesc *f)
+static int vidioc_vdec_enum_fmt_vid_cap(struct file *file, void *priv,
+                                       struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(f, false);
 }
 
-static int vidioc_vdec_enum_fmt_vid_out_mplane(struct file *file, void *priv,
-                                              struct v4l2_fmtdesc *f)
+static int vidioc_vdec_enum_fmt_vid_out(struct file *file, void *priv,
+                                       struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(f, true);
 }
@@ -1461,8 +1461,8 @@ const struct v4l2_ioctl_ops mtk_vdec_ioctl_ops = {
 
        .vidioc_create_bufs             = v4l2_m2m_ioctl_create_bufs,
 
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_vdec_enum_fmt_vid_cap_mplane,
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_vdec_enum_fmt_vid_out_mplane,
+       .vidioc_enum_fmt_vid_cap        = vidioc_vdec_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_out        = vidioc_vdec_enum_fmt_vid_out,
        .vidioc_enum_framesizes = vidioc_enum_framesizes,
 
        .vidioc_querycap                = vidioc_vdec_querycap,
index 50351adafc470891461d2c16b88d704c768cac55..2c92ee4f0c8cd49020c1a2e2a9ef95d8e481194b 100644 (file)
@@ -207,14 +207,14 @@ static int vidioc_enum_framesizes(struct file *file, void *fh,
        return -EINVAL;
 }
 
-static int vidioc_enum_fmt_vid_cap_mplane(struct file *file, void *pirv,
-                                         struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(f, false);
 }
 
-static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *prov,
-                                         struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_out(struct file *file, void *priv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(f, true);
 }
@@ -725,8 +725,8 @@ const struct v4l2_ioctl_ops mtk_venc_ioctl_ops = {
        .vidioc_dqbuf                   = vidioc_venc_dqbuf,
 
        .vidioc_querycap                = vidioc_venc_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane,
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane,
+       .vidioc_enum_fmt_vid_cap        = vidioc_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_out        = vidioc_enum_fmt_vid_out,
        .vidioc_enum_framesizes         = vidioc_enum_framesizes,
 
        .vidioc_try_fmt_vid_cap_mplane  = vidioc_try_fmt_vid_cap_mplane,
index 58aebe7114cd7dc5eb259cb4e9645be279c2765a..1d50dfbbb762e585d0cf5d9f164f6f782fa61624 100644 (file)
@@ -703,7 +703,7 @@ static int video_s_input(struct file *file, void *fh, unsigned int input)
 
 static const struct v4l2_ioctl_ops msm_vid_ioctl_ops = {
        .vidioc_querycap                = video_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = video_enum_fmt,
+       .vidioc_enum_fmt_vid_cap        = video_enum_fmt,
        .vidioc_g_fmt_vid_cap_mplane    = video_g_fmt,
        .vidioc_s_fmt_vid_cap_mplane    = video_s_fmt,
        .vidioc_try_fmt_vid_cap_mplane  = video_try_fmt,
index 282de21cf2e1e8bc2aff1608b4dbbe34410af7ec..2a47b9b8c5bc44160e86221c48176eb37fe73aec 100644 (file)
@@ -491,8 +491,8 @@ unlock:
 
 static const struct v4l2_ioctl_ops vdec_ioctl_ops = {
        .vidioc_querycap = vdec_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = vdec_enum_fmt,
-       .vidioc_enum_fmt_vid_out_mplane = vdec_enum_fmt,
+       .vidioc_enum_fmt_vid_cap = vdec_enum_fmt,
+       .vidioc_enum_fmt_vid_out = vdec_enum_fmt,
        .vidioc_s_fmt_vid_cap_mplane = vdec_s_fmt,
        .vidioc_s_fmt_vid_out_mplane = vdec_s_fmt,
        .vidioc_g_fmt_vid_cap_mplane = vdec_g_fmt,
index 32cff294582f9abee76cc22baa589cb87f136bb5..406a47923996d9f285a7b4acd684fb595538fcf2 100644 (file)
@@ -616,8 +616,8 @@ static int venc_enum_frameintervals(struct file *file, void *fh,
 
 static const struct v4l2_ioctl_ops venc_ioctl_ops = {
        .vidioc_querycap = venc_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = venc_enum_fmt,
-       .vidioc_enum_fmt_vid_out_mplane = venc_enum_fmt,
+       .vidioc_enum_fmt_vid_cap = venc_enum_fmt,
+       .vidioc_enum_fmt_vid_out = venc_enum_fmt,
        .vidioc_s_fmt_vid_cap_mplane = venc_s_fmt,
        .vidioc_s_fmt_vid_out_mplane = venc_s_fmt,
        .vidioc_g_fmt_vid_cap_mplane = venc_g_fmt,
index 6a90bc4c476e51e422fbe154dfca2adcd9331d6e..6f9a4c69f620b900e9f7c4d6d4a7eed40ae37490 100644 (file)
@@ -1730,8 +1730,8 @@ static const char * const fdp1_ctrl_deint_menu[] = {
 static const struct v4l2_ioctl_ops fdp1_ioctl_ops = {
        .vidioc_querycap        = fdp1_vidioc_querycap,
 
-       .vidioc_enum_fmt_vid_cap_mplane = fdp1_enum_fmt_vid_cap,
-       .vidioc_enum_fmt_vid_out_mplane = fdp1_enum_fmt_vid_out,
+       .vidioc_enum_fmt_vid_cap        = fdp1_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_out        = fdp1_enum_fmt_vid_out,
        .vidioc_g_fmt_vid_cap_mplane    = fdp1_g_fmt,
        .vidioc_g_fmt_vid_out_mplane    = fdp1_g_fmt,
        .vidioc_try_fmt_vid_cap_mplane  = fdp1_try_fmt,
index 9b6eadef6858cfe73bebef61d57c9a2adba8d78a..1c3f507acfc99235c42cc7e8cd9f4c21f82c32e7 100644 (file)
@@ -946,8 +946,8 @@ static int jpu_streamon(struct file *file, void *priv, enum v4l2_buf_type type)
 static const struct v4l2_ioctl_ops jpu_ioctl_ops = {
        .vidioc_querycap                = jpu_querycap,
 
-       .vidioc_enum_fmt_vid_cap_mplane = jpu_enum_fmt_cap,
-       .vidioc_enum_fmt_vid_out_mplane = jpu_enum_fmt_out,
+       .vidioc_enum_fmt_vid_cap        = jpu_enum_fmt_cap,
+       .vidioc_enum_fmt_vid_out        = jpu_enum_fmt_out,
        .vidioc_g_fmt_vid_cap_mplane    = jpu_g_fmt,
        .vidioc_g_fmt_vid_out_mplane    = jpu_g_fmt,
        .vidioc_try_fmt_vid_cap_mplane  = jpu_try_fmt,
index 150196f7cf96b16ee3d37e64839b235cebea607d..57d0c0f9fa4be56483becdc43cd96d0f1ce9d1df 100644 (file)
@@ -1339,7 +1339,7 @@ static int ceu_enum_frameintervals(struct file *file, void *fh,
 static const struct v4l2_ioctl_ops ceu_ioctl_ops = {
        .vidioc_querycap                = ceu_querycap,
 
-       .vidioc_enum_fmt_vid_cap_mplane = ceu_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_cap        = ceu_enum_fmt_vid_cap,
        .vidioc_try_fmt_vid_cap_mplane  = ceu_try_fmt_vid_cap,
        .vidioc_s_fmt_vid_cap_mplane    = ceu_s_fmt_vid_cap,
        .vidioc_g_fmt_vid_cap_mplane    = ceu_g_fmt_vid_cap,
index d29e5bc736510f5a6a27f3f24a79f8e4e46fdc41..51ab2e38a270a1a159995de37ae0283711addaa8 100644 (file)
@@ -306,14 +306,14 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,
        return 0;
 }
 
-static int vidioc_enum_fmt_vid_cap_mplane(struct file *file, void *pirv,
-                                                       struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_cap(struct file *file, void *pirv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(file, f, false);
 }
 
-static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *priv,
-                                                       struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_out(struct file *file, void *priv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(file, f, true);
 }
@@ -880,8 +880,8 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh,
 /* v4l2_ioctl_ops */
 static const struct v4l2_ioctl_ops s5p_mfc_dec_ioctl_ops = {
        .vidioc_querycap = vidioc_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane,
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane,
+       .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out,
        .vidioc_g_fmt_vid_cap_mplane = vidioc_g_fmt,
        .vidioc_g_fmt_vid_out_mplane = vidioc_g_fmt,
        .vidioc_try_fmt_vid_cap_mplane = vidioc_try_fmt,
index 5ab1231b4189f4c805485b3b0622b2e8ac9c0ce1..90622abe1aad98c2e215ac4fac5a0dce2a7b4c32 100644 (file)
@@ -1347,14 +1347,14 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,
        return -EINVAL;
 }
 
-static int vidioc_enum_fmt_vid_cap_mplane(struct file *file, void *pirv,
-                                         struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_cap(struct file *file, void *pirv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(file, f, false);
 }
 
-static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *prov,
-                                         struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_out(struct file *file, void *priv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(file, f, true);
 }
@@ -2336,8 +2336,8 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh,
 
 static const struct v4l2_ioctl_ops s5p_mfc_enc_ioctl_ops = {
        .vidioc_querycap = vidioc_querycap,
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane,
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane,
+       .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out,
        .vidioc_g_fmt_vid_cap_mplane = vidioc_g_fmt,
        .vidioc_g_fmt_vid_out_mplane = vidioc_g_fmt,
        .vidioc_try_fmt_vid_cap_mplane = vidioc_try_fmt,
index a61ac426853a630ec5470abce6e6a69bcc3496e4..3f90f9413da193056599841c7071ee646dcb3771 100644 (file)
@@ -1971,12 +1971,12 @@ static const struct v4l2_ctrl_ops vpe_ctrl_ops = {
 static const struct v4l2_ioctl_ops vpe_ioctl_ops = {
        .vidioc_querycap                = vpe_querycap,
 
-       .vidioc_enum_fmt_vid_cap_mplane = vpe_enum_fmt,
+       .vidioc_enum_fmt_vid_cap        = vpe_enum_fmt,
        .vidioc_g_fmt_vid_cap_mplane    = vpe_g_fmt,
        .vidioc_try_fmt_vid_cap_mplane  = vpe_try_fmt,
        .vidioc_s_fmt_vid_cap_mplane    = vpe_s_fmt,
 
-       .vidioc_enum_fmt_vid_out_mplane = vpe_enum_fmt,
+       .vidioc_enum_fmt_vid_out        = vpe_enum_fmt,
        .vidioc_g_fmt_vid_out_mplane    = vpe_g_fmt,
        .vidioc_try_fmt_vid_out_mplane  = vpe_try_fmt,
        .vidioc_s_fmt_vid_out_mplane    = vpe_s_fmt,
index 89961257f03f4569af29aca152ef063e456ab4bb..03acdf86176e0bda066d69c08dd98554bdbe8e81 100644 (file)
@@ -1297,7 +1297,6 @@ static const struct v4l2_ioctl_ops vicodec_ioctl_ops = {
        .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
        .vidioc_s_fmt_vid_cap   = vidioc_s_fmt_vid_cap,
 
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap,
        .vidioc_g_fmt_vid_cap_mplane    = vidioc_g_fmt_vid_cap,
        .vidioc_try_fmt_vid_cap_mplane  = vidioc_try_fmt_vid_cap,
        .vidioc_s_fmt_vid_cap_mplane    = vidioc_s_fmt_vid_cap,
@@ -1307,7 +1306,6 @@ static const struct v4l2_ioctl_ops vicodec_ioctl_ops = {
        .vidioc_try_fmt_vid_out = vidioc_try_fmt_vid_out,
        .vidioc_s_fmt_vid_out   = vidioc_s_fmt_vid_out,
 
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out,
        .vidioc_g_fmt_vid_out_mplane    = vidioc_g_fmt_vid_out,
        .vidioc_try_fmt_vid_out_mplane  = vidioc_try_fmt_vid_out,
        .vidioc_s_fmt_vid_out_mplane    = vidioc_s_fmt_vid_out,
index 7047df6f0e0e134af6a8d6e64f3ad37afdefbb5b..beb2e566a43ca1930a9992317233776a015c10f4 100644 (file)
@@ -500,20 +500,18 @@ static const struct v4l2_file_operations vivid_radio_fops = {
 static const struct v4l2_ioctl_ops vivid_ioctl_ops = {
        .vidioc_querycap                = vidioc_querycap,
 
-       .vidioc_enum_fmt_vid_cap        = vidioc_enum_fmt_vid,
+       .vidioc_enum_fmt_vid_cap        = vivid_enum_fmt_vid,
        .vidioc_g_fmt_vid_cap           = vidioc_g_fmt_vid_cap,
        .vidioc_try_fmt_vid_cap         = vidioc_try_fmt_vid_cap,
        .vidioc_s_fmt_vid_cap           = vidioc_s_fmt_vid_cap,
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_mplane,
        .vidioc_g_fmt_vid_cap_mplane    = vidioc_g_fmt_vid_cap_mplane,
        .vidioc_try_fmt_vid_cap_mplane  = vidioc_try_fmt_vid_cap_mplane,
        .vidioc_s_fmt_vid_cap_mplane    = vidioc_s_fmt_vid_cap_mplane,
 
-       .vidioc_enum_fmt_vid_out        = vidioc_enum_fmt_vid,
+       .vidioc_enum_fmt_vid_out        = vivid_enum_fmt_vid,
        .vidioc_g_fmt_vid_out           = vidioc_g_fmt_vid_out,
        .vidioc_try_fmt_vid_out         = vidioc_try_fmt_vid_out,
        .vidioc_s_fmt_vid_out           = vidioc_s_fmt_vid_out,
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_mplane,
        .vidioc_g_fmt_vid_out_mplane    = vidioc_g_fmt_vid_out_mplane,
        .vidioc_try_fmt_vid_out_mplane  = vidioc_try_fmt_vid_out_mplane,
        .vidioc_s_fmt_vid_out_mplane    = vidioc_s_fmt_vid_out_mplane,
index 74b83bcc611981deb5079ac8b15d2a8a17749178..9307ce1cdd1641b161bcc0f772742fefb25d9ee8 100644 (file)
@@ -797,26 +797,6 @@ int vivid_enum_fmt_vid(struct file *file, void  *priv,
        return 0;
 }
 
-int vidioc_enum_fmt_vid_mplane(struct file *file, void  *priv,
-                                       struct v4l2_fmtdesc *f)
-{
-       struct vivid_dev *dev = video_drvdata(file);
-
-       if (!dev->multiplanar)
-               return -ENOTTY;
-       return vivid_enum_fmt_vid(file, priv, f);
-}
-
-int vidioc_enum_fmt_vid(struct file *file, void  *priv,
-                                       struct v4l2_fmtdesc *f)
-{
-       struct vivid_dev *dev = video_drvdata(file);
-
-       if (dev->multiplanar)
-               return -ENOTTY;
-       return vivid_enum_fmt_vid(file, priv, f);
-}
-
 int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
 {
        struct vivid_dev *dev = video_drvdata(file);
index 29b6c0b40a1b8fc8a4fdd1d4a2e8da219f7a6f5b..d908d97252830923c2322f2639fd87309ebefe2d 100644 (file)
@@ -28,8 +28,6 @@ void vivid_send_source_change(struct vivid_dev *dev, unsigned type);
 int vivid_vid_adjust_sel(unsigned flags, struct v4l2_rect *r);
 
 int vivid_enum_fmt_vid(struct file *file, void  *priv, struct v4l2_fmtdesc *f);
-int vidioc_enum_fmt_vid_mplane(struct file *file, void  *priv, struct v4l2_fmtdesc *f);
-int vidioc_enum_fmt_vid(struct file *file, void  *priv, struct v4l2_fmtdesc *f);
 int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id);
 int vidioc_g_dv_timings(struct file *file, void *_fh, struct v4l2_dv_timings *timings);
 int vidioc_enum_dv_timings(struct file *file, void *_fh, struct v4l2_enum_dv_timings *timings);
index d7528f82a66aa6be5896d48d18a4142fb2ac7e1b..29946a2b275258dbe430357307be910e8f74426b 100644 (file)
@@ -593,11 +593,9 @@ static void determine_valid_ioctls(struct video_device *vdev)
        if (is_vid || is_tch) {
                /* video and metadata specific ioctls */
                if ((is_rx && (ops->vidioc_enum_fmt_vid_cap ||
-                              ops->vidioc_enum_fmt_vid_cap_mplane ||
                               ops->vidioc_enum_fmt_vid_overlay ||
                               ops->vidioc_enum_fmt_meta_cap)) ||
                    (is_tx && (ops->vidioc_enum_fmt_vid_out ||
-                              ops->vidioc_enum_fmt_vid_out_mplane ||
                               ops->vidioc_enum_fmt_meta_out)))
                        set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls);
                if ((is_rx && (ops->vidioc_g_fmt_vid_cap ||
index 0fbee3caef5d84c943931f8d2e8b049ad1991298..b4c73e8f23c52f2c4d8586fb7eb6c3c5e88978f3 100644 (file)
@@ -1382,6 +1382,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
                                struct file *file, void *fh, void *arg)
 {
+       struct video_device *vdev = video_devdata(file);
        struct v4l2_fmtdesc *p = arg;
        int ret = check_fmt(file, p->type);
 
@@ -1391,30 +1392,30 @@ static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
 
        switch (p->type) {
        case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+       case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+               if (!!(vdev->device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) !=
+                   (p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE))
+                       break;
+
                if (unlikely(!ops->vidioc_enum_fmt_vid_cap))
                        break;
                ret = ops->vidioc_enum_fmt_vid_cap(file, fh, arg);
                break;
-       case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
-               if (unlikely(!ops->vidioc_enum_fmt_vid_cap_mplane))
-                       break;
-               ret = ops->vidioc_enum_fmt_vid_cap_mplane(file, fh, arg);
-               break;
        case V4L2_BUF_TYPE_VIDEO_OVERLAY:
                if (unlikely(!ops->vidioc_enum_fmt_vid_overlay))
                        break;
                ret = ops->vidioc_enum_fmt_vid_overlay(file, fh, arg);
                break;
        case V4L2_BUF_TYPE_VIDEO_OUTPUT:
+       case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+               if (!!(vdev->device_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) !=
+                   (p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE))
+                       break;
+
                if (unlikely(!ops->vidioc_enum_fmt_vid_out))
                        break;
                ret = ops->vidioc_enum_fmt_vid_out(file, fh, arg);
                break;
-       case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
-               if (unlikely(!ops->vidioc_enum_fmt_vid_out_mplane))
-                       break;
-               ret = ops->vidioc_enum_fmt_vid_out_mplane(file, fh, arg);
-               break;
        case V4L2_BUF_TYPE_SDR_CAPTURE:
                if (unlikely(!ops->vidioc_enum_fmt_sdr_cap))
                        break;
index a7bc22040ed8ba6e2befb3c14aac4ae198806026..3c7ad1eed4343a2afdcd93fff0b4821aa62d92d8 100644 (file)
@@ -955,12 +955,12 @@ static const struct v4l2_file_operations imgu_v4l2_fops = {
 static const struct v4l2_ioctl_ops imgu_v4l2_ioctl_ops = {
        .vidioc_querycap = imgu_vidioc_querycap,
 
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap,
+       .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
        .vidioc_g_fmt_vid_cap_mplane = imgu_vidioc_g_fmt,
        .vidioc_s_fmt_vid_cap_mplane = imgu_vidioc_s_fmt,
        .vidioc_try_fmt_vid_cap_mplane = imgu_vidioc_try_fmt,
 
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out,
+       .vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out,
        .vidioc_g_fmt_vid_out_mplane = imgu_vidioc_g_fmt,
        .vidioc_s_fmt_vid_out_mplane = imgu_vidioc_s_fmt,
        .vidioc_try_fmt_vid_out_mplane = imgu_vidioc_try_fmt,
index 1b80a45df8fe1b567e3da82cba5148529a17d8e9..8bc709ab13be9bccc3d736ddaf24f4920505f00f 100644 (file)
@@ -153,14 +153,14 @@ static int vidioc_enum_fmt(struct file *file, void *priv,
        return -EINVAL;
 }
 
-static int vidioc_enum_fmt_vid_cap_mplane(struct file *file, void *priv,
-                                         struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(file, priv, f, true);
 }
 
-static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *priv,
-                                         struct v4l2_fmtdesc *f)
+static int vidioc_enum_fmt_vid_out(struct file *file, void *priv,
+                                  struct v4l2_fmtdesc *f)
 {
        return vidioc_enum_fmt(file, priv, f, false);
 }
@@ -494,8 +494,8 @@ const struct v4l2_ioctl_ops rockchip_vpu_ioctl_ops = {
        .vidioc_s_fmt_vid_cap_mplane = vidioc_s_fmt_cap_mplane,
        .vidioc_g_fmt_vid_out_mplane = vidioc_g_fmt_out_mplane,
        .vidioc_g_fmt_vid_cap_mplane = vidioc_g_fmt_cap_mplane,
-       .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane,
-       .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane,
+       .vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out,
+       .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
 
        .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs,
        .vidioc_querybuf = v4l2_m2m_ioctl_querybuf,
index 8533ece5026e459181a9c485d6aa986a3ddcba4a..400f2e46c1085824d4611fbb499405f62ac9b4f4 100644 (file)
@@ -26,19 +26,13 @@ struct v4l2_fh;
  *     :ref:`VIDIOC_QUERYCAP <vidioc_querycap>` ioctl
  * @vidioc_enum_fmt_vid_cap: pointer to the function that implements
  *     :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
- *     for video capture in single plane mode
+ *     for video capture in single and multi plane mode
  * @vidioc_enum_fmt_vid_overlay: pointer to the function that implements
  *     :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
  *     for video overlay
  * @vidioc_enum_fmt_vid_out: pointer to the function that implements
  *     :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
- *     for video output in single plane mode
- * @vidioc_enum_fmt_vid_cap_mplane: pointer to the function that implements
- *     :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
- *     for video capture in multiplane mode
- * @vidioc_enum_fmt_vid_out_mplane: pointer to the function that implements
- *     :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
- *     for video output in multiplane mode
+ *     for video output in single and multi plane mode
  * @vidioc_enum_fmt_sdr_cap: pointer to the function that implements
  *     :ref:`VIDIOC_ENUM_FMT <vidioc_enum_fmt>` ioctl logic
  *     for Software Defined Radio capture
@@ -313,10 +307,6 @@ struct v4l2_ioctl_ops {
                                           struct v4l2_fmtdesc *f);
        int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh,
                                       struct v4l2_fmtdesc *f);
-       int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *file, void *fh,
-                                             struct v4l2_fmtdesc *f);
-       int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh,
-                                             struct v4l2_fmtdesc *f);
        int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh,
                                       struct v4l2_fmtdesc *f);
        int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh,