[v13,20/56] media: dvb-frontends: rtl2832: Stop direct calls to queue num_buffers field
Message ID | 20231019125222.21370-21-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp359544vqb; Thu, 19 Oct 2023 05:54:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTtiDrzNPD1uZAl36y9oSKxp224WJKyH16NPhwPsoWwY1QW7RMtlbGe9Bv617eYxzaCW1Q X-Received: by 2002:a05:6358:ca6:b0:166:cda9:c1d5 with SMTP id o38-20020a0563580ca600b00166cda9c1d5mr2370886rwj.10.1697720072421; Thu, 19 Oct 2023 05:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697720072; cv=none; d=google.com; s=arc-20160816; b=a8l1QtbO8q03YKRQOeBtuia4nyVfFuvmvWDMJDqrpdE4a/cc/9oT/PzowyGYpP2D/K JIBDYmWHFAFxqM7n4tLn21xAyEL4ZniAewsnLbZhddv5h0J68FhLp9BgKPz2z9Bqaax8 GEaBaTT9cgSLpd0fwgXwD+el3s1CEF8OaJpUvtTSE0PA9KrevoWpnY1o4wo83NOQ+sqV VYiMRnpyMnq/v2Bd+7HHjXaSXdYKPqwdHDQPFAYOKaqg/QxWlYGD7KDfe/2Mve09BaIQ knngpcEp1TlbAfZNj/SJR3e24H0xohHNEmx4wtEApV3DSm8JP3TC0KwFueIWIUbWCu93 j2ng== 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=BVc3Gw7um+ugtNMPbdIQp4POT0sbfp8d45vmiRVz7f4=; fh=p0AH8hgimiy85Lh1cXLIqpi5zFbeLa4s8fsQNMmUBzM=; b=Y1P7sVUFTXgVxjvG20DzAUf+reLsRflIWNPXrkWrQ4C8ATFq9dLtU05T3BQJODsb8w kVGvqJSj/t9nt8oZCeSzO5CkZbqH5xZTyqmf5gIr/tWxcEOQ8lzAe5KJP5C7T4CP14bx ruUpZcosLeOkFZFGIRkpCAn45GhPU9les1+O4Opa2TxZYMIWobgd7A42o4qIQVj0RSvt jRJwBpm3SdFqDJn5kbKrCpgsZqbK9+n1iVzqWkLtUuKnNuvawM+lxQuR/egx2Z20ejNg Gs8klgVguDZIFpWhNmGpjXoEC83UEWd0XdiNXjuukhtwU1+hZxrzayZgBzwnrOaNevIQ 3mdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=F7OrKzZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y19-20020aa78f33000000b0069023e4bcb4si2444090pfr.114.2023.10.19.05.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=F7OrKzZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 32F7380545B6; Thu, 19 Oct 2023 05:54:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346040AbjJSMx5 (ORCPT <rfc822;lkml4gm@gmail.com> + 25 others); Thu, 19 Oct 2023 08:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345801AbjJSMwq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 19 Oct 2023 08:52:46 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C354D18E; Thu, 19 Oct 2023 05:52:42 -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 046946607362; Thu, 19 Oct 2023 13:52:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697719961; bh=mNj/uXX2BkOwU+t/CAhw8+caswKl9nv73YeSkh4q3yA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F7OrKzZi31bik6J5oErOk43NN6AyGkYnez089rZ/e855TZgWB4jhKZwFuXneyapEF hgZ8t8D46KeOryL3/HPBx4RfA493fZLsa2txNqgGOG+qxEpRpakohRF5WcyuahC4Tc 0MN/I0qWoc3uHJnVECASR9J9QWwzZmSpczirwfke+hQkJV/HvqgYOjASVVR6WCNLgL DGbjGmGnxOCGO4Efj2t3PgslsVBeuFHYtYsd0QHer7z2rzKznINq/lMCT3Ey1I4jGv ea0110yk879PbU+mNtWjc3ZPvpAl1MnCC8SOgtMBOPs0TWJ1WPioNqs2cQ2+P6HSxN Lg+gcJNf+VK9Q== From: Benjamin Gaignard <benjamin.gaignard@collabora.com> 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 <benjamin.gaignard@collabora.com>, Antti Palosaari <crope@iki.fi> Subject: [PATCH v13 20/56] media: dvb-frontends: rtl2832: Stop direct calls to queue num_buffers field Date: Thu, 19 Oct 2023 14:51:46 +0200 Message-Id: <20231019125222.21370-21-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 Content-Transfer-Encoding: 8bit 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 lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:54:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780188522560500531 X-GMAIL-MSGID: 1780188522560500531 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 19, 2023, 12:51 p.m. UTC
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 <benjamin.gaignard@collabora.com>
CC: Antti Palosaari <crope@iki.fi>
---
drivers/media/dvb-frontends/rtl2832_sdr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index 02c619e51641..023db6e793f8 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c @@ -439,12 +439,13 @@ static int rtl2832_sdr_queue_setup(struct vb2_queue *vq, { struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq); struct platform_device *pdev = dev->pdev; + unsigned int q_num_bufs = vb2_get_num_buffers(vq); dev_dbg(&pdev->dev, "nbuffers=%d\n", *nbuffers); /* Need at least 8 buffers */ - if (vq->num_buffers + *nbuffers < 8) - *nbuffers = 8 - vq->num_buffers; + if (q_num_bufs + *nbuffers < 8) + *nbuffers = 8 - q_num_bufs; *nplanes = 1; sizes[0] = PAGE_ALIGN(dev->buffersize); dev_dbg(&pdev->dev, "nbuffers=%d sizes[0]=%d\n", *nbuffers, sizes[0]);