<div dir="ltr">Thank you Yunfei for following up with this change. <div><br></div><div>This change is the last missing piece to enable VD on Kukui with Chromium. </div><div>This patch fixed the corruption we were seeing on Kukui with certain tests.</div><div><br></div><div>One comment from me is just to use defined macro or variable instead of hard coding 64. </div><div><br></div><div>"User get width and height are 64 align when set format."<br></div><div><br></div><div>This sentence might need to be reworded. It is not clear to me. </div><div><br></div><div>Maybe something like "Width and height need to be 64 bytes aligned when setting the format."<br></div><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 Fri, Oct 29, 2021 at 2:45 AM Yunfei Dong <<a href="mailto:yunfei.dong@mediatek.com">yunfei.dong@mediatek.com</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">User get width and height are 64 align when set format. Need to make<br>
sure all is 64 align when use width and height to 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>
---<br>
drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<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 946c23088308..28c17204f9a1 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, 64);<br>
+ ctx->picinfo.buf_h = ALIGN(ctx->picinfo.pic_h, 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>
2.25.1<br>
<br>
</blockquote></div>