{
struct smfc_dev *smfc = priv;
struct smfc_ctx *ctx = v4l2_m2m_get_curr_priv(smfc->m2mdev);
+ ktime_t ktime;
enum vb2_buffer_state state = VB2_BUF_STATE_DONE;
u32 streamsize = smfc_get_streamsize(smfc);
u32 thumb_streamsize = smfc_get_2nd_streamsize(smfc);
bool suspending = false;
+ ktime = ktime_get();
+
if (!(smfc->flags & SMFC_DEV_RUNNING)) {
smfc_dump_registers(smfc);
BUG();
vb2_set_plane_payload(&vb_capture->vb2_buf, 1,
thumb_streamsize);
}
+
+ vb_capture->vb2_buf.timestamp =
+ (__u32)ktime_us_delta(ktime, ctx->ktime_beg);
+
v4l2_m2m_buf_done(v4l2_m2m_src_buf_remove(ctx->m2mctx), state);
v4l2_m2m_buf_done(vb_capture, state);
if (!suspending) {
ctx->smfc->flags |= SMFC_DEV_RUNNING;
spin_unlock_irqrestore(&ctx->smfc->flag_lock, flags);
+ ctx->ktime_beg = ktime_get();
+
smfc_hwconfigure_start(ctx, restart_interval, !!enable_hwfc);
return;
#ifndef _MEDIA_EXYNOS_SMFC_H_
#define _MEDIA_EXYNOS_SMFC_H_
+#include <linux/ktime.h>
+
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <media/v4l2-mem2mem.h>
struct v4l2_ctrl_handler v4l2_ctrlhdlr;
struct smfc_dev *smfc;
struct v4l2_m2m_ctx *m2mctx;
+ ktime_t ktime_beg;
u32 flags;
/* uncomressed image description */
const struct smfc_image_format *img_fmt;