Received: by 10.223.164.202 with SMTP id h10csp1078797wrb; Fri, 17 Nov 2017 13:33:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ8NffIZFSy0E6B3WlX4gfXMQb8Q1tTSbpdHKJ62Xin55nwdBFfxnTF1eaw5Dz+53tbURXY X-Received: by 10.84.198.164 with SMTP id p33mr6651707pld.264.1510954436207; Fri, 17 Nov 2017 13:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510954436; cv=none; d=google.com; s=arc-20160816; b=KKO7dCDmTQ2z99IbHSREdbSq725uigDM5FCkiiG1LUZxUc9b2XBd5ty2BdE9UDgG9A 7sFJoyTDKmo4PpKl1TkbjDt9f2mJ7hiimUHVjsz3HF8BIccKI8BkiLNUVmEyd40ZtCmr 9z2WkYK02s0Yqcq/sn+9kcGphotlbXTzNsMN2zvUDDu5TyDxPwvnztgsIC7KlCfyUEmE 04gAV/b0guAnuvEdDJIR8+3loYCyfujANj1xkPZv+HQuTJNpqxmddN99/xEtxvJjkyt+ BDEDupaJzdNRsF9K98XbuGgxsDGkimd7HbdWVE3vnEeP0hnCIYy6JuGninQfXC+5F82l /n8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=xF5HhJNsmIPtt8IPdUT8PpVhoKLEsDJ/xDzQTU+w8DA=; b=AV2hU+q1ByL1qbngwp0Hl3p4NRtLrupW5owGnahNlxXI6y8jdQDT05EAt2bM7MwcuE toiTp3jTqkNN1eqRmoZHeLiPe44zy+Yy6804RaZr5Z0uablbcd224KA4DZK9pOg0FJgO Db6DW5y5Vj7c5zUNPokawGJHzIUrnlyedDQemdEmx+ZF+iIl9PEUmG9l+1105HFMFvpp O+fK1OMGOtPYCmSwJA6Ap659bpDyuPb207V02uwsS5paEjqVV/gALG9DN+JPmVBOnwF4 GJ+TWiMhv72vefE3EwtxXDnPdvXhElUxbZ6I/t/TNtZkv0rPX2ITsKtscbqn2C+Sr+wy 9dLQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si3427323plf.342.2017.11.17.13.33.43; Fri, 17 Nov 2017 13:33:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755399AbdKQMQP (ORCPT + 93 others); Fri, 17 Nov 2017 07:16:15 -0500 Received: from osg.samsung.com ([64.30.133.232]:54754 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754955AbdKQMQH (ORCPT ); Fri, 17 Nov 2017 07:16:07 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 3553E2B1F3; Fri, 17 Nov 2017 04:16:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CKYm7gywjnBZ; Fri, 17 Nov 2017 04:16:05 -0800 (PST) Received: from vento.lan (177.17.214.168.dynamic.adsl.gvt.net.br [177.17.214.168]) by osg.samsung.com (Postfix) with ESMTPSA id 35CBE2B1EB; Fri, 17 Nov 2017 04:16:02 -0800 (PST) Date: Fri, 17 Nov 2017 10:15:59 -0200 From: Mauro Carvalho Chehab To: Gustavo Padovan 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 03/11] [media] vb2: add 'ordered_in_driver' property to queues Message-ID: <20171117101559.455cced3@vento.lan> In-Reply-To: <20171115171057.17340-4-gustavo@padovan.org> References: <20171115171057.17340-1-gustavo@padovan.org> <20171115171057.17340-4-gustavo@padovan.org> Organization: Samsung X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, 15 Nov 2017 15:10:49 -0200 Gustavo Padovan escreveu: > From: Gustavo Padovan > > We use ordered_in_driver property to optimize for the case where > the driver can deliver the buffers in an ordered fashion. When it > is ordered we can use the same fence context for all fences, but > when it is not we need to a new context for each out-fence. > > So the ordered_in_driver flag will help us with identifying the queues > that can be optimized and use the same fence context. > > v4: make the property a vector for optimization and not a mandatory thing > that drivers need to set if they want to use explicit synchronization. > > v3: improve doc (Hans Verkuil) > > v2: rename property to 'ordered_in_driver' to avoid confusion > > Signed-off-by: Gustavo Padovan > --- > include/media/videobuf2-core.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h > index ef9b64398c8c..38b9c8dd42c6 100644 > --- a/include/media/videobuf2-core.h > +++ b/include/media/videobuf2-core.h > @@ -440,6 +440,12 @@ struct vb2_buf_ops { > * @fileio_read_once: report EOF after reading the first buffer > * @fileio_write_immediately: queue buffer after each write() call > * @allow_zero_bytesused: allow bytesused == 0 to be passed to the driver > + * @ordered_in_driver: if the driver can guarantee that the queue will be > + * ordered or not, i.e., the buffers are dequeued from the driver > + * in the same order they are queued to the driver. The default > + * is not ordered unless the driver sets this flag. Setting it > + * when ordering can be guaranted helps to optimize explicit > + * fences. > * @quirk_poll_must_check_waiting_for_buffers: Return POLLERR at poll when QBUF > * has not been called. This is a vb1 idiom that has been adopted > * also by vb2. > @@ -510,6 +516,7 @@ struct vb2_queue { > unsigned fileio_read_once:1; > unsigned fileio_write_immediately:1; > unsigned allow_zero_bytesused:1; > + unsigned ordered_in_driver:1; As this may depend on the format, it is probably a good idea to set this flag either via a function argument or by a function that would be meant to update it, as video format changes. > unsigned quirk_poll_must_check_waiting_for_buffers:1; > > struct mutex *lock; -- Thanks, Mauro From 1584345883924503580@xxx Fri Nov 17 20:19:37 +0000 2017 X-GM-THRID: 1584154447667820390 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread