Received: by 10.223.164.202 with SMTP id h10csp910844wrb; Fri, 17 Nov 2017 10:37:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMaZQF3rUFZHjEvgq7lMIqmZA46NcyQaoAa6TIaykZ9yVmnyAnsb/R1Y+HHXD52mQcBIvOxW X-Received: by 10.98.1.145 with SMTP id 139mr2975230pfb.135.1510943857761; Fri, 17 Nov 2017 10:37:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510943857; cv=none; d=google.com; s=arc-20160816; b=x/MknlN4nmsqgEbjXAWMi0tt9xWCjqmXfrOZNXmLFOo75Y9VVJg3brHvQq/wBhXNXR A6DA+1kBrF06z2xkbjPMw1Zv17GdKdW6HV+gP3VjV9ooi1t28H5BXKvjWiXcVLrz0T9D 1Rjhc23BsPuJwO8HUDnkUxYL1hwMQRuvRBBAbNjgLvjcjCV3JEUYlKCrbiAbk/ASAO2d Wqywdc0icwBbeMZ/g4sifmcE0vlVsBqkoz7IgO5x3VzWjnyPmeO2X8Q2Kap2mXZHipmY 5KaRZkADZeQKig0/yY04sc8seyygG6FTXPc2X8SU+UmcnHuli4dZMU0tHqr5uoXhI15E SVOQ== 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=nAbGs4TClVtpYi34N/XcbywN0KOEXUVfkVek+HRDyE0=; b=XgBHX7Ds4HMEOqBGh2Ry/IS7CRgFjSwdEOylc1w9tmfHsvTOKR7+JkCrlulEdcFGee rKw89M1VOV8swAcLpBatzICZRkK3pMdjijT4WgnwuwvKB6NrFioo5z2U9NzlNVMZ8413 Q4CWUh0433ezMqRNE/Ltt6INm1o7DK5eJVms5kQ/qk60TEmAhxV4KODMi51ZucacMDGn +Cw0UX+E3pdCJddDLhicazrq37HuSP6/MeNECaVQkcgsBE1zMIDN8yhpFWioLKhynIBy Z2l3nyXBBRLEp7sOySkZ2tGT2Vwr++OGk5CWI3CixLC8k/L78gARaT3TBrE+cZppIce2 ZEmg== 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 e14si3072692pgq.177.2017.11.17.10.37.24; Fri, 17 Nov 2017 10:37:37 -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 S1755626AbdKQM1Y (ORCPT + 93 others); Fri, 17 Nov 2017 07:27:24 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:35146 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950AbdKQM1Q (ORCPT ); Fri, 17 Nov 2017 07:27:16 -0500 Received: by mail-qt0-f194.google.com with SMTP id n32so5525357qtb.2; Fri, 17 Nov 2017 04:27:15 -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=nAbGs4TClVtpYi34N/XcbywN0KOEXUVfkVek+HRDyE0=; b=Bvm/zdg1EmB3iDbsMKcaDsOLk6VFKiQhFXSl5Fo1zAqJiSnx04tqroZlPvOAF/PMRB sSS2py2E0IzcpheOCHw1iAEDGXlJnff9c77s5t5xcUdMpNyniguylKC2Ht6p1DNZ6FC5 61Z6ZgDmm26qRuhraHpY7WG9zWvDIL/IvLNAWU5gEjWWIDePzuXKu5a4LjI4I8GysKeG ZE5+7isWjsQPadu31pSdEhKGZ26THSUZBRh/WTL1jbdOepVMmONla1AOd1CBZ5Gj2+oE ly1SIv0zLSGRnVEfhByrFY6igFHlCin30l27kxX6c2icAd1RSGjkNMZtJpqKICGp9PF5 Mn2A== X-Gm-Message-State: AJaThX4nmevnWZE8/UdImOAFXUh+snu8PnDtwYeQ5WM3dUoieMwvOVOX OyiCivby2ytHK0WHrbTpb2Y= X-Received: by 10.55.43.134 with SMTP id r6mr7353054qkr.266.1510921635312; Fri, 17 Nov 2017 04:27:15 -0800 (PST) Received: from jade ([179.97.166.229]) by smtp.gmail.com with ESMTPSA id d184sm2482861qka.15.2017.11.17.04.27.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 04:27:14 -0800 (PST) Date: Fri, 17 Nov 2017 10:27:10 -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 03/11] [media] vb2: add 'ordered_in_driver' property to queues Message-ID: <20171117122710.GF19033@jade> References: <20171115171057.17340-1-gustavo@padovan.org> <20171115171057.17340-4-gustavo@padovan.org> <20171117101559.455cced3@vento.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171117101559.455cced3@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 Hi Mauro, 2017-11-17 Mauro Carvalho Chehab : > 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. Right, and maybe I can find a way to store this in only one place, istead of what I did here (having to set explicitely both the ordered_in_driver and the flag separatedly) Gustavo From 1584320648098905787@xxx Fri Nov 17 13:38:31 +0000 2017 X-GM-THRID: 1584154447667820390 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread