From: Jeonghee Kim Date: Tue, 9 Jan 2018 06:19:35 +0000 (+0900) Subject: media: mfc: NAL-Q: change work_bits handling. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b2148183e6372b72877eccdfaf2cf6f1afb63af;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git media: mfc: NAL-Q: change work_bits handling. Change-Id: I230fde8ab018e3968ef5f8e5e693cff129bb41ba Signed-off-by: Jeonghee Kim --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c b/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c index b31c2966cc77..83e5138bb2fd 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_hwlock.c @@ -669,24 +669,17 @@ static int mfc_nal_q_just_run(struct s5p_mfc_ctx *ctx, int need_cache_flush) mfc_info_ctx("NAL Q: start NAL QUEUE\n"); s5p_mfc_nal_q_start(dev, nal_q_handle); - if (s5p_mfc_nal_q_enqueue_in_buf(dev, ctx, nal_q_handle->nal_q_in_handle)) { + if (s5p_mfc_nal_q_enqueue_in_buf(dev, ctx, nal_q_handle->nal_q_in_handle)) mfc_debug(2, "NAL Q: Failed to enqueue input data\n"); - if (ctx->clear_work_bit) { - s5p_mfc_clear_bit(ctx->num, &dev->work_bits); - ctx->clear_work_bit = 0; - } - s5p_mfc_release_hwlock_ctx(ctx); - ret = 0; - break; - } - if (!nal_q_handle->nal_q_exception) - s5p_mfc_clear_bit(ctx->num, &dev->work_bits); + s5p_mfc_clear_bit(ctx->num, &dev->work_bits); + if ((s5p_mfc_ctx_ready(ctx) && !ctx->clear_work_bit) || + nal_q_handle->nal_q_exception) + s5p_mfc_set_bit(ctx->num, &dev->work_bits); + ctx->clear_work_bit = 0; s5p_mfc_release_hwlock_ctx(ctx); - if (s5p_mfc_ctx_ready(ctx)) - s5p_mfc_set_bit(ctx->num, &dev->work_bits); if (s5p_mfc_is_work_to_do(dev)) queue_work(dev->butler_wq, &dev->butler_work); @@ -711,24 +704,18 @@ static int mfc_nal_q_just_run(struct s5p_mfc_ctx *ctx, int need_cache_flush) break; } else { /* NAL QUEUE */ - if (s5p_mfc_nal_q_enqueue_in_buf(dev, ctx, nal_q_handle->nal_q_in_handle)) { + if (s5p_mfc_nal_q_enqueue_in_buf(dev, ctx, nal_q_handle->nal_q_in_handle)) mfc_debug(2, "NAL Q: Failed to enqueue input data\n"); - if (ctx->clear_work_bit) { - s5p_mfc_clear_bit(ctx->num, &dev->work_bits); - ctx->clear_work_bit = 0; - } - s5p_mfc_release_hwlock_ctx(ctx); - ret = 0; - break; - } - if (!nal_q_handle->nal_q_exception) - s5p_mfc_clear_bit(ctx->num, &dev->work_bits); + s5p_mfc_clear_bit(ctx->num, &dev->work_bits); + + if ((s5p_mfc_ctx_ready(ctx) && !ctx->clear_work_bit) || + nal_q_handle->nal_q_exception) + s5p_mfc_set_bit(ctx->num, &dev->work_bits); + ctx->clear_work_bit = 0; s5p_mfc_release_hwlock_ctx(ctx); - if (s5p_mfc_ctx_ready(ctx)) - s5p_mfc_set_bit(ctx->num, &dev->work_bits); if (s5p_mfc_is_work_to_do(dev)) queue_work(dev->butler_wq, &dev->butler_work); ret = 0;