]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
v4l: xilinx: m2m: Fix buftype for s_selection ioctl
authorSatish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Wed, 17 Apr 2019 01:30:37 +0000 (18:30 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 17 Apr 2019 09:28:06 +0000 (11:28 +0200)
In current implementstion, driver is checking against _MPLANE buffer
types, but the type field in struct v4l2_selection is supposed to never
use the _MPLANE variants.

The commit eaec420f530d ("[media] v4l2-ioctl/exynos: fix G/S_SELECTION's
type handling") is converging non-mplane and _MPLANE formats to non-mpalne
formats. This is to allow applications to pass _MPLANE and non-mpalne
buffer types, and the driver only handles the non-mplane formats. Fix
this driver accordingly.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
drivers/media/platform/xilinx/xilinx-m2m.c

index 10ca904f9c19d6bcfaa9a3c13d405c62be3491ed..d0b54254382d899796ff0e2fd050faf69a49414f 100644 (file)
@@ -1056,8 +1056,8 @@ xvip_m2m_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
        struct xvip_m2m_dma *dma = ctx->xdev->dma;
        int ret = 0;
 
-       if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE &&
-           s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+       if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT &&
+           s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
                return -EINVAL;
 
        switch (s->target) {
@@ -1085,8 +1085,8 @@ xvip_m2m_s_selection(struct file *file, void *fh, struct v4l2_selection *s)
        u32 min_width, max_width;
        int ret = 0;
 
-       if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE &&
-           s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+       if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT &&
+           s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
                return -EINVAL;
 
        switch (s->target) {