From: Kamil Debski Date: Wed, 2 Apr 2014 09:08:37 +0000 (+0200) Subject: s5p-mfc: Fix the calculation of DPB size for non H264 video X-Git-Tag: submit/tizen/20141121.110247~529 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20d72d76af1d0c607d5ec2383244f36154f7042f;p=platform%2Fkernel%2Flinux-3.10.git 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 --- 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 58ec7bb..bfaad2c 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);