Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933286AbeALMFN (ORCPT + 1 other); Fri, 12 Jan 2018 07:05:13 -0500 Received: from lb2-smtp-cloud8.xs4all.net ([194.109.24.25]:35776 "EHLO lb2-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932797AbeALMFM (ORCPT ); Fri, 12 Jan 2018 07:05:12 -0500 Subject: Re: [PATCH v7 2/6] [media] v4l: add 'unordered' flag to format description ioctl 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-3-gustavo@padovan.org> From: Hans Verkuil Message-ID: Date: Fri, 12 Jan 2018 13:05:06 +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-3-gustavo@padovan.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfCSREopMFBh+6551kBqNll1cB4vem7Yb6UYmiwarnbfTGv/L4L2Ed6KF037nUvQ/q6aEWu+Rl9VInyszMPVZJou+TCQqFKWfqF7aJCteViEHTEL/1cPv r3mo/1R+MsFhxKe8T7htFQUPt1FNuK82aLou4N7Tx7UORcJOSi6yCklSh155MPKg/TEwXqoIhkNgZamhdQ1+5G2avS771P42fDVgytS8DUWBA1c2QZRIaUBD YbHWtXXLFooaH0wo5ZLbodLvMejx15G551owHvOVtVz1gL2k7tsv0hyzYPLBauEEVaMy7LwGdpJc/7dWb8lhrGELAMdzyH1NBjAr1mQDx2aOSLhiP0CJasZ7 gYObMn+ibz/qOq1jifdvEJamS8vNq8BuGuTVbEK0dAlyNN7dan627z/3QlMBxD4DK7iput2X1yms70Gjf9cyW8Y30Qnkqm0277AMnPHhGs8zHgwGQm7efTjo EWGhe4PpNVv2NML9HTpvxOb8ZVMSzyo6g5oFGSBhXQI5bfP52yAQG9Y6DruzvTww8bS5GUeZK936vRnm7OzMNklKHE8pkE6AarYRmRk/iEt+OXj+gRuOtvdQ 0Tk= 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 > > For explicit synchronization it important for userspace to know if the > format being used by the driver can deliver the buffers back to userspace > in the same order they were queued with QBUF. > > Ordered streams fits nicely in a pipeline with DRM for example, where > ordered buffer are expected. > > Signed-off-by: Gustavo Padovan > --- > Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 3 +++ > include/uapi/linux/videodev2.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst > index 019c513df217..368115f44fc0 100644 > --- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst > +++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst > @@ -116,6 +116,9 @@ one until ``EINVAL`` is returned. > - This format is not native to the device but emulated through > software (usually libv4l2), where possible try to use a native > format instead for better performance. > + * - ``V4L2_FMT_FLAG_UNORDERED`` > + - 0x0004 > + - This is a format that doesn't guarantee timely order of frames. I'd rephrase this: "This format doesn't guarantee ordered buffer handling. I.e. the order in which buffers are dequeued with VIDIOC_DQBUF may be different from the order in which they were queued with VIDIOC_QBUF." (Use proper links to VIDIOC_(D)QBUF) I would also like to see an example of a driver that uses this. The cobalt driver is a candidate for this. Regards, Hans > > > Return Value > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 982718965180..58894cfe9479 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -716,6 +716,7 @@ struct v4l2_fmtdesc { > > #define V4L2_FMT_FLAG_COMPRESSED 0x0001 > #define V4L2_FMT_FLAG_EMULATED 0x0002 > +#define V4L2_FMT_FLAG_UNORDERED 0x0004 > > /* Frame Size and frame rate enumeration */ > /* >