<div dir="ltr"><div>Thank you Yunfei for the update. Looks good to me. </div><div>As mentioned earlier, I tested to verify that this fix resolved the corruption issue on Kukui.</div><div><br></div>Tested-by: Steve Cho <<a href="mailto:stevecho@chromium.org">stevecho@chromium.org</a>><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Thanks,<div>Steve</div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 3, 2021 at 8:23 AM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le mercredi 03 novembre 2021 à 11:37 +0800, Yunfei Dong a écrit :<br>
> Width and height need to 64 bytes aligned when setting the format.<br>
> Need to make sure all is 64 bytes align when use width and height to<br>
> calculate buffer size.<br>
> <br>
> Signed-off-by: Yunfei Dong <<a href="mailto:yunfei.dong@mediatek.com" target="_blank">yunfei.dong@mediatek.com</a>><br>
> Change-Id: I39886b1a6b433c92565ddbf297eb193456eec1d2<br>
<br>
Perhaps avoid this tag later ? Another perhaps, there is a tag to indicate which<br>
patch introduce that bug, if you add this tag, the patch will be automatically<br>
backported into relevant stable kernel. The format is:<br>
<br>
> Fixes: <short-hash> ("<short commit description")<br>
<br>
Acked-by: Nicolas Dufresne <<a href="mailto:nicolas.dufresne@collabora.com" target="_blank">nicolas.dufresne@collabora.com</a>><br>
<br>
> ---<br>
> drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h | 1 +<br>
> drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c | 4 ++--<br>
> 2 files changed, 3 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h<br>
> index e30806c1faea..66cd6d2242c3 100644<br>
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h<br>
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h<br>
> @@ -11,6 +11,7 @@<br>
> #include <media/videobuf2-core.h><br>
> #include <media/v4l2-mem2mem.h><br>
> <br>
> +#define VCODEC_DEC_ALIGNED_64 64<br>
> #define VCODEC_CAPABILITY_4K_DISABLED 0x10<br>
> #define VCODEC_DEC_4K_CODED_WIDTH 4096U<br>
> #define VCODEC_DEC_4K_CODED_HEIGHT 2304U<br>
> diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c<br>
> index d402fc4bda69..e1a3011772a9 100644<br>
> --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c<br>
> +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c<br>
> @@ -562,8 +562,8 @@ static void get_pic_info(struct vdec_h264_slice_inst *inst,<br>
> {<br>
> struct mtk_vcodec_ctx *ctx = inst->ctx;<br>
> <br>
> - ctx->picinfo.buf_w = (ctx->picinfo.pic_w + 15) & 0xFFFFFFF0;<br>
> - ctx->picinfo.buf_h = (ctx->picinfo.pic_h + 31) & 0xFFFFFFE0;<br>
> + ctx->picinfo.buf_w = ALIGN(ctx->picinfo.pic_w, VCODEC_DEC_ALIGNED_64);<br>
> + ctx->picinfo.buf_h = ALIGN(ctx->picinfo.pic_h, VCODEC_DEC_ALIGNED_64);<br>
> ctx->picinfo.fb_sz[0] = ctx->picinfo.buf_w * ctx->picinfo.buf_h;<br>
> ctx->picinfo.fb_sz[1] = ctx->picinfo.fb_sz[0] >> 1;<br>
> inst->vsi_ctx.dec.cap_num_planes =<br>
<br>
</blockquote></div>