[COMMON] media: mfc: move __mfc_enc_check_resolution function
authorJeonghee Kim <jhhhh.kim@samsung.com>
Thu, 26 Jul 2018 07:52:59 +0000 (16:52 +0900)
committerhskang <hs1218.kang@samsung.com>
Sun, 9 Sep 2018 21:39:07 +0000 (06:39 +0900)
This function should be called after otf_init,
because the width/height information is needed.

Change-Id: Icab18d34082252c8a28365d39c898fbc4dfdf174
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c

index fd5eff5845aa44d29bb1ca7ae8da1e12c2255a70..a9390a15c9a0008ecf9a5057eb2c4dbc8a8ac4d8 100644 (file)
@@ -404,11 +404,6 @@ static int mfc_enc_s_fmt_vid_cap_mplane(struct file *file, void *priv,
        mfc_info_ctx("[STREAM] Enc dst codec(%d) : %s\n",
                        ctx->codec_mode, ctx->dst_fmt->name);
 
-       if (__mfc_enc_check_resolution(ctx)) {
-               mfc_err_ctx("Unsupported resolution\n");
-               return -EINVAL;
-       }
-
        if (ctx->otf_handle) {
                if (ctx->dst_fmt->fourcc != V4L2_PIX_FMT_H264 &&
                                ctx->dst_fmt->fourcc != V4L2_PIX_FMT_HEVC) {
@@ -422,6 +417,11 @@ static int mfc_enc_s_fmt_vid_cap_mplane(struct file *file, void *priv,
                }
        }
 
+       if (__mfc_enc_check_resolution(ctx)) {
+               mfc_err_ctx("Unsupported resolution\n");
+               return -EINVAL;
+       }
+
        enc->dst_buf_size = pix_fmt_mp->plane_fmt[0].sizeimage;
        pix_fmt_mp->plane_fmt[0].bytesperline = 0;