All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl
Subject: Re: [RFC 4/4] v4l: Tell user space we're using monotonic timestamps
Date: Thu, 08 Nov 2012 13:18:15 +0100	[thread overview]
Message-ID: <6798781.iK5M8mTgMg@avalon> (raw)
In-Reply-To: <20121105140432.GD25623@valkosipuli.retiisi.org.uk>

Hi Sakari,

On Monday 05 November 2012 16:04:32 Sakari Ailus wrote:
> On Sun, Nov 04, 2012 at 01:07:25PM +0100, Laurent Pinchart wrote:
> > On Wednesday 24 October 2012 21:16:23 Sakari Ailus wrote:
> ...
> 
> > > @@ -367,7 +368,8 @@ static void __fill_v4l2_buffer(struct vb2_buffer
> > > *vb,
> > > struct v4l2_buffer *b) /*
> > > 
> > >  	 * Clear any buffer state related flags.
> > >  	 */
> > > 
> > > -	b->flags &= ~V4L2_BUFFER_STATE_FLAGS;
> > > +	b->flags &= ~V4L2_BUFFER_MASK_FLAGS;
> > > +	b->flags |= V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> > 
> > That's an issue. Drivers that use videobuf2 would always be restricted to
> > monotonic timestamps in the future, even if they provide support for a
> > device- specific clock.
> > 
> > Would it instead make sense to pass a v4l2_buffer pointer to
> > v4l2_get_timestamp() and set the monotonic flag there ? Not all callers of
> > v4l2_get_timestamp() might have a v4l2_buffer pointer though.
> 
> For now, this patch assumes that all the VB2 users will use monotonic
> timestamps only. Once we have a good use case for different kind of
> timestamps and have agreed how to implement them, I was thinking of adding a
> similar function to v4l2_get_timestamp() but which would be VB2-aware, with
> one argument being the timestamp type. That function could then get the
> timestamp and apply the relevant flags.
> 
> Do you think it'd be enough to support changeable timestamp type for drivers
> using VB2 only?

Given that there's no reason to use anything else than VB2 in V4L2 drivers, I 
don't see any problem there.

How would that work in practice ? You won't be able to override the timestamp 
type flag unconditionally in __fill_v4l2_buffer() anymore.

> Alternatively we could make v4l2_get_timestamp() v4l2_buffer-aware, and for
> drivers that can't provide the buffer pointer we could just set the pointer
> to NULL, and v4l2_get_timestamp() could ignore it. The driver would then be
> responsible for setting the right flags to the buffer on its own. As far as
> I understand, this is essentially what you proposed.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2012-11-08 12:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 18:16 [RFC 0/4] Monotonic timestamps Sakari Ailus
2012-10-24 18:16 ` [RFC 1/4] v4l: Define video buffer flags for timestamp types Sakari Ailus
2012-11-04 12:05   ` Laurent Pinchart
2012-10-24 18:16 ` [RFC 2/4] v4l: Helper function for obtaining timestamps Sakari Ailus
2012-10-24 18:16 ` [RFC 3/4] v4l: Convert drivers to use monotonic timestamps Sakari Ailus
2012-10-24 18:16 ` [RFC 4/4] v4l: Tell user space we're using " Sakari Ailus
2012-11-04 12:07   ` Laurent Pinchart
2012-11-05 14:04     ` Sakari Ailus
2012-11-08 12:18       ` Laurent Pinchart [this message]
2012-11-08 22:33         ` Sakari Ailus
2012-11-12 12:17           ` Laurent Pinchart
2012-11-12 15:20             ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6798781.iK5M8mTgMg@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.