From f3bd044e06c938627e2b1b75c8388ba4a081cbfb Mon Sep 17 00:00:00 2001 From: Kamil Debski Date: Wed, 2 Apr 2014 11:08:37 +0200 Subject: [PATCH] s5p-mfc: Fix the calculation of DPB size for non H264 video Image size was used instead of the buffer size which resulted in a smaller than necessary buffer allocation. Change-Id: Ia457957cf8e2777e01c3d9f18216156b0dce4856 Signed-off-by: Kamil Debski --- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c index 368582b..ae70a92 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c @@ -288,7 +288,7 @@ static void s5p_mfc_dec_calc_dpb_size_v5(struct s5p_mfc_ctx *ctx) ctx->luma_size = ALIGN(ctx->buf_width * ctx->buf_height, S5P_FIMV_DEC_BUF_ALIGN); ctx->chroma_size = ALIGN(ctx->buf_width * - ALIGN((ctx->img_height >> 1), + ALIGN((ctx->buf_height >> 1), S5P_FIMV_NV12MT_VALIGN), S5P_FIMV_DEC_BUF_ALIGN); ctx->mv_size = ALIGN(ctx->buf_width * @@ -297,16 +297,16 @@ static void s5p_mfc_dec_calc_dpb_size_v5(struct s5p_mfc_ctx *ctx) S5P_FIMV_DEC_BUF_ALIGN); } else { guard_width = - ALIGN(ctx->img_width + 24, S5P_FIMV_NV12MT_HALIGN); + ALIGN(ctx->buf_width + 24, S5P_FIMV_NV12MT_HALIGN); guard_height = - ALIGN(ctx->img_height + 16, S5P_FIMV_NV12MT_VALIGN); + ALIGN(ctx->buf_height + 16, S5P_FIMV_NV12MT_VALIGN); ctx->luma_size = ALIGN(guard_width * guard_height, S5P_FIMV_DEC_BUF_ALIGN); guard_width = - ALIGN(ctx->img_width + 16, S5P_FIMV_NV12MT_HALIGN); + ALIGN(ctx->buf_width + 16, S5P_FIMV_NV12MT_HALIGN); guard_height = - ALIGN((ctx->img_height >> 1) + 4, + ALIGN((ctx->buf_height >> 1) + 4, S5P_FIMV_NV12MT_VALIGN); ctx->chroma_size = ALIGN(guard_width * guard_height, S5P_FIMV_DEC_BUF_ALIGN); -- 2.7.4