Message ID | 20231109163512.179524-38-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp559448vqs; Thu, 9 Nov 2023 08:39:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAMaWX4nfDu/1CDgzfvGj0HGYhgLh3uVU1pq4NQZ0Vmx/xm76y0uBCwcnePL7yj//SHfNf X-Received: by 2002:a05:6808:b26:b0:3a8:f3e7:d691 with SMTP id t6-20020a0568080b2600b003a8f3e7d691mr2037925oij.37.1699547989420; Thu, 09 Nov 2023 08:39:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699547989; cv=none; d=google.com; s=arc-20160816; b=l6AnnJQNQi3Nm4a+R02Rh6/ewoyfJ2ntE0sSkrCjHmyvWtlvy+fvPXG5uJeEp5s2dI vn4QwZtnfGs5GEPo4OzQDbRx4Cc6KKSnO8VIfnA3O8es3JY48QvnzwxtsY/moKwR4TyO MJO4kHKgwnR5nT325obBbd0ooildeZTwhg5HVOKS75JQR8IePTPaEjolUrBc5QdmOy1/ kxirLFDk7MBvU1/4h9fn3T7Gv7mHDk9bcXdOpoXhWhysp9UQOscahBoNyZcozBf8AgNZ Y2iVOqndEzmupIqgMq57fQg48sXhZujZwpfuI3aIM6DKFxpDF8i1lM0okiWtBtR7uUZg 0dSg== 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=ohLzkd0SyuFRX3nZbPpa9Luh/y95U/RdqS4JOBTWAUM=; fh=4MWjvAPbItHsJVEasbpqpaV1oQ9+9G4Ns7wAglKosZA=; b=eTv0/zPfJtt8TiDmxPzStdYSbMfpcgy2ldhBuY2V+wFwMYe5K+hR5oKMq8btu+EcIA rm/mKg6pi5e+pLATRCOSGzE0JwbQ9mXcTyBMhj+QYMv8WkWOGvuTbHMs18dcpq/s8n1I 7SCM0iDVW1fXd/Vh8zx2h9Sa3kdLLJaFnE2pazvgqc/2QeYsxdjtOs+MEUk+s75lQoDw fkxntkHWxs4zZtNPfcSWlN2Y9919ds/jQDT+ldscg+oN/Q7WDchwGIOa557kjUh2XLVx Ovs/jmzI+RkmzOOT5o9XRWmk370iJg6mNyEcyTR96TdZ1TiL+kMTE3URb6zIwBcIm0oA kLHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oW6Lr0o2; 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 l70-20020a639149000000b00577f67a0614si1642695pge.879.2023.11.09.08.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:39:49 -0800 (PST) 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=oW6Lr0o2; 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 8F125837D548; Thu, 9 Nov 2023 08:39:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343808AbjKIQja (ORCPT <rfc822;lhua1029@gmail.com> + 31 others); Thu, 9 Nov 2023 11:39:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344842AbjKIQi5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 11:38:57 -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 63D854496; Thu, 9 Nov 2023 08:38:21 -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 401AD66076BF; Thu, 9 Nov 2023 16:38:19 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547900; bh=B9/TxQu67i5OUs2XFrxigqj4gKM3accNnzrVxeIEiTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oW6Lr0o226QIo1W9LdS8FR7c3JMJm0ddcz3LvLYVBHQO6eI3nd1iolBOXH4rMB6yc tRffp2Ykw9puuECxH8//oWqGIF8xTElJTvvVbVlZ83i7ibBOQ0jlks8WytjhccJ4Ri mUc67TgPdHqx5aA0Kq5dQwJidqbKnwzT4cORaIpoBN+90yEsgEdolOuDTeAiFSfKrp oGVF5gq5q2NFkJqBu6Nj18r9+1QtDB+0Y99OYNSimmhlfXxtLMjgA7pfEWypBxrB/X 2ry2V3oAg3giZdq080HxlZ1S/203fQveAhBedrC1su+BYPY3iI1S0fDFxGDJ0/a22/ frWo1ugH0MPsA== 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>, Andrzej Pietrasiewicz <andrzej.p@collabora.com>, Fabrizio Castro <fabrizio.castro.jz@renesas.com> Subject: [PATCH v15 37/56] media: renesas: Stop direct calls to queue num_buffers field Date: Thu, 9 Nov 2023 17:34:53 +0100 Message-Id: <20231109163512.179524-38-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 Content-Transfer-Encoding: 8bit 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 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 08:39:48 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782105232564628294 X-GMAIL-MSGID: 1782105232564628294 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Nov. 9, 2023, 4:34 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> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> CC: Fabrizio Castro <fabrizio.castro.jz@renesas.com> --- drivers/media/platform/renesas/rcar_drif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c index 292c5bf9e50c..f21d05054341 100644 --- a/drivers/media/platform/renesas/rcar_drif.c +++ b/drivers/media/platform/renesas/rcar_drif.c @@ -424,10 +424,11 @@ static int rcar_drif_queue_setup(struct vb2_queue *vq, unsigned int sizes[], struct device *alloc_devs[]) { struct rcar_drif_sdr *sdr = vb2_get_drv_priv(vq); + unsigned int q_num_bufs = vb2_get_num_buffers(vq); /* Need at least 16 buffers */ - if (vq->num_buffers + *num_buffers < 16) - *num_buffers = 16 - vq->num_buffers; + if (q_num_bufs + *num_buffers < 16) + *num_buffers = 16 - q_num_bufs; *num_planes = 1; sizes[0] = PAGE_ALIGN(sdr->fmt->buffersize);