Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933207AbeALL5w (ORCPT + 1 other); Fri, 12 Jan 2018 06:57:52 -0500 Received: from lb1-smtp-cloud8.xs4all.net ([194.109.24.21]:41029 "EHLO lb1-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932489AbeALL5u (ORCPT ); Fri, 12 Jan 2018 06:57:50 -0500 Subject: Re: [PATCH v7 1/6] [media] vb2: add is_unordered callback for drivers To: Gustavo Padovan , linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , Brian Starkey , Thierry Escande , linux-kernel@vger.kernel.org, Gustavo Padovan References: <20180110160732.7722-1-gustavo@padovan.org> <20180110160732.7722-2-gustavo@padovan.org> From: Hans Verkuil Message-ID: Date: Fri, 12 Jan 2018 12:57:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180110160732.7722-2-gustavo@padovan.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfHEQoDQPhvvflOsb7Wa+Ng36lOXWVCVQaLIq8rvvx5+PusO0IIb0bNKDYdM3M7wPSGSyBcNPzBBTNkJ223aiagdcCmVtHrCE4Tmd/IEzG8i0DdZoctaL KZgtr6J37ccYKH1ZNfjCLMkRwnrwM0i+2d627cQZf3Taktr/VDhQXzqUBRDgdCM4xQJdoF4Vi2bPkwh0WlsloPUonw81cy9uMPgtEMUlelNBC/fb+OVuQPD8 Epxiz53JSgu2zVMibZHYDqaBNKbpL8hXypfWSEt1j0CnOBUPAwjl0U2rTVHwJWN5d8Y939fVT3BZOwRHKT5HchFoJHI0sa7ZGucxAI3h3PO9hY+wDOX01xYE 1t6QRL5LUW7VNVXcUp+T3EYwZdqectHfVcDPkdgbNhf5XcjsNWV9em8LwRUAJ/3jiLrKjcxm06mwVcjzuryXU/gJTXPGzIzWZbBsz+fwkI6h5yEEOXkld+ZG MKwnARpeKcSx0G3nx/QZpcgkM0zESQsivOHQ+Wx7acWaHjUsKJeIKHwRRhmp8fwxCNwj1EmXNWUm/qfymrq/dNN/XnAbx9tYv8FDQRKHl539emdP8xVCzjaY n3U= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/10/18 17:07, Gustavo Padovan wrote: > From: Gustavo Padovan > > Explicit synchronization benefits a lot from ordered queues, they fit > better in a pipeline with DRM for example so create a opt-in way for > drivers notify videobuf2 that the queue is unordered. > > Drivers don't need implement it if the queue is ordered. > > Signed-off-by: Gustavo Padovan > --- > include/media/videobuf2-core.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h > index f3ee4c7c2fb3..583cdc06de79 100644 > --- a/include/media/videobuf2-core.h > +++ b/include/media/videobuf2-core.h > @@ -370,6 +370,9 @@ struct vb2_buffer { > * callback by calling vb2_buffer_done() with either > * %VB2_BUF_STATE_DONE or %VB2_BUF_STATE_ERROR; may use > * vb2_wait_for_all_buffers() function > + * @is_unordered: tell if the queue format is unordered. The default is I'd replace the first sentence by this: "tell if the queue is unordered, i.e. buffers can be dequeued in a different order from how they were queued." Regards, Hans > + * assumed to be ordered and this function only needs to > + * be implemented for unordered queues. > * @buf_queue: passes buffer vb to the driver; driver may start > * hardware operation on this buffer; driver should give > * the buffer back by calling vb2_buffer_done() function; > @@ -393,6 +396,7 @@ struct vb2_ops { > > int (*start_streaming)(struct vb2_queue *q, unsigned int count); > void (*stop_streaming)(struct vb2_queue *q); > + int (*is_unordered)(struct vb2_queue *q); > > void (*buf_queue)(struct vb2_buffer *vb); > }; > @@ -566,6 +570,7 @@ struct vb2_queue { > u32 cnt_wait_finish; > u32 cnt_start_streaming; > u32 cnt_stop_streaming; > + u32 cnt_is_unordered; > #endif > }; > >