[media] use v4l2_get_timestamp where possible
This is a preparation for a change to the type of v4l2 timestamps. v4l2_get_timestamp() is a helper function that reads the monotonic time and stores it into a 'struct timeval'. Multiple drivers implement the same thing themselves for historic reasons. Changing them all to use v4l2_get_timestamp() is more consistent and reduces the amount of code duplication, and most importantly simplifies the following changes. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> [hans.verkuil@cisco.com: dropped the v4l2-dev.c patch that didn't belong here] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
2ef3b6fe9e
commit
5ba0e2c3ad
@@ -3625,13 +3625,10 @@ static void
|
||||
bttv_irq_wakeup_vbi(struct bttv *btv, struct bttv_buffer *wakeup,
|
||||
unsigned int state)
|
||||
{
|
||||
struct timeval ts;
|
||||
|
||||
if (NULL == wakeup)
|
||||
return;
|
||||
|
||||
v4l2_get_timestamp(&ts);
|
||||
wakeup->vb.ts = ts;
|
||||
v4l2_get_timestamp(&wakeup->vb.ts);
|
||||
wakeup->vb.field_count = btv->field_count;
|
||||
wakeup->vb.state = state;
|
||||
wake_up(&wakeup->vb.done);
|
||||
|
@@ -202,7 +202,7 @@ static void cx18_mdl_send_to_videobuf(struct cx18_stream *s,
|
||||
}
|
||||
|
||||
if (dispatch) {
|
||||
vb_buf->vb.ts = ktime_to_timeval(ktime_get());
|
||||
v4l2_get_timestamp(&vb_buf->vb.ts);
|
||||
list_del(&vb_buf->vb.queue);
|
||||
vb_buf->vb.state = VIDEOBUF_DONE;
|
||||
wake_up(&vb_buf->vb.done);
|
||||
|
Reference in New Issue
Block a user