From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70E99C433F5 for ; Fri, 29 Oct 2021 09:46:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39D3C610A0 for ; Fri, 29 Oct 2021 09:46:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 39D3C610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3XPw+ZXqkc50GIUodL8xS6WKQ/JTwkq2qSTlAC/BPGc=; b=kv5XPLP8ELYerU TOGIMpMwYVZQLBeJFyz2ko5jITr0OIevo2bo47GsDMVK7C7keIw2vfXWFL1V9exPMViz5BxtfYNKk hfPs8/HqUpfyHdYe9njkY4iy8gyOGdaMf/+1b0/lusTxTGk86viaYdhzOgEP9/8/+tYY7zD68fVGE i+zhslDPBmCSR0sf5DCNViQd5akhtpQ02ymmTdpYn+amsRNou9Fpq5VnFbX6+nuo4Kg4BaKEnKHxz A+yNzJHvO5xoF8Oc5B0E15AovybDrlGk5xlCzmoITztprzLUAE6Fz4/tEROGmuOttAUN6zRYmvt8k PcjkqMDHs4YBg1ycR7Zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgORt-00AWoh-3D; Fri, 29 Oct 2021 09:45:21 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgORp-00AWnz-DJ; Fri, 29 Oct 2021 09:45:18 +0000 X-UUID: f6164bb9d5bd4cdc925ba6c88ba109e1-20211029 X-UUID: f6164bb9d5bd4cdc925ba6c88ba109e1-20211029 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1517124478; Fri, 29 Oct 2021 02:45:16 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 29 Oct 2021 02:45:14 -0700 Received: from mtkmbs10n2.mediatek.inc (172.21.101.183) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 29 Oct 2021 17:45:12 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs10n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.3 via Frontend Transport; Fri, 29 Oct 2021 17:45:11 +0800 From: Yunfei Dong To: Yunfei Dong , Alexandre Courbot , Hans Verkuil , "Tzung-Bi Shih" , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: Hsin-Yi Wang , Fritz Koenig , Dafna Hirschfeld , Benjamin Gaignard , Daniel Vetter , dri-devel , Irui Wang , , , , , , , Subject: [PATCH v1] media: mtk-vcodec: Align width and height to 64 Date: Fri, 29 Oct 2021 17:45:10 +0800 Message-ID: <20211029094510.2411-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_024517_475508_4BD88468 X-CRM114-Status: GOOD ( 12.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel