[COMMON] media: mfc: no error return when otf init fail
authorSunyoung Kang <sy0816.kang@samsung.com>
Fri, 17 Aug 2018 06:01:01 +0000 (15:01 +0900)
committerhskang <hs1218.kang@samsung.com>
Sun, 9 Sep 2018 21:39:14 +0000 (06:39 +0900)
When VTS ComponentHidlTest, otf init function is called at s_fmt.
But it returns error because the repeater is not initialized and makes VTS fail.
So this fixes to return no error.

Change-Id: Ica1a423c8890c076f2fa4ba2b5a87ad97c312c69
Signed-off-by: Sunyoung Kang <sy0816.kang@samsung.com>
drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c
drivers/media/platform/exynos/mfc/mfc_otf.c

index 26d3d09297aebe665c4ebbd51c5e8c5949a208e8..c639ba5b9191ad2ad6942055f233757ce5fe9a4a 100644 (file)
@@ -410,9 +410,13 @@ static int mfc_enc_s_fmt_vid_cap_mplane(struct file *file, void *priv,
                        mfc_err_ctx("[OTF] only H.264 and HEVC is supported\n");
                        return -EINVAL;
                }
-               if (mfc_otf_init(ctx)) {
+               ret = mfc_otf_init(ctx);
+               if (ret) {
                        mfc_err_ctx("[OTF] otf_init failed\n");
                        mfc_otf_destroy(ctx);
+                       /* This should be no error return when VTS test case */
+                       if (ret == -EFAULT)
+                               return 0;
                        return -EINVAL;
                }
        }
index c75d05be88cb517a7ba6cf3956cbd2e2ec94b42e..e0d232637422a9c7bb724ce7a0305f76012e8871 100644 (file)
@@ -185,7 +185,7 @@ static int __mfc_otf_init_hwfc_buf(struct mfc_ctx *ctx)
        /* request buffers */
        if (hwfc_request_buffer(shared_buf_info, 1)) {
                mfc_err_dev("[OTF] request_buffer failed\n");
-               return -EINVAL;
+               return -EFAULT;
        }
 #endif
        mfc_debug(2, "[OTF] recieved buffer information\n");
@@ -310,6 +310,8 @@ void mfc_otf_destroy(struct mfc_ctx *ctx)
 
 int mfc_otf_init(struct mfc_ctx *ctx)
 {
+       int ret;
+
        mfc_debug_enter();
 
        if (!ctx) {
@@ -322,9 +324,10 @@ int mfc_otf_init(struct mfc_ctx *ctx)
                return -EINVAL;
        }
 
-       if (__mfc_otf_init_hwfc_buf(ctx)) {
+       ret = __mfc_otf_init_hwfc_buf(ctx);
+       if (ret) {
                mfc_err_dev("[OTF] HWFC init failed\n");
-               return -EINVAL;
+               return ret;
        }
 
        mfc_debug(2, "[OTF] otf_init is completed\n");