From nobody Sun Dec 14 06:16:23 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3582C00140 for ; Mon, 15 Aug 2022 18:59:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244854AbiHOS7Y (ORCPT ); Mon, 15 Aug 2022 14:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244937AbiHOS4U (ORCPT ); Mon, 15 Aug 2022 14:56:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 452C964FD; Mon, 15 Aug 2022 11:30:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5C0160F9F; Mon, 15 Aug 2022 18:30:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1A1BC433D6; Mon, 15 Aug 2022 18:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588246; bh=QPTfQKqh2f76lb3mUBMoomoHcK9nZi9n8RF13z/wN6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HEDElQGt+prNOtlc0t8DjCOE8niGMB49FzBD+8NHY5TKUFRoxm4qRAlcKNONgDDZ9 BgN+sIEOmwd3YZZLHoXmz92mh/jwme12xwr5HGmac2C28jhs/KqpGHbwBPV2hdw2qj YICGHXhpejnRMIrAB8rCq1Wo69mTzlvPBxVFtq7o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ezequiel Garcia , Andrzej Pietrasiewicz , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.15 342/779] media: hantro: postproc: Fix motion vector space size Date: Mon, 15 Aug 2022 19:59:46 +0200 Message-Id: <20220815180351.888932267@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Ezequiel Garcia [ Upstream commit 9393761aec4c56b7f2f19d21f806d316731401c1 ] When the post-processor hardware block is enabled, the driver allocates an internal queue of buffers for the decoder enginer, and uses the vb2 queue for the post-processor engine. For instance, on a G1 core, the decoder engine produces NV12 buffers and the post-processor engine can produce YUY2 buffers. The decoder engine expects motion vectors to be appended to the NV12 buffers, but this is only required for CODECs that need motion vectors, such as H.264. Fix the post-processor logic accordingly. Signed-off-by: Ezequiel Garcia Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/hantro/hantro_postproc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/stagi= ng/media/hantro/hantro_postproc.c index ed8916c950a4..07842152003f 100644 --- a/drivers/staging/media/hantro/hantro_postproc.c +++ b/drivers/staging/media/hantro/hantro_postproc.c @@ -132,9 +132,10 @@ int hantro_postproc_alloc(struct hantro_ctx *ctx) unsigned int num_buffers =3D cap_queue->num_buffers; unsigned int i, buf_size; =20 - buf_size =3D ctx->dst_fmt.plane_fmt[0].sizeimage + - hantro_h264_mv_size(ctx->dst_fmt.width, - ctx->dst_fmt.height); + buf_size =3D ctx->dst_fmt.plane_fmt[0].sizeimage; + if (ctx->vpu_src_fmt->fourcc =3D=3D V4L2_PIX_FMT_H264_SLICE) + buf_size +=3D hantro_h264_mv_size(ctx->dst_fmt.width, + ctx->dst_fmt.height); =20 for (i =3D 0; i < num_buffers; ++i) { struct hantro_aux_buf *priv =3D &ctx->postproc.dec_q[i]; --=20 2.35.1