From patchwork Thu Oct 19 12:51:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 155530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp360600vqb; Thu, 19 Oct 2023 05:56:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnOL7uNHrZ25Myd/n1f7g4IKYGE9GXS453Vkp6NORKnINCmUCMx5FHff63yG+qWwswK4TV X-Received: by 2002:a17:902:c409:b0:1c9:d0a0:ee73 with SMTP id k9-20020a170902c40900b001c9d0a0ee73mr2564015plk.5.1697720200300; Thu, 19 Oct 2023 05:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697720200; cv=none; d=google.com; s=arc-20160816; b=vrzx3mTUlUkd90u377ei77GwGVG7GO8dqLZ4f4h6DV1eHKPD7akD/nnREdpTz+xFwq CSkOF6Bro+OBGTopgDSai8rIf4ydZ16e/omGG8A4+2QZwy/JoYdYVcPbuYRx0zs7G9mU ILqqsieWnwWJIXWmYBgNJW5tILzob2OW/G34HKWabB0Ih3dLG6o2z1cyUGCQWXF0zJNd sp9Y1U/QhFiaTvFtnnSW9FGfSUtVBCPFdVatmAXVGjxo4GFd+87iMP8Kv3nja3GA5s0S sRqG6gUyhLpjb1lmBihJ/D0Qv+jzc8vvuOGccpeAliXet90Cz5NJftP2SI7TbHwbI3Id Z91w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=atK/kDvG1BdB1Ql0lxnu55jjgzpi7DAGGZ/ctT2lERg=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=dmVDmilx6QPVv7Uz6Se40IDq6I+k1vtTe4u179GdqcZlpQO8fTC/ZIUkebZp1JoO7n 9e2kmImUEtgDCh3ERQHujutPmm3pLO2x50GFd4N95FRJBaHfNfmDpPYFST9CoUDu9GHD 1Os6IBvkw0gomd9Fn5O0FupOygmVtSfnN/8mHOylrLMSy5D9ow0AOX5QNlunBPCK72Iq z7SwXfXCb5dwD3Sqhc203rTXleX10101aN53DxrUHQR/xF4qMj8pib1AGU5RBWkxvZvh 7Kce7RBiVm9k+zqMJ6CzTcDoS/bK+mf1n7YJ4GddYLj2RCfyPJ02iMB0I/MhtxGo6ub+ fYAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=HSmwO+lQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id h1-20020a170902704100b001bdc10170casi2107119plt.36.2023.10.19.05.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=HSmwO+lQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7B6EA809B08F; Thu, 19 Oct 2023 05:55:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346151AbjJSMyz (ORCPT + 25 others); Thu, 19 Oct 2023 08:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345854AbjJSMwt (ORCPT ); Thu, 19 Oct 2023 08:52:49 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9776918B; Thu, 19 Oct 2023 05:52:47 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:ccea:1fb5:34eb:239b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id C130E6607353; Thu, 19 Oct 2023 13:52:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697719966; bh=DdlxkRuWKO9j/krVAsdkWz62fUG/5l8klfwhgZtW1d4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HSmwO+lQblPR8KDUbpqa2qygt/1zm3WgO1xef1xo2yYTUsW967sElVKGpKbn5g5x1 oXfYaO1Mk9497DNfiSIuXmBMbS+PcZx6Gynsr/EpzUC+eteAavgeT1tfiKeIrhITJI 3CUdvGb0cn6btxoeVELLs4j/LldSSq+/CAn2/wwVT3oWLgwsC1TH+aiIBvjmC3qd/u 1zfRXU/jFUXbmX2vms3TwjYXjSiIK+LMkILHmTtNJM7OpFfmutaNmZ1WyWURzNNl6K c1lniwJ/O2u3pSU9F3vkK7pPMT1JzZ+bKTg8JKu88u1vP3XxiS3nB0yxRxHj/TjzdT KJDhreR4wo/lA== From: Benjamin Gaignard To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v13 29/56] media: verisilicon: Stop direct calls to queue num_buffers field Date: Thu, 19 Oct 2023 14:51:55 +0200 Message-Id: <20231019125222.21370-30-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231019125222.21370-1-benjamin.gaignard@collabora.com> References: <20231019125222.21370-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:55:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780188656691018448 X-GMAIL-MSGID: 1780188656691018448 Use vb2_get_num_buffers() to avoid using queue num_buffers field directly. This allows us to change how the number of buffers is computed in the future. Signed-off-by: Benjamin Gaignard CC: Ezequiel Garcia --- drivers/media/platform/verisilicon/hantro_postproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/verisilicon/hantro_postproc.c b/drivers/media/platform/verisilicon/hantro_postproc.c index 64d6fb852ae9..8f8f17e671ce 100644 --- a/drivers/media/platform/verisilicon/hantro_postproc.c +++ b/drivers/media/platform/verisilicon/hantro_postproc.c @@ -195,7 +195,7 @@ int hantro_postproc_alloc(struct hantro_ctx *ctx) struct hantro_dev *vpu = ctx->dev; struct v4l2_m2m_ctx *m2m_ctx = ctx->fh.m2m_ctx; struct vb2_queue *cap_queue = &m2m_ctx->cap_q_ctx.q; - unsigned int num_buffers = cap_queue->num_buffers; + unsigned int num_buffers = vb2_get_num_buffers(cap_queue); struct v4l2_pix_format_mplane pix_mp; const struct hantro_fmt *fmt; unsigned int i, buf_size;