From ddf4eef1c252fe19a779c9641cec91f3409eca18 Mon Sep 17 00:00:00 2001 From: Ninad Patgaonkar Date: Fri, 7 Dec 2012 11:07:22 -0800 Subject: [PATCH] msm: camera: Copy the frame_id from the diverted frame. When a frame diverted to daemon for postprocessing is being sent to user, copy the frame_id from the diverted frame along with the timestamp information. Otherwise user will not be able to match this frame with other frames based on its frame_id. Change-Id: I1d2ed83361ca90e89d27925830cae08226d05483 Signed-off-by: Kiran Kumar H N Signed-off-by: Ninad Patgaonkar --- drivers/media/video/msm/msm.h | 2 ++ drivers/media/video/msm/msm_mctl_buf.c | 8 +++++--- drivers/media/video/msm/msm_mctl_pp.c | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/msm/msm.h b/drivers/media/video/msm/msm.h index cb59d682901..42d7d6bbfa0 100644 --- a/drivers/media/video/msm/msm.h +++ b/drivers/media/video/msm/msm.h @@ -210,11 +210,13 @@ struct msm_cam_return_frame_info { int dirty; int node_type; struct timeval timestamp; + uint32_t frame_id; }; struct msm_cam_timestamp { uint8_t present; struct timeval timestamp; + uint32_t frame_id; }; struct msm_cam_buf_map_info { diff --git a/drivers/media/video/msm/msm_mctl_buf.c b/drivers/media/video/msm/msm_mctl_buf.c index 766f937907a..6e85aca13d0 100644 --- a/drivers/media/video/msm/msm_mctl_buf.c +++ b/drivers/media/video/msm/msm_mctl_buf.c @@ -434,10 +434,11 @@ int msm_mctl_buf_done_proc( D("%s Copying timestamp as %ld.%ld", __func__, cam_ts->timestamp.tv_sec, cam_ts->timestamp.tv_usec); buf->vidbuf.v4l2_buf.timestamp = cam_ts->timestamp; + buf->vidbuf.v4l2_buf.sequence = cam_ts->frame_id; } - CDBG("In Buf_done:Notify user frame id %d img mode %d\n", - buf->vidbuf.v4l2_buf.sequence, - pcam_inst->image_mode); + D("%s Notify user about buffer %d image_mode %d frame_id %d", __func__, + buf->vidbuf.v4l2_buf.index, pcam_inst->image_mode, + buf->vidbuf.v4l2_buf.sequence); vb2_buffer_done(&buf->vidbuf, VB2_BUF_STATE_DONE); return 0; } @@ -812,6 +813,7 @@ int msm_mctl_buf_done_pp(struct msm_cam_media_controller *pmctl, __func__, pcam_inst, frame->ch_paddr[0], ret_frame->dirty); cam_ts.present = 1; cam_ts.timestamp = ret_frame->timestamp; + cam_ts.frame_id = ret_frame->frame_id; if (ret_frame->dirty) /* the frame is dirty, not going to disptach to app */ rc = msm_mctl_release_free_buf(pmctl, pcam_inst, frame); diff --git a/drivers/media/video/msm/msm_mctl_pp.c b/drivers/media/video/msm/msm_mctl_pp.c index a114b373f41..105426e3c39 100644 --- a/drivers/media/video/msm/msm_mctl_pp.c +++ b/drivers/media/video/msm/msm_mctl_pp.c @@ -636,6 +636,9 @@ int msm_mctl_pp_done( ret_frame.dirty = dirty; ret_frame.node_type = 0; ret_frame.timestamp = frame.timestamp; + ret_frame.frame_id = frame.frame_id; + D("%s frame_id: %d buffer idx %d\n", __func__, + frame.frame_id, frame.buf_idx); rc = msm_mctl_buf_done_pp(p_mctl, &buf_handle, &buf, &ret_frame); return rc; }