Received: by 10.223.164.202 with SMTP id h10csp1157988wrb; Fri, 17 Nov 2017 15:06:47 -0800 (PST) X-Google-Smtp-Source: AGs4zMb4tdD/tE4HL74Llfw9Bsj0o6Y0vZtMNT2pm0V1jUpTsToO3K3mLF1nev1rFeRTDzkp0eG+ X-Received: by 10.99.5.1 with SMTP id 1mr6405064pgf.183.1510960007739; Fri, 17 Nov 2017 15:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510960007; cv=none; d=google.com; s=arc-20160816; b=Wc+3486X2CuHnlkGRUXuhXErFrRYNWGNJOzQd6eMlN+sW+BJ9+EPUePLJe1Kdvdn5Q AgmSLlmiMzS5EA8/fgQDpU2WC74E/nhzNL3fIP/QsDTn0wtiUjlGPp2a5Y3fCUJyVwcd OFGMHj+KLS2S8mn+ZWuurSRx20EO1qOgmDfYPWnbJNTRukbLxaslbV6g3nuFHdkwCo/s wprkwsRAI5IYy5W1qYkagfjOMOevHeAgQHVfA9YiqovpmaZGbGprMVNQ+bplKthlcL+4 I206LoBPwhjhjqJljJdTen/SCTGjzNyA29hKgR8G6KnG4r8UQHiyWKKsiDml6rmHuAyL x4uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=C7hb1vOwZVvRzl3X0yNEWU4sSCoMpTRK6sJxRJa6Zo8=; b=V22mZPDQGD1Iw7bb5OHml4+HqpZuVv+BqDMqRSGZWDfLqrZeid/dSdkmegVyoTf2zx cIzL6hobtw3VK9MfjxEOlnknoUBiBdD+o0MzoBhkxw44agR2eaghR0bccUytOmhgTbvO Y57nbAk3kDwVnevlIb51imoC5x/tu3inKKQzdgMRI/1vB9YEdqeFYqM/dRmVwYHzgjX/ kQBR+CF0R/COMW9W3J3VDZruqqTG8O0ZYBmgcWlO6Tl5kA4si1B0H26OuANxUzMTxVdY mDuNkVSFfDkVbNeA5yiPJ8HYB57NNJcSuppAEzryoClpck+yWPvpA7oj/p9UU4YJpkVr f9yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si3454196pgo.221.2017.11.17.15.06.34; Fri, 17 Nov 2017 15:06:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966095AbdKQRUv (ORCPT + 93 others); Fri, 17 Nov 2017 12:20:51 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:38036 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966075AbdKQRUp (ORCPT ); Fri, 17 Nov 2017 12:20:45 -0500 Received: by mail-qt0-f181.google.com with SMTP id f8so7686829qta.5; Fri, 17 Nov 2017 09:20:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=C7hb1vOwZVvRzl3X0yNEWU4sSCoMpTRK6sJxRJa6Zo8=; b=SKfsVqMwQBbnxxwWc/MlA7tv4bI1mhO7QUehsAM48r5oLAULpQPHuktp4rqDo8UP3J DBQ25dR2mk0g/yJCkP6LsoWUNGQOQX34b9i5MzfiDnqTKGdc4rMMjDwoxvQ44/MJys3c CJ85cjnS9nMmBv9TFKEEE+DTmK8R5ckRBLcrmfHlTPmf1FJvl6W/+0PPIxy4fBoQNy9k AnFbM+jIljrOBSsL7Ilrk+gPnfKdY4/l/bnZApCf80ziW8S/oyHM6HHZqkMW2/PPXKr0 Z2NxLseZ+B1D1AEkzSSTENmFl/mL3UaQ3kec06ANeACXV8jnwpGOzCoYFucduRUn7InN mw5Q== X-Gm-Message-State: AJaThX4FnUqkihxYJqc6YcbqXv0ax+BYC5Dn/rtm6myshH2xi9xBaav9 LYrt3UmINuaWijNome99Lgo= X-Received: by 10.237.36.7 with SMTP id r7mr9268769qtc.218.1510939244179; Fri, 17 Nov 2017 09:20:44 -0800 (PST) Received: from jade ([179.97.166.229]) by smtp.gmail.com with ESMTPSA id c16sm2840606qke.53.2017.11.17.09.20.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 09:20:43 -0800 (PST) Date: Fri, 17 Nov 2017 15:20:36 -0200 From: Gustavo Padovan To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Hans Verkuil , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , Brian Starkey , Thierry Escande , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: Re: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF Message-ID: <20171117172036.GJ19033@jade> References: <20171115171057.17340-1-gustavo@padovan.org> <20171115171057.17340-8-gustavo@padovan.org> <20171117105351.3bb0af32@vento.lan> <20171117131248.GI19033@jade> <20171117114751.2dc10542@vento.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171117114751.2dc10542@vento.lan> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-17 Mauro Carvalho Chehab : > Em Fri, 17 Nov 2017 11:12:48 -0200 > Gustavo Padovan escreveu: > > > > > /* > > > > * If streamon has been called, and we haven't yet called > > > > * start_streaming() since not enough buffers were queued, and > > > > * we now have reached the minimum number of queued buffers, > > > > * then we can finally call start_streaming(). > > > > - * > > > > - * If already streaming, give the buffer to driver for processing. > > > > - * If not, the buffer will be given to driver on next streamon. > > > > */ > > > > if (q->streaming && !q->start_streaming_called && > > > > - q->queued_count >= q->min_buffers_needed) { > > > > + __get_num_ready_buffers(q) >= q->min_buffers_needed) { > > > > > > I guess the case where fences is not used is not covered here. > > > > > > You probably should add a check at __get_num_ready_buffers(q) > > > as well, making it just return q->queued_count if fences isn't > > > used. > > > > We can't know that beforehand, some buffer ahead may have a fence, > > but there is already a check for !fence for each buffer. If none of > > them have fences the return will be equal to q->queued_count. > > Hmm... are we willing to support the case where just some > buffers have fences? Why? It may be that some fences are already signaled before the QBUF call happens, so the app may just pass -1 instead. > In any case, we should add a notice at the documentation telling > about what happens if not all buffers have fences, and if fences > are required to be setup before starting streaming, or if it is > possible to dynamically change the fances behavior while streaming. We don't have such thing. The fence behavior is tied to each QBUF call, the stream can be setup without knowing anything about if fences are going to be used or not. I think we need a good reason to do otherwise. Yet, I can add something to the docs saying that fences are exclusively per QBUF call. Gustavo From 1584352723986119853@xxx Fri Nov 17 22:08:20 +0000 2017 X-GM-THRID: 1584155088810136583 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread