From: Satish Kumar Nagireddy Date: Wed, 17 Apr 2019 01:30:37 +0000 (-0700) Subject: v4l: xilinx: m2m: Fix buftype for s_selection ioctl X-Git-Tag: xlnx_rebase_v4.19_2019.1~9 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/zynq/linux.git/commitdiff_plain/9c2babf06ebf30e2c7fb324588db6076ee65b6ef v4l: xilinx: m2m: Fix buftype for s_selection ioctl 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 Reviewed-by: Hyun Kwon --- diff --git a/drivers/media/platform/xilinx/xilinx-m2m.c b/drivers/media/platform/xilinx/xilinx-m2m.c index 10ca904f9c19..d0b54254382d 100644 --- a/drivers/media/platform/xilinx/xilinx-m2m.c +++ b/drivers/media/platform/xilinx/xilinx-m2m.c @@ -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) {