Message ID | 20231012114642.19040-35-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:2908:b0:403:3b70:6f57 with SMTP id ib8csp1165612vqb; Thu, 12 Oct 2023 04:49:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwNB000TGccRMUScGt7YAYJ04yNDHooJgjdfDb3v1K03i8sBM5i65/VCCMp5L/8nHpucAu X-Received: by 2002:a05:6a21:a596:b0:163:d382:ba84 with SMTP id gd22-20020a056a21a59600b00163d382ba84mr29306015pzc.5.1697111355783; Thu, 12 Oct 2023 04:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697111355; cv=none; d=google.com; s=arc-20160816; b=goKSa12BC9cr1nUNUMRGL2Yqp/FiSUrhLp3FebMBuXKbfAOWJL2FfDzJIEuqpeAiqg yCrFhuQjBzk7v1b8jc16kbS0KfcaUmwDraFDtilDHgxLnAua5Mh0KjeRCWtXJmHPZ4sd uN9qMgzJGe/uGiXF2cFamUXq3Nl4L8Q6a83QLZJqwoUl6gTSuU7UM46tKzCAsXQj93R8 mI2rr4vE2IT6AEB9ICkTe7bIz6AnufjhIGdwRcJtm7OsdkDKwBVuubtDOdnYIu2Zq+hl sFprKLJJ+df9PTOI7gmLS2cyb5+gvJ3QAX1bjkG6WSE2Kn+4NVupN2bqZsBxVkIdBgMT Ge+w== 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=ER83NPi30J3seQDoSaM/YXD649vL/4o83t3smZbJ/84=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=EVlwF4HaX95laGj+7+FnYhxGRGppcuVdjtpY3qGkxjDEDRxVmM897I6GG7ri4Zbijm Q43/zBPvIEQH5g87zWAgRQYskPsVTtrG37+5hzlCwfPo/tSz6yNqrUEc+msLuIycGydX R6SII/TtetMvBoKHaXj8iK37B2TFzHc5AF6Hl/DWl78dgG8G/EL3ZpqyLDo9lejJmzzy K+cDwpmADLV7xbYrBCciudkp8iO/EeHyUTAbinxrEGRF3iXDNjTYZmSqlTBrGQz6pihv KY9wvj0Ks4LmoU4SRA4F+TN0quOqbMEsUWzsEKVbAnsjOMf6E/s+DhZa8WPRbs2LX2Gr IvEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MeUP9vNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k63-20020a632442000000b00578f7063ae7si2162268pgk.682.2023.10.12.04.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:49:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MeUP9vNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 C55EE822CE1D; Thu, 12 Oct 2023 04:49:13 -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 S234148AbjJLLtB (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Thu, 12 Oct 2023 07:49:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378755AbjJLLrP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Oct 2023 07:47:15 -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 48E9018B; Thu, 12 Oct 2023 04:47:09 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7ae7:b86d:c19a:877e]) (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 7AD7A6607342; Thu, 12 Oct 2023 12:47:07 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697111227; bh=fi+Fxcs6m07q1y5Umer9Ad8BDnSh9/sSAfF+r67YVOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MeUP9vNzWBasugY68j+66SW3C/LzkLPve86K4aNyyQ8g++Q76e+RYBrQ7LINrkiK2 dsRGKCnEg6ehWToc0Tncef+RTzatdbeo/RNZrTk3Dbo5KvI4v47Vt6wvsvpenCVL0/ y+0a8Wh1yV6ny/p02Tl32UDcVc7xMtAlNltup5VYEr43eFC1BV4fb0nqEsusg3DHtU rQCOAq2Yfh3yQTde3Wfmp7KWiR0PWlxKxpY3IszrosThGBVzGgCd5HOOCuLe0XWICi EZvCqXBc9OZUrFfT5a44sHvMPfl1hTbJXeMn5R0TEEji6U92aR0Ok3gWrm45MOQ8ky 0oR+n+dAb7a5Q== 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> Subject: [PATCH v11 34/56] media: usb: cx231xx: Set min_buffers_needed to CX231XX_MIN_BUF Date: Thu, 12 Oct 2023 13:46:20 +0200 Message-Id: <20231012114642.19040-35-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231012114642.19040-1-benjamin.gaignard@collabora.com> References: <20231012114642.19040-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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: <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, 12 Oct 2023 04:49:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779550236739244057 X-GMAIL-MSGID: 1779550236739244057 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 12, 2023, 11:46 a.m. UTC
vb2 queue_setup checks for a minimum number of buffers so set
min_buffers_needed to aCX231XX_MIN_BUFnd remove the useless check in
cx231xx queue_setup().
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/media/usb/cx231xx/cx231xx-417.c | 4 +---
drivers/media/usb/cx231xx/cx231xx-video.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
Comments
On 12/10/2023 13:46, Benjamin Gaignard wrote: > vb2 queue_setup checks for a minimum number of buffers so set > min_buffers_needed to aCX231XX_MIN_BUFnd remove the useless check in Garbled line. Regards, Hans > cx231xx queue_setup(). > > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> > --- > drivers/media/usb/cx231xx/cx231xx-417.c | 4 +--- > drivers/media/usb/cx231xx/cx231xx-video.c | 4 +--- > 2 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c > index c5e21785fafe..fecdb12f5ef7 100644 > --- a/drivers/media/usb/cx231xx/cx231xx-417.c > +++ b/drivers/media/usb/cx231xx/cx231xx-417.c > @@ -1223,9 +1223,6 @@ static int queue_setup(struct vb2_queue *vq, > dev->ts1.ts_packet_size = mpeglinesize; > dev->ts1.ts_packet_count = mpeglines; > > - if (vq->num_buffers + *nbuffers < CX231XX_MIN_BUF) > - *nbuffers = CX231XX_MIN_BUF - vq->num_buffers; > - > if (*nplanes) > return sizes[0] < size ? -EINVAL : 0; > *nplanes = 1; > @@ -1777,6 +1774,7 @@ int cx231xx_417_register(struct cx231xx *dev) > q = &dev->mpegq; > q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; > q->io_modes = VB2_USERPTR | VB2_MMAP | VB2_DMABUF | VB2_READ; > + q->min_buffers_needed = CX231XX_MIN_BUF; > q->drv_priv = dev; > q->buf_struct_size = sizeof(struct cx231xx_buffer); > q->ops = &cx231xx_video_qops; > diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c > index e23b8ccd79d4..26b593844157 100644 > --- a/drivers/media/usb/cx231xx/cx231xx-video.c > +++ b/drivers/media/usb/cx231xx/cx231xx-video.c > @@ -717,9 +717,6 @@ static int queue_setup(struct vb2_queue *vq, > > dev->size = (dev->width * dev->height * dev->format->depth + 7) >> 3; > > - if (vq->num_buffers + *nbuffers < CX231XX_MIN_BUF) > - *nbuffers = CX231XX_MIN_BUF - vq->num_buffers; > - > if (*nplanes) > return sizes[0] < dev->size ? -EINVAL : 0; > *nplanes = 1; > @@ -1805,6 +1802,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) > q = &dev->vidq; > q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; > q->io_modes = VB2_USERPTR | VB2_MMAP | VB2_DMABUF | VB2_READ; > + q->min_buffers_needed = CX231XX_MIN_BUF; > q->drv_priv = dev; > q->buf_struct_size = sizeof(struct cx231xx_buffer); > q->ops = &cx231xx_video_qops;
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index c5e21785fafe..fecdb12f5ef7 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1223,9 +1223,6 @@ static int queue_setup(struct vb2_queue *vq, dev->ts1.ts_packet_size = mpeglinesize; dev->ts1.ts_packet_count = mpeglines; - if (vq->num_buffers + *nbuffers < CX231XX_MIN_BUF) - *nbuffers = CX231XX_MIN_BUF - vq->num_buffers; - if (*nplanes) return sizes[0] < size ? -EINVAL : 0; *nplanes = 1; @@ -1777,6 +1774,7 @@ int cx231xx_417_register(struct cx231xx *dev) q = &dev->mpegq; q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_USERPTR | VB2_MMAP | VB2_DMABUF | VB2_READ; + q->min_buffers_needed = CX231XX_MIN_BUF; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx231xx_buffer); q->ops = &cx231xx_video_qops; diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index e23b8ccd79d4..26b593844157 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -717,9 +717,6 @@ static int queue_setup(struct vb2_queue *vq, dev->size = (dev->width * dev->height * dev->format->depth + 7) >> 3; - if (vq->num_buffers + *nbuffers < CX231XX_MIN_BUF) - *nbuffers = CX231XX_MIN_BUF - vq->num_buffers; - if (*nplanes) return sizes[0] < dev->size ? -EINVAL : 0; *nplanes = 1; @@ -1805,6 +1802,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) q = &dev->vidq; q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_USERPTR | VB2_MMAP | VB2_DMABUF | VB2_READ; + q->min_buffers_needed = CX231XX_MIN_BUF; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx231xx_buffer); q->ops = &cx231xx_video_qops;