Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4049604pxb; Mon, 27 Sep 2021 08:21:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt3TdowCFDCAJ/tiz84GsMotmXHD1KFwGaqzTacGi2TzjnodKT9/JLYoqknYBjwquVb42Z X-Received: by 2002:a17:902:ecd2:b0:13e:17c4:ce08 with SMTP id a18-20020a170902ecd200b0013e17c4ce08mr419027plh.67.1632756090587; Mon, 27 Sep 2021 08:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632756090; cv=none; d=google.com; s=arc-20160816; b=i/D2bIA30KuK6q2B09nSPlTCTIMWr3CwR6afLGB+31MY02DMQqiIQgvjAYglmsnKq7 YcgvG42WB0kYePNFwuOAe+vJz4fnNqbVIfeW1c+MWG7uMNeCKIwbLFkZxyxcf0Nw9YjC vP/XQXWuGIswwJnqaJoZlFg9hUdt3mJMU260qj0EYw8izH62i70aQp+yfN+jLlE9GX5i Xw6bmmz+3ZOZ0qWsEse7FOJoT8s1dv7uB4tgT6lAWoMcQOXtlRNeSR0aDFu3glanqvnb CK3a2qKwxo0+XZQYrmwNK8ZtbJkbDK0eykwr7bY34VB0w4hyMDynXXBRo9pxsIg6k3Y4 OkAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=Ab/SC6Z3XAO3VBIL4rFOhLh8JgDhej7D+kFn7DxV16M=; b=Ea7G7EOj+TSkQTM/vR2Ko63KIWr9T5tsANViFTgVbBIi+qdBdFZxczK8JFBJNeJKcC gQTN/Q6oLN7INPR0ZR0mZhiocyBpW3XHi3GVb/oKq3C0XH/9gLohy4AFtbBVTDFdJ0ob 9DZdDCJJOdriAa6vFkR+TdZ3Zd1oUWjZc5WvP9uwMkde8vwroBDVTjcyOwwtsVeJ+9bO e0uOcvfFIG3ZBOlfYYW7sfywqnga5f1q4OM0M5d3JwduUMBM5ZYRCpDi/YTeZdoax2W7 eZB53XnMZru4wEi1aMd1YG2gDJAxNXxrvMZ9uiTKszu4GSK3z7dANRGkuRs4c8pr+mSh G+Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si21116331plq.185.2021.09.27.08.21.14; Mon, 27 Sep 2021 08:21:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235149AbhI0PVu (ORCPT + 99 others); Mon, 27 Sep 2021 11:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234972AbhI0PVo (ORCPT ); Mon, 27 Sep 2021 11:21:44 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E544DC061714; Mon, 27 Sep 2021 08:20:06 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id A03EC1F42DB8 From: Andrzej Pietrasiewicz To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev Cc: Andrzej Pietrasiewicz , Benjamin Gaignard , Boris Brezillon , Ezequiel Garcia , Fabio Estevam , Greg Kroah-Hartman , Hans Verkuil , Heiko Stuebner , Jernej Skrabec , Mauro Carvalho Chehab , Nicolas Dufresne , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , kernel@collabora.com, Ezequiel Garcia Subject: [PATCH v6 01/10] hantro: postproc: Fix motion vector space size Date: Mon, 27 Sep 2021 17:19:49 +0200 Message-Id: <20210927151958.24426-2-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210927151958.24426-1-andrzej.p@collabora.com> References: <20210927151958.24426-1-andrzej.p@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ezequiel Garcia 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 --- 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/staging/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 = cap_queue->num_buffers; unsigned int i, buf_size; - buf_size = ctx->dst_fmt.plane_fmt[0].sizeimage + - hantro_h264_mv_size(ctx->dst_fmt.width, - ctx->dst_fmt.height); + buf_size = ctx->dst_fmt.plane_fmt[0].sizeimage; + if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_H264_SLICE) + buf_size += hantro_h264_mv_size(ctx->dst_fmt.width, + ctx->dst_fmt.height); for (i = 0; i < num_buffers; ++i) { struct hantro_aux_buf *priv = &ctx->postproc.dec_q[i]; -- 2.17.1