From patchwork Thu Nov 9 16:34:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 163488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp559434vqs; Thu, 9 Nov 2023 08:39:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGckewNoCffkowpOyx9IZUqY6/iSeEroBHnkbI+nGDGKQiNByNiFoLbe+AggHKhFcEhG9n X-Received: by 2002:a05:6a20:3c8d:b0:181:7d6d:c0f1 with SMTP id b13-20020a056a203c8d00b001817d6dc0f1mr6439081pzj.37.1699547987679; Thu, 09 Nov 2023 08:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699547987; cv=none; d=google.com; s=arc-20160816; b=XpjAndAsEywpqfQF07dvsEC38dpfSpUvVlbAe5ZaPkSgwXWcwW1I/0AFqyeuhcAtEC vQ9IrdywAXqanz499RZEQaB+qc+uIRll9iBmnTI8hCaIOP2O9pLD47YeVYXm4UJQZGXG O7A/lCz8UqVJu3VUz+1JuFcfcDMLvN7FcA//cNJStotNWDRiy+ngpVDmoTzHwUm3eAFN NQW2sQ7OdjR8kGHlJbMRHPFjD3Vc6SkQuC49dPkVVtbSSegKMQ3PbChiu+/cJtAEhzx+ dDaHCBB/OeafFgHlMZmnOapIIXF1z0eMmqYsr5s2MD5Y35RVPTpXF6ggbKhQ8DWkJMDP mmtw== 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=cjSVV9KOmns+wxjAM4+B6r6mBBl+bkpK5jOFTe+n8+o=; fh=t4h1l+tS8anPNnwyX0PglXAWKg/D9M9NAbc0AP3vdGI=; b=hcnLuf2/UhtXNGnlLeua+rMDsDFQHaYactCSVBdDU5pSXqmX3PiJyN9+ZfwvoZqVLg lqLsQ/R3lxeWY2+MJ3arXcX3wDyGQV4AJ84fpDWJOteYmdy8sW38mYfNrBFm0hJXu1RD Rhqi0k3ywNC6skV8z6MBZKRptMXOIcD/BgpThUIkmh7P0FqCD/VbbsF5CkjsjA0S1Vl9 MAMO6v8/ai9YlzXOwGVcHuSU/m/FfhErx5HBlBjTOvWWiS2i0nYv1BgaJ8CZp8hryvpR q82Z6acTMWCBP9tpFFU5HZ8OTGIjtefMZqvC1luWOmbXFAszolFbKReF6axTr2MXSnrG JPWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RrtVh9X8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id mi4-20020a17090b4b4400b00276671731e3si2235234pjb.136.2023.11.09.08.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:39:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RrtVh9X8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 5E386824508C; Thu, 9 Nov 2023 08:39:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234646AbjKIQjM (ORCPT + 31 others); Thu, 9 Nov 2023 11:39:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344756AbjKIQiU (ORCPT ); Thu, 9 Nov 2023 11:38:20 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CB63C2F; Thu, 9 Nov 2023 08:38:07 -0800 (PST) Received: from benjamin-XPS-13-9310.. (cola.collaboradmins.com [195.201.22.229]) (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 F3CD566076AA; Thu, 9 Nov 2023 16:38:04 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547886; bh=GT8so2nlXz6sVTC6/LVEeyeT6LyqCEc+V+4zR/u/SPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RrtVh9X8Qs3g6cf1NjAny0QHSCivxPRqThyYB+1UeW3i1R3txI7Jyuoyosie0jI4Y Sobrtwrl9LWhxHkeucSN/nz/SaKMmS25oL/JykL+45iXaI+hXD65e2d9/d0KPTGhA7 4uR0A1VnzatKW+VvZFE30uarEAq7sBjvsUGAhdVDjxKQTQ/XTnG+KqRe7++7zxMAPo flk+iywS8HYIuCVUyuvGb7Gp5bz00HmhdeDWzxaStHOMZx/gks9MKl7aFliJNMDgJW G+lORtotlbUF4dWneogGispfaIhp837GUci0YW3ji015RqhSjGIDub+9myfBfLrrZ0 uH/fmoUfRR9BQ== 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 , Andrzej Pietrasiewicz Subject: [PATCH v15 29/56] media: verisilicon: Stop direct calls to queue num_buffers field Date: Thu, 9 Nov 2023 17:34:45 +0100 Message-Id: <20231109163512.179524-30-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231109163512.179524-14-benjamin.gaignard@collabora.com> References: <20231109163512.179524-14-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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 (agentk.vger.email [0.0.0.0]); Thu, 09 Nov 2023 08:39:36 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782105230781852833 X-GMAIL-MSGID: 1782105230781852833 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 Reviewed-by: Andrzej Pietrasiewicz 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;