diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-05-07 11:37:40 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2012-05-17 10:43:44 +0530 |
commit | 4bb7abf48170da62279afcaf3fb3ff0de94b73d2 (patch) | |
tree | dd64615ce7fac32343be7cedf71fb29882909eb2 | |
parent | a5246ffda3e71e526f40ae2a87c913eb5fb1f58d (diff) |
MFC: Add s_ctrl & g_ctrl to set and read SET_FRAME_TAG valuestracking-samslt-mfc-3.4-2012.05-1tracking-samslt-mfc-3.4-2012.05-0
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
-rw-r--r-- | drivers/media/video/s5p-mfc/s5p_mfc_common.h | 1 | ||||
-rw-r--r-- | drivers/media/video/s5p-mfc/s5p_mfc_dec.c | 16 | ||||
-rw-r--r-- | drivers/media/video/s5p-mfc/s5p_mfc_opr.c | 4 | ||||
-rw-r--r-- | drivers/media/video/v4l2-ctrls.c | 7 | ||||
-rw-r--r-- | include/linux/videodev2.h | 5 |
5 files changed, 32 insertions, 1 deletions
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_common.h b/drivers/media/video/s5p-mfc/s5p_mfc_common.h index 91146fa622e..2dcad7bd25e 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/video/s5p-mfc/s5p_mfc_common.h @@ -532,6 +532,7 @@ struct s5p_mfc_ctx { struct v4l2_ctrl *ctrls[MFC_MAX_CTRLS]; struct v4l2_ctrl_handler ctrl_handler; + unsigned int frame_tag; }; /* diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c index c25ec022d26..b03ee5ef906 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c @@ -167,6 +167,16 @@ static struct mfc_control controls[] = { .default_value = 1, .is_volatile = 1, }, + { + .id = V4L2_CID_CODEC_FRAME_TAG, + .type = V4L2_CTRL_TYPE_INTEGER, + .name = "Frame Tag", + .minimum = 0, + .maximum = INT_MAX, + .step = 1, + .default_value = 0, + .is_volatile = 1, + }, }; #define NUM_CTRLS ARRAY_SIZE(controls) @@ -638,6 +648,9 @@ static int s5p_mfc_dec_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: ctx->slice_interface = ctrl->val; break; + case V4L2_CID_CODEC_FRAME_TAG: + ctx->frame_tag = ctrl->val; + break; default: mfc_err("Invalid control 0x%08x\n", ctrl->id); return -EINVAL; @@ -672,6 +685,9 @@ static int s5p_mfc_dec_g_v_ctrl(struct v4l2_ctrl *ctrl) return -EINVAL; } break; + case V4L2_CID_CODEC_FRAME_TAG: + ctrl->val = s5p_mfc_read_shm(ctx, GET_FRAME_TAG_TOP); + break; } return 0; } diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_opr.c b/drivers/media/video/s5p-mfc/s5p_mfc_opr.c index e08b21c50eb..c3aac539ee0 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_opr.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_opr.c @@ -1003,6 +1003,8 @@ int s5p_mfc_init_decode(struct s5p_mfc_ctx *ctx) mfc_write(dev, ((S5P_FIMV_CH_SEQ_HEADER & S5P_FIMV_CH_MASK) << S5P_FIMV_CH_SHIFT) | (ctx->inst_no), S5P_FIMV_SI_CH0_INST_ID); + + return 0; } @@ -1029,6 +1031,8 @@ int s5p_mfc_decode_one_frame(struct s5p_mfc_ctx *ctx, mfc_write(dev, ctx->dec_dst_flag, S5P_FIMV_SI_CH0_RELEASE_BUF); s5p_mfc_set_shared_buffer(ctx); s5p_mfc_set_flush(ctx, ctx->dpb_flush_flag); + + s5p_mfc_write_shm(ctx, ctx->frame_tag, S5P_FIMV_SHARED_SET_FRAME_TAG); /* Issue different commands to instance basing on whether it * is the last frame or not. */ switch (last_frame) { diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 18015c0a8d3..e6c058a04b3 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -575,6 +575,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_VBV_SIZE: return "VBV Buffer Size"; case V4L2_CID_MPEG_VIDEO_DEC_PTS: return "Video Decoder PTS"; case V4L2_CID_MPEG_VIDEO_DEC_FRAME: return "Video Decoder Frame Count"; + case V4L2_CID_CODEC_FRAME_TAG: return "Video Decoder Frame Tag"; /* CAMERA controls */ /* Keep the order of the 'case's the same as in videodev2.h! */ @@ -757,6 +758,12 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, /* Max is calculated as RGB888 that is 2^24 */ *max = 0xFFFFFF; break; + case V4L2_CID_CODEC_FRAME_TAG: + *type = V4L2_CTRL_TYPE_INTEGER; + *step = 1; + *min = 0; + *max = INT_MAX; + break; case V4L2_CID_FLASH_FAULT: case V4L2_CID_JPEG_ACTIVE_MARKER: *type = V4L2_CTRL_TYPE_BITMASK; diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index c9c9a4680cc..045ffc98189 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1264,8 +1264,11 @@ enum v4l2_colorfx { #define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41) +#define V4L2_CID_CODEC_FRAME_TAG (V4L2_CID_BASE+42) + /* last CID + 1 */ -#define V4L2_CID_LASTP1 (V4L2_CID_BASE+42) +#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43) + /* MPEG-class control IDs defined by V4L2 */ #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |