From 7a7318d9e4a0672c69426457ced9bf8560bed9eb Mon Sep 17 00:00:00 2001 From: Jeonghee Kim Date: Thu, 29 Mar 2018 18:43:31 +0900 Subject: [PATCH] media: mfc: OTF: Initialize after F/W allocation Change-Id: Idd526d9a85aab06cb46a8ad0fece1a0a486e6f43 Signed-off-by: Jeonghee Kim --- drivers/media/platform/exynos/mfc/s5p_mfc.c | 14 +++++++++----- drivers/media/platform/exynos/mfc/s5p_mfc_otf.c | 2 -- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc.c b/drivers/media/platform/exynos/mfc/s5p_mfc.c index e753cd3deff6..3eadb229fa53 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc.c @@ -514,11 +514,6 @@ static int s5p_mfc_open(struct file *file) if (ret) goto err_ctx_init; - if (s5p_mfc_is_encoder_otf_node(node)) - ret = s5p_mfc_otf_init(ctx); - if (ret) - mfc_err_ctx("OTF: failed otf init\n"); - ret = call_cop(ctx, init_ctx_ctrls, ctx); if (ret) { mfc_err_ctx("failed in init_ctx_ctrls\n"); @@ -562,6 +557,13 @@ static int s5p_mfc_open(struct file *file) goto err_init_inst; } +#ifdef CONFIG_VIDEO_EXYNOS_REPEATER + if (s5p_mfc_is_encoder_otf_node(node)) + ret = s5p_mfc_otf_init(ctx); + if (ret) + mfc_err_ctx("OTF: failed otf init\n"); +#endif + s5p_mfc_perf_init(dev); trace_mfc_node_open(ctx->num, dev->num_inst, ctx->type, ctx->is_drm); mfc_info_ctx("MFC open completed [%d:%d] dev = 0x%p, ctx = 0x%p, version = %d\n", @@ -750,8 +752,10 @@ static int s5p_mfc_release(struct file *file) else if (ctx->type == MFCINST_ENCODER) mfc_deinit_enc_ctx(ctx); +#ifdef CONFIG_VIDEO_EXYNOS_REPEATER if (ctx->otf_handle) s5p_mfc_otf_deinit(ctx); +#endif s5p_mfc_destroy_listable_wq_ctx(ctx); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c index 23096d98c005..c5be3770fbf6 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c @@ -515,8 +515,6 @@ int s5p_mfc_otf_handle_stream(struct s5p_mfc_ctx *ctx) debug->frame_cnt = 0; /* print stream dump */ print_size = (strm_size * 2) + 64; - if (print_size > 512 && otf_dump == 1) - print_size = 512; if (buf->vaddr) print_hex_dump(KERN_ERR, "OTF dump: ", -- 2.20.1