media: zoran: use u64 for the timestamp internally
Just like vb2 does, use u64 internally to store the timestamps of the buffers. Only convert to timeval when interfacing with userspace. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
459d2a5d1e
commit
7b6b9a8c36
@ -35,7 +35,7 @@ struct zoran_sync {
|
||||
unsigned long frame; /* number of buffer that has been free'd */
|
||||
unsigned long length; /* number of code bytes in buffer (capture only) */
|
||||
unsigned long seq; /* frame sequence number */
|
||||
struct timeval timestamp; /* timestamp */
|
||||
u64 ts; /* timestamp */
|
||||
};
|
||||
|
||||
|
||||
|
@ -1151,7 +1151,7 @@ zoran_reap_stat_com (struct zoran *zr)
|
||||
}
|
||||
frame = zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME];
|
||||
buffer = &zr->jpg_buffers.buffer[frame];
|
||||
v4l2_get_timestamp(&buffer->bs.timestamp);
|
||||
buffer->bs.ts = ktime_get_ns();
|
||||
|
||||
if (zr->codec_mode == BUZ_MODE_MOTION_COMPRESS) {
|
||||
buffer->bs.length = (stat_com & 0x7fffff) >> 1;
|
||||
@ -1389,7 +1389,7 @@ zoran_irq (int irq,
|
||||
|
||||
zr->v4l_buffers.buffer[zr->v4l_grab_frame].state = BUZ_STATE_DONE;
|
||||
zr->v4l_buffers.buffer[zr->v4l_grab_frame].bs.seq = zr->v4l_grab_seq;
|
||||
v4l2_get_timestamp(&zr->v4l_buffers.buffer[zr->v4l_grab_frame].bs.timestamp);
|
||||
zr->v4l_buffers.buffer[zr->v4l_grab_frame].bs.ts = ktime_get_ns();
|
||||
zr->v4l_grab_frame = NO_GRAB_ACTIVE;
|
||||
zr->v4l_pend_tail++;
|
||||
}
|
||||
|
@ -1354,7 +1354,7 @@ static int zoran_v4l2_buffer_status(struct zoran_fh *fh,
|
||||
fh->buffers.buffer[num].state == BUZ_STATE_USER) {
|
||||
buf->sequence = fh->buffers.buffer[num].bs.seq;
|
||||
buf->flags |= V4L2_BUF_FLAG_DONE;
|
||||
buf->timestamp = fh->buffers.buffer[num].bs.timestamp;
|
||||
buf->timestamp = ns_to_timeval(fh->buffers.buffer[num].bs.ts);
|
||||
} else {
|
||||
buf->flags |= V4L2_BUF_FLAG_QUEUED;
|
||||
}
|
||||
@ -1388,7 +1388,7 @@ static int zoran_v4l2_buffer_status(struct zoran_fh *fh,
|
||||
if (fh->buffers.buffer[num].state == BUZ_STATE_DONE ||
|
||||
fh->buffers.buffer[num].state == BUZ_STATE_USER) {
|
||||
buf->sequence = fh->buffers.buffer[num].bs.seq;
|
||||
buf->timestamp = fh->buffers.buffer[num].bs.timestamp;
|
||||
buf->timestamp = ns_to_timeval(fh->buffers.buffer[num].bs.ts);
|
||||
buf->bytesused = fh->buffers.buffer[num].bs.length;
|
||||
buf->flags |= V4L2_BUF_FLAG_DONE;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user