MMFMWK-8296: ISI: return error code when user try to do upscale
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Mon, 22 Oct 2018 07:48:00 +0000 (15:48 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Return error code when user try to do upscale since isi don't support.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 59949e29dcd996c50cae43bc5ff3f89907761c1b)

drivers/media/platform/imx8/mxc-isi-m2m.c

index 47f1def..65c7df0 100644 (file)
@@ -800,8 +800,17 @@ static int mxc_isi_m2m_streamon(struct file *file, void *priv,
                             enum v4l2_buf_type type)
 {
        struct mxc_isi_dev *mxc_isi = video_drvdata(file);
+       struct mxc_isi_frame *src_f, *dst_f;
        int ret;
 
+       src_f = &mxc_isi->m2m.src_f;
+       dst_f = &mxc_isi->m2m.dst_f;
+       if ((dst_f->width  > src_f->width) ||
+               (dst_f->height > src_f->height)) {
+               dev_err(&mxc_isi->pdev->dev, "%s Not support upscale\n", __func__);
+               return -EINVAL;
+       }
+
        if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
                mxc_isi->m2m.frame_count = 0;
                mxc_isi_m2m_channel_config(mxc_isi);