From patchwork Wed Sep 27 15:35:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 145593 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2901562vqu; Wed, 27 Sep 2023 14:09:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHB/5D7tz6w0HgATk4s35dT1Q450S2GcQX/KI/ijbKBRAME6OZAVcHlq/1O8BHpaL+JnAt1 X-Received: by 2002:a05:6808:64d:b0:3a7:1e3e:7f97 with SMTP id z13-20020a056808064d00b003a71e3e7f97mr3169819oih.4.1695848942401; Wed, 27 Sep 2023 14:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695848942; cv=none; d=google.com; s=arc-20160816; b=LJqBv500oDh00m59IB+ylwae7WxPgrLvperf+1J64lu0dMpXqD6tE1IP1aiDYaNdhq ddsYNOU4guZCLOjajxg+oWWJ0WJSVCUVLpJA8MKB92fLUDeg7fEOtZFHAyyw1ZO+YXrc dpo1JWYWOJpft+I7hGVvpMzBiyp3d+mxuXmmZ+cehGQcFeXRrw0RR0nKI3pB2nSlY6Ja TXq6zBbvyeH/xm9lCzT5XazTsiH26gGKyIRsqEfrELZc68+4Qm/wJCmkCZr/VrfumuQA ANUqopSQ2rq6DrydmzYCO4wOo2geTboL+mPNTugRmlFWVx6RirtppZV1jCjZ4vZGSpjH oLlw== 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=zSeiYCcCe1j1lVfVdT6tCVSomRhCyxFccU4DHqKuZ+E=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=ELUucjBYSS3T8F5jo0djrpjhX1z/hiUClvqPt0k03nuLF6GYuEqiSmJR2BOjH0YwgV 8DK0YQekKYi+kRAj+97WdYQM8SqUYHgdo3uLttu5Ye9ArisfxWLv91wrxSuCIHOHopGi TjpObAfn3ZPvEungnxyoNCqnY/s6YlGlnpnkvWMo8wvGfx7M7d3/3Zx72trZEZrz3hKu sLeOAlTm4258cR/LB65qdx11LKJvBSwEuH6dzYpZ0d2mfj08ZlaHjfMFDfQ0rnY1+SY9 tIg5H4v6Ni8TvYE3YUK4GsROOsWTQCbKNbxE2f6c2Mz6WAeX6P7oBjkXchhnN+aFOhW2 Qi9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=S+L84mcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id cd19-20020a056a00421300b0068fb6fc3ff1si16186856pfb.209.2023.09.27.14.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 14:09:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=S+L84mcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 53D6681DD268; Wed, 27 Sep 2023 08:38:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232951AbjI0Pha (ORCPT + 19 others); Wed, 27 Sep 2023 11:37:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232624AbjI0Pg1 (ORCPT ); Wed, 27 Sep 2023 11:36:27 -0400 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 613C7CC6; Wed, 27 Sep 2023 08:36:20 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:672:46bd:3ec7:6cdf]) (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 D437E6607353; Wed, 27 Sep 2023 16:36:18 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695828979; bh=uLtpgbM1S6TEQd3BheD+tuaw3lVo9oisDECpkyjdDDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+L84mcHo60rVTDABPpaqi9turpx6HRLsClDamnQGpQrKfTz+xkRtnEbxp/La5GHI Ljl25UOwbiCeibBWFAKjFVz/TAeZJfA1JARxGSiyrUxI9JrczK5IcWpncpQ3PSH/bi Se3jPRQNPSBmTLcExTEJe6AcwgkVMxfPLBxoG0+TUhWm2PbJzg9x/cHeJJ+VHvDkKA Sb920qcy5xUk83izC9jTaNrun3MxL71COaloMEcHwupLV1xnh5W5eN8vCXGUl7uQwu SiH+oRyBYyvgzzDhaxS+o+837rtORFjoHodqSzZymuWfGlbYOi6rKig+j+n5aMdP9z uSJUnAeJ4Ir0g== 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 v8 24/53] media: video-i2c: Set min_buffers_needed to 2 Date: Wed, 27 Sep 2023 17:35:29 +0200 Message-Id: <20230927153558.159278-25-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927153558.159278-1-benjamin.gaignard@collabora.com> References: <20230927153558.159278-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 27 Sep 2023 08:38:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778226500763280144 X-GMAIL-MSGID: 1778226500763280144 vb2 queue_setup checks for a minimum number of buffers so set min_buffers_needed to 2 and remove the useless check in video-i2c queue_setup(). Signed-off-by: Benjamin Gaignard --- drivers/media/i2c/video-i2c.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 537ebd9fa8d7..5692d0b529d7 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -406,9 +406,6 @@ static int queue_setup(struct vb2_queue *vq, struct video_i2c_data *data = vb2_get_drv_priv(vq); unsigned int size = data->chip->buffer_size; - if (vq->num_buffers + *nbuffers < 2) - *nbuffers = 2; - if (*nplanes) return sizes[0] < size ? -EINVAL : 0; @@ -798,7 +795,7 @@ static int video_i2c_probe(struct i2c_client *client) queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; queue->drv_priv = data; queue->buf_struct_size = sizeof(struct video_i2c_buffer); - queue->min_buffers_needed = 1; + queue->min_buffers_needed = 2; queue->ops = &video_i2c_video_qops; queue->mem_ops = &vb2_vmalloc_memops;