From ad813072e668f5139eaeb0782f26b8dde1c982fe Mon Sep 17 00:00:00 2001 From: Sunyoung Kang Date: Wed, 24 Jan 2018 14:57:13 +0900 Subject: [PATCH] media: mfc: clear ROI_ENABLE when SEQ_DONE When HEVC encoding, the ROI is enabled at SEQ_START. This adds to clear the ROI_ENABLE bit at SEQ_DONE. Change-Id: If2ce5b25913915edbb8a7860232bdd71eeb028ba Signed-off-by: Sunyoung Kang --- drivers/media/platform/exynos/mfc/s5p_mfc_irq.c | 3 +++ drivers/media/platform/exynos/mfc/s5p_mfc_reg.h | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index 19325d0c4782..0e4c91d548f2 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -1170,6 +1170,9 @@ static int mfc_handle_seq_enc(struct s5p_mfc_ctx *ctx) ctx->dpb_count = s5p_mfc_get_enc_dpb_count(); ctx->scratch_buf_size = s5p_mfc_get_enc_scratch_size(); + /* If the ROI is enabled at SEQ_START, clear ROI_ENABLE bit */ + s5p_mfc_clear_roi_enable(dev); + ret = s5p_mfc_alloc_codec_buffers(ctx); if (ret) { mfc_err_ctx("Failed to allocate encoding buffers.\n"); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.h b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.h index f8b18c0cd62c..d8700bb91a80 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.h +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.h @@ -224,6 +224,15 @@ static inline void s5p_mfc_clear_enc_res_change(struct s5p_mfc_dev *dev) MFC_WRITEL(reg, S5P_FIMV_E_PARAM_CHANGE); } +static inline void s5p_mfc_clear_roi_enable(struct s5p_mfc_dev *dev) +{ + unsigned int reg = 0; + + reg = MFC_READL(S5P_FIMV_E_RC_ROI_CTRL); + reg &= ~(0x1); + MFC_WRITEL(reg, S5P_FIMV_E_RC_ROI_CTRL); +} + void s5p_mfc_dbg_enable(struct s5p_mfc_dev *dev); void s5p_mfc_dbg_disable(struct s5p_mfc_dev *dev); void s5p_mfc_dbg_set_addr(struct s5p_mfc_dev *dev); -- 2.20.1