From patchwork Tue Oct 31 16:30:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 160203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp363992vqg; Tue, 31 Oct 2023 09:33:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHW4yPsF/ymgoKYyNyu0mFfGyQlFleeGQ5+GFwRl/D1Ptdz7XNTZDrkysAROyQI/IbhkZM+ X-Received: by 2002:a05:6a20:8e0b:b0:14c:a53c:498c with SMTP id y11-20020a056a208e0b00b0014ca53c498cmr13427347pzj.10.1698770024341; Tue, 31 Oct 2023 09:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698770024; cv=none; d=google.com; s=arc-20160816; b=iUh16kJpAHUahtkT9lpUo0/zZBEnF9ehDP7JbQy/Jh9t16Ulw5gTnH/RO8obrPDweb giVP/tXPS6d72kb+3dqpE/UD+9/Gk6JkPm2ByCLijFwZFxpMyy5SsUjrwc/OD3YVClvG RktKTKlXxbHUq3vNZW4RLMBVFGSFpu1bxlaBy2cf+GaZ8JwkuYIZSteNDlxruNdWnRxQ dct9uBi/KyIigzxBsFovE34LbKuFKRHaiZFjc9FYDDme/luTlewyJ+eZeOgiOmIzBwsc nc0J8nrPI6mPvxI1ZVk5TDLyDU9HsEM+qdKHZcgo8cC+h6Glj53T7q/4mcIPOg7GAvGI qXww== 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=k3nG2IzNhv/fpp1D6+f3PzeMd0jOmdYaiEB9TW8OLJ6nfrbnJxafwEc4RODW94FcDO v6nqnCOVVF8Z9uxCApaZtbGIbnOfUXVcr9l/q3nFGk4Rf+Mx4K+EacezBgGP+Wg1SlDS eAJ7c6COUXfXMpuoO71w1wbzhdCNuu8xv4z+J72GafkIkMgCiKDHaJrX/BZiu9GjXWCz rwPzkIQ2P5YfpCtydqI90sNbtEI7jEQK+D3lCBh94xgXQIImnwgcBWw+Qq5nq5+PZgtR sdHGseocJaq8whxMz6DklWOqmSaVPzzJzxnHUCqBLEt7d493nMw1KnYdhP7rwo27mWt8 jLyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jsZn+w9A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id p4-20020a056a000b4400b006bd9ff6dab2si1202031pfo.377.2023.10.31.09.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jsZn+w9A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 5902080E65A8; Tue, 31 Oct 2023 09:33:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345957AbjJaQde (ORCPT + 33 others); Tue, 31 Oct 2023 12:33:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346263AbjJaQct (ORCPT ); Tue, 31 Oct 2023 12:32:49 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC9C810DD; Tue, 31 Oct 2023 09:32:00 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:c562:2ef4:80c0:92f]) (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 15EA366073C2; Tue, 31 Oct 2023 16:31:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698769919; bh=DdlxkRuWKO9j/krVAsdkWz62fUG/5l8klfwhgZtW1d4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jsZn+w9AGvdKGzrY+2z3fatrE1MKDJr2cgINg+ChcyXE6FwDgydRlJ+zp+pBj1HNo SAAcPE1fqzvGJcvELQJkHxpYFP87r/UYB6BVMb0v9PmCMCU44d9T+1nDepbQf7Kju2 47vNleTl1+X29J+P34rflAOb+WYbhWhW+VcJgLEww4qmy+frNk5mcjxt+lCZ2dutrG OVokWnBeg2D5wvdLnjTyhQcG+141GcRS08hZD1tSIXHBXj5nSba8kXbQ/O5wR6yCwv EjrzcxcJ1Q3Beb6fLJmgH3ujKoz9PszEh7uAIrIs74wILR21u5Majy27QtJEwDf6c4 gNOUD8kLKXbog== 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 v14 29/56] media: verisilicon: Stop direct calls to queue num_buffers field Date: Tue, 31 Oct 2023 17:30:37 +0100 Message-Id: <20231031163104.112469-30-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231031163104.112469-1-benjamin.gaignard@collabora.com> References: <20231031163104.112469-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 09:33:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781289477004108027 X-GMAIL-MSGID: 1781289477004108027 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 Reviewed-by: Andrzej Pietrasiewicz --- 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;