<div dir="ltr">Thank you Dafna for providing the feedback. <div><br></div><div>Yes, I agree that ALIGN(x, 64) is clear enough. </div><div><div>I forgot the history, but I think it was probably one of my comment before. <br></div><div>For this case, it is also only used in one place, so not much benefit in that sense as well.</div><div>(Unless it is planned to be used in many other places.)</div><div><br></div><div>Yunfei, either way is fine with me. </div><div>Wasn't this change was already merged in media stage though?</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Thanks,<div>Steve</div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 21, 2021 at 11:11 PM Dafna Hirschfeld <<a href="mailto:dafna.hirschfeld@collabora.com">dafna.hirschfeld@collabora.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"><br>
<br>
On 04.11.21 14:24, Yunfei Dong wrote:<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>
> Acked-by: Nicolas Dufresne <<a href="mailto:nicolas.dufresne@collabora.com" target="_blank">nicolas.dufresne@collabora.com</a>><br>
> Tested-by: Steve Cho <<a href="mailto:stevecho@chromium.org" target="_blank">stevecho@chromium.org</a>><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>
<br>
This define is a bit useless, it doesn't improve readability,<br>
if you do ALIGN(x, 64) it is already clear enough.<br>
<br>
Thank,<br>
Dafna<br>
<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>