Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2879914rwb; Mon, 15 Aug 2022 13:11:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hZarSQ+kvrFT8G6HH9Kf5clqc9PSdrpdukFOrk87aPFAXm3xkT/43REooUqIU296U+R0n X-Received: by 2002:aa7:c7da:0:b0:440:d482:36b5 with SMTP id o26-20020aa7c7da000000b00440d48236b5mr16148555eds.21.1660594274806; Mon, 15 Aug 2022 13:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594274; cv=none; d=google.com; s=arc-20160816; b=BNBnE5zcHdh/765BVJuI/153CpOzdJRMAyd/8LYaIQirHhcG8h66+63zVmaGBoEY8t tDnC/65Afg1q6L0beEhhS5tW9k5PyvO5PQV5qxU3pcI69AAAoDjHT2QbKItckn5WM+wt JC0qEpM6hHDrUL3FAESpqpLbbHYPZ6MEmqptlZySILqpLzjIuAKq5nYFjr2wADUqz/ua /kFeudRq8OerRwhFZ92VaUJAVr30xhAv+RMY1gnqL3pAPVRPlLX1+bMwndUu5+KniJvu 5KUNVSNw14EX4zicvB/86cPHnPUQfZUQmYJFGUplSkKenY/xPTnEQ9f/J8yfYX0lUJrP hUHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ehduPiY2DEyPaJVf5MZ/C+BymaCc8LhZpMTFtltyU6w=; b=dNXyveu38uLzydwHAiGMSg7hQPj8x5SzTvr1O4aqP9KHBqDdw+qN8bGx9DQGbNWqqB YJN98sdkSaniE43NeMu0Dw+dvwvWl9tuX+tO10Lh1YLt2mrsq0DN7eLGdfNfK2JbgEtX LFrpX0NM3d09d5l3Uk6eiFLsUN3ctjczf3iKT8rLeI8qG/CBQpu+owdxOKZ71lpnxXfP 6RCodyHQ17m1wOiI3LGtvu9Cp6c2HzJHU/+DzJWvrMIipNLAjzCZf+4jNHwtXteCTIUk e5Ezmw9Lc8Cbxj4u4suRtl+7bOeTC9OZzHwiQKiQePCXMT8ZGu8FPgHiykYcvwt5NeFw lB6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HEDElQGt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020aa7c944000000b0043d64c59b10si7843186edt.94.2022.08.15.13.10.49; Mon, 15 Aug 2022 13:11:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HEDElQGt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244846AbiHOS7X (ORCPT + 99 others); Mon, 15 Aug 2022 14:59:23 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/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.35.1