Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2353267rdg; Mon, 16 Oct 2023 01:20:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWNaU5X1u1LNOwkM/x9Xam5BQFpbBiE70n+xafZXUK16cbi01MUocV8CmMjS2Uq9OrAk52 X-Received: by 2002:a17:902:ba8c:b0:1c5:efd1:82b6 with SMTP id k12-20020a170902ba8c00b001c5efd182b6mr26532009pls.30.1697444441507; Mon, 16 Oct 2023 01:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697444441; cv=none; d=google.com; s=arc-20160816; b=HtUfpoIS/aPdROHwbUQ7GTn45g6Z/JnXRlkR4EY5iKhNyrXWqmZn23enoOgW+eRjf4 oP/akH8zGNvMoMmuFX3JmBmZ242fLa8NCmGg4p/mGl+5bUTc4rR/aTbSIcrU+90QYyK6 M6ViwkPSUE6Ve2FNPtJGCUhfBKxb1cgYjlhbtINnp0a0C8fnGQAg8heKkOLVu8DIXeo3 5xH+BHZDyhvBnZuFEhoqBOoSoMC0KZuO3Jg5goQ72fbq5Je64uAxqdvr5K8f19YVv2jb ODWuM5/ULmA8izN8pJKNeo5eJC3GMCpCisH791rvi8IPEClQta/QOwybQsYQcJweM/7z Og8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=NhPTFo0oeO5TRqWDpWuYA24BLESlX4TcTcfhwdipP/8=; fh=rvfjkWKWQ7H3dxwU/Mrzlf1SBsZ3Tuo/EBElQFetDNM=; b=hePgtkVx4UstkNHiNCtsy0c+vj6VxuiZMdloHq4XAt2+W009bH7MYfItd7tika3PaL lZoMYB/4r2y3Q1h0xq68nQpkll1GXzHd4usbKms1ul5NKcUN+2iC+8fH5kfJm0dKOGAT dEEevrQ9u7lflpbvQVezoTNIzKuZt7ykTgOoaiBScDDl/s0mfO+tDfWVAbWeX9hCCZ90 mcRpRpeg/gdpc1QZBwyonECdDUlu3bnQgJ06M37GH55wdKhQ9zNZVLsBfqtuEHxnF7wO EjFzWiCnKx14BdkNcVL20e9+lx/Diktg3j9JWlA5UNShwj3erK6aWjMdZGXVh1Zg/2tc XHjA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id m18-20020a170902db1200b001ca000e889bsi7524737plx.175.2023.10.16.01.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 01:20:41 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1DC5880A13BD; Mon, 16 Oct 2023 01:20:39 -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 S231962AbjJPIU1 (ORCPT + 99 others); Mon, 16 Oct 2023 04:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbjJPIU0 (ORCPT ); Mon, 16 Oct 2023 04:20:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37CFCDC; Mon, 16 Oct 2023 01:20:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC20AC433C8; Mon, 16 Oct 2023 08:20:20 +0000 (UTC) Message-ID: Date: Mon, 16 Oct 2023 10:20:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v11 34/56] media: usb: cx231xx: Set min_buffers_needed to CX231XX_MIN_BUF Content-Language: en-US, nl To: Benjamin Gaignard , 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, 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 References: <20231012114642.19040-1-benjamin.gaignard@collabora.com> <20231012114642.19040-35-benjamin.gaignard@collabora.com> From: Hans Verkuil In-Reply-To: <20231012114642.19040-35-benjamin.gaignard@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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: 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]); Mon, 16 Oct 2023 01:20:39 -0700 (PDT) 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 > --- > 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;