Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp762604pxb; Wed, 29 Sep 2021 09:10:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQEzPw62n1OEsV+Ccd5E7RR5mZM8ZbiZtnojGBl1iYxvywvOa+lHOp4+dqBz6s+JaUMxrS X-Received: by 2002:a17:902:904b:b0:13d:c33b:294f with SMTP id w11-20020a170902904b00b0013dc33b294fmr694951plz.35.1632931830019; Wed, 29 Sep 2021 09:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632931830; cv=none; d=google.com; s=arc-20160816; b=oi+xa3dXjOJ9on3PwlaAwhF5m2o0rP6LgUJZlGZ9E9spXawm5cxMkSnZ1UGBzziNSw MJC0U23IrRUY1fHByIhfU822Yeo/L8NhoHtArmKT3nuSglglrATaJ28RLzxY2JmYwOj4 WD1+fUu/Ulli3ZdrPjJzTnS+sc+XUg0So6ZniDqdHb0ipJKX3wzDDFYt0ZwQAnhJIDvR AjKg+Mu2ra2FeQZArzxqVwEkkvKzB7cIDQbciZPL9rQtHTAMRsrpuTusIetn8VcKZNKa 10jj/Boq4br04gzKeg9tgPX2zhT8rAyy24TfwLxRVAA4sqcyhBNFa5a+D8CnzE3r7AoN 6hyA== 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=zU9buPmO2TX8k71N24uclXQCXHmoG0vT8IIw19TVCDgLwf5jftrzHkjOoyeuR042sp 6bcQvoBEuEpzegW35u3fPSIM17wQP6TW8AR+Zn3yl6NARK0X1Zu19hiKHJVPlFemic/q Xss/Kee529UYwfrtlce/nJ1RIu6UYACNnoic6CFjm0x3EGGnza1aRfw/TK3VTRg7R1/F atXxEhqhICq2Yvk+3FZb0aoAVRkZsQbDPSeHl6sdzTOGYG8ZonP0aKo9JWjcqyYgdhce kd2mXbRFcO3/S48UO2VLVcLpG6eFfhLdL3UZ451gFdEasbkA0TrK6RuYjDJXbZ7L1uwA pLpA== 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 w1si346777plk.70.2021.09.29.09.10.16; Wed, 29 Sep 2021 09:10: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 S1345954AbhI2QIA (ORCPT + 99 others); Wed, 29 Sep 2021 12:08:00 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51320 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345719AbhI2QGa (ORCPT ); Wed, 29 Sep 2021 12:06:30 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 6ACC71F4466C 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 v7 01/11] hantro: postproc: Fix motion vector space size Date: Wed, 29 Sep 2021 18:04:29 +0200 Message-Id: <20210929160439.6601-2-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210929160439.6601-1-andrzej.p@collabora.com> References: <20210929160439.6601-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