From 697f359204eff68801f5c988486cc17431301631 Mon Sep 17 00:00:00 2001 From: Sunyoung Kang Date: Fri, 17 Aug 2018 15:01:01 +0900 Subject: [PATCH] [COMMON] media: mfc: no error return when otf init fail 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 --- drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c | 6 +++++- drivers/media/platform/exynos/mfc/mfc_otf.c | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c b/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c index 26d3d09297ae..c639ba5b9191 100644 --- a/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c +++ b/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c @@ -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; } } diff --git a/drivers/media/platform/exynos/mfc/mfc_otf.c b/drivers/media/platform/exynos/mfc/mfc_otf.c index c75d05be88cb..e0d232637422 100644 --- a/drivers/media/platform/exynos/mfc/mfc_otf.c +++ b/drivers/media/platform/exynos/mfc/mfc_otf.c @@ -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"); -- 2.20.1