[PATCH v1] media: mtk-vcodec: Align width and height to 64

Steve Cho stevecho at google.com
Tue Nov 2 16:43:29 UTC 2021


Thank you Yunfei for following up with this change.

This change is the last missing piece to enable VD on Kukui with Chromium.
This patch fixed the corruption we were seeing on Kukui with certain tests.

One comment from me is just to use defined macro or variable instead of
hard coding 64.

"User get width and height are 64 align when set format."

This sentence might need to be reworded. It is not clear to me.

Maybe something like "Width and height need to be 64 bytes aligned when
setting the format."

Thanks,
Steve

On Fri, Oct 29, 2021 at 2:45 AM Yunfei Dong <yunfei.dong at mediatek.com>
wrote:

> User get width and height are 64 align when set format. Need to make
> sure all is 64 align when use width and height to calculate buffer size.
>
> Signed-off-by: Yunfei Dong <yunfei.dong at mediatek.com>
> ---
>  drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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
> index 946c23088308..28c17204f9a1 100644
> --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c
> +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c
> @@ -562,8 +562,8 @@ static void get_pic_info(struct vdec_h264_slice_inst
> *inst,
>  {
>         struct mtk_vcodec_ctx *ctx = inst->ctx;
>
> -       ctx->picinfo.buf_w = (ctx->picinfo.pic_w + 15) & 0xFFFFFFF0;
> -       ctx->picinfo.buf_h = (ctx->picinfo.pic_h + 31) & 0xFFFFFFE0;
> +       ctx->picinfo.buf_w = ALIGN(ctx->picinfo.pic_w, 64);
> +       ctx->picinfo.buf_h = ALIGN(ctx->picinfo.pic_h, 64);
>         ctx->picinfo.fb_sz[0] = ctx->picinfo.buf_w * ctx->picinfo.buf_h;
>         ctx->picinfo.fb_sz[1] = ctx->picinfo.fb_sz[0] >> 1;
>         inst->vsi_ctx.dec.cap_num_planes =
> --
> 2.25.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20211102/a11cb492/attachment.htm>


More information about the dri-devel mailing list