Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp803266pxt; Thu, 5 Aug 2021 12:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsA9Jrz5h1aX97TokPDd1JG+8TD7ImrN6NFEecgw9E140mJyZoe2MVyRgPoNcoinou0wLf X-Received: by 2002:a17:907:766c:: with SMTP id kk12mr6114621ejc.525.1628190288430; Thu, 05 Aug 2021 12:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628190288; cv=none; d=google.com; s=arc-20160816; b=SdkxjN8nveZ+LJI/qCnmW7hLAOwiRc1nLTB723DcD2P8hO0R/c+o9Mks2+6aqrp/36 pwBMUzUD6qv1S0+56F/wSl6nl8PywI0Nh9TsFbLupzHHj1uo3P1J9GNVwqCX4NjpDZkS k1+7TUopZ/3dme+FEL+1C2ReeWBx4xDHa8+wgBdzMHnKr9+NcAaeRMmKCy675+v8HzrP VKw/YFt3+kY2NtIL5pt9SikMbfLpVTATB3N93NziB6el7BipPifo1Wy1DUBU0cJ1I95j SXDCv1wp76MqAcuaM22i6cWL7cjWb6My1E8IkFz+Mme7oX0KQ7gMOdsCSDqiFJ8Mz5o3 h6uQ== 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=rXMre6ZE9tSEQiyBVlvi4AwIkqBdxI8LiGASeuvFXIDT0lkSQ9tnOyU0Y/0ZQjQC1T S7v97s1ZHH81v7yZmGRjdxE8kr23I10A+jaApDlb2lqVcdxFsjPJAU5XNCAhQDm4EKYB e5e6xdU9apRrCj27ejL3fTQVdLN+GucSVxCNoYH/414Ok7SIFjzYD7kxkTcWf+Ju7F7A YyKJ22JwFebsvw1OS+evkTdHGoD6nRSz5sjKhl1GShx9Uvn44W6SFI0aeXmQBB05f+y/ 2AQGpuyFAmlcYynyW14apIXO1kTu+BXOZ3Z0Kh8W89jEzCtYG0oMaTGEwoGVR0Sf4v8x dclA== 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 bq1si6373448edb.286.2021.08.05.12.04.23; Thu, 05 Aug 2021 12:04:48 -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 S242039AbhHEOp4 (ORCPT + 99 others); Thu, 5 Aug 2021 10:45:56 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59054 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbhHEOnL (ORCPT ); Thu, 5 Aug 2021 10:43:11 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 93B6B1F44098 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 v3 01/10] hantro: postproc: Fix motion vector space size Date: Thu, 5 Aug 2021 16:42:37 +0200 Message-Id: <20210805144246.11998-2-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210805144246.11998-1-andrzej.p@collabora.com> References: <20210805144246.11998-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