Merge "msm: vidc: Add control to handle timestamp reorder"

This commit is contained in:
qctecmdr 2020-09-28 09:55:30 -07:00 committed by Gerrit - the friendly Code Review server
commit e93fd8adfa
4 changed files with 33 additions and 3 deletions

View File

@ -258,6 +258,8 @@ enum v4l2_mpeg_vidc_video_bitrate_savings_type {
(V4L2_CID_MPEG_MSM_VIDC_BASE + 134)
#define V4L2_CID_MPEG_VIDC_VENC_QPRANGE_BOOST \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 135)
#define V4L2_CID_MPEG_VIDC_VIDEO_DISABLE_TIMESTAMP_REORDER \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 136)
#define V4L2_CID_MPEG_VIDC_VIDEO_UNKNOWN \
(V4L2_CID_MPEG_MSM_VIDC_BASE + 0xFFF)

View File

@ -420,6 +420,15 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = {
.default_value = V4L2_MPEG_MSM_VIDC_DISABLE,
.step = 1,
},
{
.id = V4L2_CID_MPEG_VIDC_VIDEO_DISABLE_TIMESTAMP_REORDER,
.name = "Disable TimeStamp Reorder",
.type = V4L2_CTRL_TYPE_BOOLEAN,
.minimum = V4L2_MPEG_MSM_VIDC_DISABLE,
.maximum = V4L2_MPEG_MSM_VIDC_ENABLE,
.default_value = V4L2_MPEG_MSM_VIDC_DISABLE,
.step = 1,
},
{
.id = V4L2_CID_MPEG_VIDC_SUPERFRAME,
.name = "Superframe",
@ -952,6 +961,8 @@ int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
break;
case V4L2_CID_MPEG_VIDC_VIDEO_LOWLATENCY_HINT:
break;
case V4L2_CID_MPEG_VIDC_VIDEO_DISABLE_TIMESTAMP_REORDER:
break;
case V4L2_CID_MPEG_VIDC_VDEC_HEIF_MODE:
if(get_v4l2_codec(inst) != V4L2_PIX_FMT_HEVC)
break;

View File

@ -433,7 +433,7 @@ int msm_vidc_qbuf(void *instance, struct media_device *mdev,
timestamp_us = (s64)((b->timestamp.tv_sec * 1000000) +
b->timestamp.tv_usec);
if (is_decode_session(inst) && b->type == INPUT_MPLANE &&
!is_heif_decoder(inst) && !is_secure_session(inst)) {
is_ts_reorder_allowed(inst)) {
if (inst->flush_timestamps)
msm_comm_release_timestamps(inst);
inst->flush_timestamps = false;
@ -515,8 +515,7 @@ int msm_vidc_dqbuf(void *instance, struct v4l2_buffer *b)
if (is_decode_session(inst) &&
b->type == OUTPUT_MPLANE &&
!(b->flags & V4L2_BUF_FLAG_CODECCONFIG) &&
!is_heif_decoder(inst) &&
!is_secure_session(inst))
is_ts_reorder_allowed(inst))
msm_comm_fetch_ts_framerate(inst, b);
return rc;

View File

@ -159,6 +159,24 @@ static inline bool is_secure_session(struct msm_vidc_inst *inst)
return !!(inst->flags & VIDC_SECURE);
}
static inline bool is_ts_reorder_allowed(struct msm_vidc_inst *inst)
{
struct v4l2_ctrl *ctrl;
if (is_secure_session(inst))
return false;
if (inst->session_type != MSM_VIDC_DECODER)
return true;
if (!is_heif_decoder(inst))
return true;
ctrl = get_ctrl(inst,
V4L2_CID_MPEG_VIDC_VIDEO_DISABLE_TIMESTAMP_REORDER);
return !ctrl->val;
}
static inline bool is_decode_session(struct msm_vidc_inst *inst)
{
return inst->session_type == MSM_VIDC_DECODER;