From bb77c9412f65cdbbadf8e814220ffff582c3527f Mon Sep 17 00:00:00 2001 From: Ayoung Sim Date: Thu, 19 Apr 2018 10:11:17 +0900 Subject: [PATCH] media: mfc: DRV4.0: remove unnecessary status Change-Id: I6230ad09e3a6fb82b5fb6224d976a1ae541b0177 Signed-off-by: Ayoung Sim --- .../media/platform/exynos/mfc/s5p_mfc_data_struct.h | 2 +- drivers/media/platform/exynos/mfc/s5p_mfc_enc.c | 5 +---- drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c | 1 - drivers/media/platform/exynos/mfc/s5p_mfc_irq.c | 9 +++------ drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c | 11 +++++------ drivers/media/platform/exynos/mfc/s5p_mfc_sync.c | 5 ----- 6 files changed, 10 insertions(+), 23 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h index 1babde221282..af7a254bc8f1 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h @@ -102,7 +102,7 @@ enum s5p_mfc_inst_state { MFCINST_RES_CHANGE_INIT, MFCINST_RES_CHANGE_FLUSH, MFCINST_RES_CHANGE_END, - MFCINST_RUNNING_NO_OUTPUT, + MFCINST_RUNNING_NO_OUTPUT, // Unused MFCINST_ABORT_INST, MFCINST_DPB_FLUSHING, MFCINST_SPECIAL_PARSING, diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c b/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c index 8dcaac61c0ea..ee4567ef8d78 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c @@ -849,10 +849,7 @@ static int mfc_enc_get_ctrl_val(struct s5p_mfc_ctx *ctx, struct v4l2_control *ct ctrl->value = enc->frame_type; break; case V4L2_CID_MPEG_MFC51_VIDEO_CHECK_STATE: - if (ctx->state == MFCINST_RUNNING_NO_OUTPUT) - ctrl->value = MFCSTATE_ENC_NO_OUTPUT; - else - ctrl->value = MFCSTATE_PROCESSING; + ctrl->value = MFCSTATE_PROCESSING; break; case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_TAG: case V4L2_CID_MPEG_MFC51_VIDEO_LUMA_ADDR: diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c b/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c index d609c3b4c712..d4e394f06113 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c @@ -790,7 +790,6 @@ static int mfc_just_run_enc(struct s5p_mfc_ctx *ctx) ret = s5p_mfc_run_enc_last_frames(ctx); break; case MFCINST_RUNNING: - case MFCINST_RUNNING_NO_OUTPUT: if (ctx->otf_handle) { ret = s5p_mfc_otf_run_enc_frame(ctx); break; diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index f6db2937aeb1..61cd0bf355c5 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -755,10 +755,6 @@ static void mfc_handle_stream_input(struct s5p_mfc_ctx *ctx) raw = &ctx->raw_buf; - if (ctx->state == MFCINST_RUNNING_NO_OUTPUT || - ctx->state == MFCINST_RUNNING_BUF_FULL) - s5p_mfc_change_state(ctx, MFCINST_RUNNING); - s5p_mfc_get_enc_frame_buffer(ctx, &enc_addr[0], raw->num_planes); if (enc_addr[0] == 0) { mfc_debug(3, "no encoded src\n"); @@ -925,6 +921,8 @@ static int mfc_handle_stream(struct s5p_mfc_ctx *ctx) s5p_mfc_change_state(ctx, MFCINST_ABORT_INST); return 0; } + if (ctx->state == MFCINST_RUNNING_BUF_FULL) + s5p_mfc_change_state(ctx, MFCINST_RUNNING); /* set encoded frame type */ enc->frame_type = slice_type; @@ -1378,8 +1376,7 @@ static int mfc_irq_ctx(struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned in break; } /* An error has occured */ - if (ctx->state == MFCINST_RUNNING || ctx->state == MFCINST_ABORT || - ctx->state == MFCINST_RUNNING_NO_OUTPUT) { + if (ctx->state == MFCINST_RUNNING || ctx->state == MFCINST_ABORT) { if ((s5p_mfc_get_err(err) >= S5P_FIMV_ERR_WARNINGS_START) && (s5p_mfc_get_err(err) <= S5P_FIMV_ERR_WARNINGS_END)) mfc_handle_frame(ctx, reason, err); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c index 05e1dd851879..dbe2ac832343 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -53,8 +53,7 @@ int s5p_mfc_nal_q_check_enable(struct s5p_mfc_dev *dev) return 0; } /* NAL-Q can be enabled when all ctx are in running state */ - if (temp_ctx->state != MFCINST_RUNNING && - temp_ctx->state != MFCINST_RUNNING_NO_OUTPUT) { + if (temp_ctx->state != MFCINST_RUNNING) { mfc_debug(2, "There is a ctx which is not in running state. " "index: %d, state: %d\n", i, temp_ctx->state); return 0; @@ -908,10 +907,6 @@ static void mfc_nal_q_handle_stream_input(struct s5p_mfc_ctx *ctx, EncoderOutput raw = &ctx->raw_buf; - if (ctx->state == MFCINST_RUNNING_NO_OUTPUT || - ctx->state == MFCINST_RUNNING_BUF_FULL) - ctx->state = MFCINST_RUNNING; - mfc_nal_q_get_enc_frame_buffer(ctx, &enc_addr[0], raw->num_planes, pOutStr); if (enc_addr[0] == 0) { mfc_debug(3, "NAL Q: no encoded src\n"); @@ -1064,6 +1059,10 @@ static void mfc_nal_q_handle_stream(struct s5p_mfc_ctx *ctx, EncoderOutputStr *p mfc_debug(2, "NAL Q: encoded stream size: %d\n", strm_size); mfc_debug(2, "NAL Q: display order: %d\n", pic_count); + /* buffer full handling */ + if (ctx->state == MFCINST_RUNNING_BUF_FULL) + ctx->state = MFCINST_RUNNING; + /* set encoded frame type */ enc->frame_type = slice_type; ctx->sequence++; diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_sync.c b/drivers/media/platform/exynos/mfc/s5p_mfc_sync.c index f318517b0ebf..762bfb8597c7 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_sync.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_sync.c @@ -315,11 +315,6 @@ int s5p_mfc_enc_ctx_ready(struct s5p_mfc_ctx *ctx) src_buf_queue_greater_than_0 && dst_buf_queue_greater_than_0) return 1; - /* context is ready to encode a frame in case of B frame */ - if (ctx->state == MFCINST_RUNNING_NO_OUTPUT && - src_buf_queue_greater_than_0 && dst_buf_queue_greater_than_0) - return 1; - /* context is ready to encode a frame for NAL_ABORT command */ if (ctx->state == MFCINST_ABORT_INST && src_buf_queue_greater_than_0 && dst_buf_queue_greater_than_0) -- 2.20.1