video: driver: Enable encoder and decoder metadata
-Add support to set metadata controls. -Adjust set/get format for metadata ports. -Add check when queuing metadata buffers. Change-Id: I73725e26106621386dcb62cbf916186b9bc43995 Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
This commit is contained in:
@@ -951,6 +951,90 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
|||||||
|
|
||||||
{CODEC_CONFIG, DEC, H264|HEVC, 0, 1, 1, 0,
|
{CODEC_CONFIG, DEC, H264|HEVC, 0, 1, 1, 0,
|
||||||
V4L2_CID_MPEG_VIDC_CODEC_CONFIG},
|
V4L2_CID_MPEG_VIDC_CODEC_CONFIG},
|
||||||
|
|
||||||
|
{META_LTR_MARK_USE, ENC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_LTR_MARK_USE_DETAILS,
|
||||||
|
HFI_PROP_LTR_MARK_USE_DETAILS},
|
||||||
|
|
||||||
|
{META_SEQ_HDR_NAL, ENC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_SEQ_HEADER_NAL,
|
||||||
|
HFI_PROP_METADATA_SEQ_HEADER_NAL},
|
||||||
|
|
||||||
|
{META_DPB_MISR, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_DPB_LUMA_CHROMA_MISR,
|
||||||
|
HFI_PROP_DPB_LUMA_CHROMA_MISR},
|
||||||
|
|
||||||
|
{META_OPB_MISR, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_OPB_LUMA_CHROMA_MISR,
|
||||||
|
HFI_PROP_OPB_LUMA_CHROMA_MISR},
|
||||||
|
|
||||||
|
{META_INTERLACE, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_INTERLACE,
|
||||||
|
HFI_PROP_INTERLACE_INFO},
|
||||||
|
|
||||||
|
{META_CONCEALED_MB_CNT, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_CONCEALED_MB_COUNT,
|
||||||
|
HFI_PROP_CONEALED_MB_COUNT},
|
||||||
|
|
||||||
|
{META_HIST_INFO, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_HISTOGRAM_INFO,
|
||||||
|
HFI_PROP_HISTOGRAM_INFO},
|
||||||
|
|
||||||
|
{META_SEI_MASTERING_DISP, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_SEI_MASTERING_DISPLAY_COLOUR,
|
||||||
|
HFI_PROP_SEI_MASTERING_DISPLAY_COLOUR},
|
||||||
|
|
||||||
|
{META_SEI_CLL, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_SEI_CONTENT_LIGHT_LEVEL,
|
||||||
|
HFI_PROP_SEI_CONTENT_LIGHT_LEVEL},
|
||||||
|
|
||||||
|
{META_HDR10PLUS, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_HDR10PLUS,
|
||||||
|
HFI_PROP_SEI_HDR10PLUS_USERDATA},
|
||||||
|
|
||||||
|
{META_EVA_STATS, ENC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_EVA_STATS,
|
||||||
|
HFI_PROP_EVA_STAT_INFO},
|
||||||
|
|
||||||
|
{META_BUF_TAG, DEC | ENC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_BUFFER_TAG,
|
||||||
|
HFI_PROP_BUFFER_TAG},
|
||||||
|
|
||||||
|
{META_SUBFRAME_OUTPUT, DEC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_SUBFRAME_OUTPUT,
|
||||||
|
HFI_PROP_SUBFRAME_OUTPUT},
|
||||||
|
|
||||||
|
{META_ROI_INFO, ENC, CODECS_ALL,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_METADATA_ROI_INFO,
|
||||||
|
HFI_PROP_ROI_INFO},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -61,6 +61,55 @@ static inline is_internal_buffer(enum msm_vidc_buffer_type buffer_type)
|
|||||||
buffer_type == MSM_VIDC_BUF_VPSS;
|
buffer_type == MSM_VIDC_BUF_VPSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool is_input_meta_enabled(struct msm_vidc_inst *inst)
|
||||||
|
{
|
||||||
|
bool enabled = false;
|
||||||
|
|
||||||
|
if (is_decode_session(inst)) {
|
||||||
|
enabled = inst->capabilities->cap[META_BUF_TAG].value ?
|
||||||
|
true : false;
|
||||||
|
} else if (is_encode_session(inst)) {
|
||||||
|
enabled = (inst->capabilities->cap[META_LTR_MARK_USE].value ||
|
||||||
|
inst->capabilities->cap[META_SEQ_HDR_NAL].value ||
|
||||||
|
inst->capabilities->cap[META_EVA_STATS].value ||
|
||||||
|
inst->capabilities->cap[META_BUF_TAG].value);
|
||||||
|
}
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool is_output_meta_enabled(struct msm_vidc_inst *inst)
|
||||||
|
{
|
||||||
|
bool enabled = false;
|
||||||
|
|
||||||
|
if (is_decode_session(inst)) {
|
||||||
|
enabled = (inst->capabilities->cap[META_DPB_MISR].value ||
|
||||||
|
inst->capabilities->cap[META_OPB_MISR].value ||
|
||||||
|
inst->capabilities->cap[META_INTERLACE].value ||
|
||||||
|
inst->capabilities->cap[META_CONCEALED_MB_CNT].value ||
|
||||||
|
inst->capabilities->cap[META_HIST_INFO].value ||
|
||||||
|
inst->capabilities->cap[META_SEI_MASTERING_DISP].value ||
|
||||||
|
inst->capabilities->cap[META_SEI_CLL].value ||
|
||||||
|
inst->capabilities->cap[META_BUF_TAG].value ||
|
||||||
|
inst->capabilities->cap[META_SUBFRAME_OUTPUT].value);
|
||||||
|
} else if (is_encode_session(inst)) {
|
||||||
|
enabled = inst->capabilities->cap[META_BUF_TAG].value ?
|
||||||
|
true : false;
|
||||||
|
}
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool is_meta_enabled(struct msm_vidc_inst *inst, unsigned int type)
|
||||||
|
{
|
||||||
|
bool enabled = false;
|
||||||
|
|
||||||
|
if (type == MSM_VIDC_BUF_INPUT)
|
||||||
|
enabled = is_input_meta_enabled(inst);
|
||||||
|
else if (type == MSM_VIDC_BUF_OUTPUT)
|
||||||
|
enabled = is_output_meta_enabled(inst);
|
||||||
|
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool is_linear_colorformat(enum msm_vidc_colorformat_type colorformat)
|
static inline bool is_linear_colorformat(enum msm_vidc_colorformat_type colorformat)
|
||||||
{
|
{
|
||||||
return colorformat == MSM_VIDC_FMT_NV12 ||
|
return colorformat == MSM_VIDC_FMT_NV12 ||
|
||||||
|
@@ -340,6 +340,20 @@ enum msm_vidc_inst_capability_type {
|
|||||||
CODED_FRAMES,
|
CODED_FRAMES,
|
||||||
BIT_DEPTH,
|
BIT_DEPTH,
|
||||||
CODEC_CONFIG,
|
CODEC_CONFIG,
|
||||||
|
META_LTR_MARK_USE,
|
||||||
|
META_SEQ_HDR_NAL,
|
||||||
|
META_DPB_MISR,
|
||||||
|
META_OPB_MISR,
|
||||||
|
META_INTERLACE,
|
||||||
|
META_CONCEALED_MB_CNT,
|
||||||
|
META_HIST_INFO,
|
||||||
|
META_SEI_MASTERING_DISP,
|
||||||
|
META_SEI_CLL,
|
||||||
|
META_HDR10PLUS,
|
||||||
|
META_EVA_STATS,
|
||||||
|
META_BUF_TAG,
|
||||||
|
META_SUBFRAME_OUTPUT,
|
||||||
|
META_ROI_INFO,
|
||||||
INST_CAP_MAX,
|
INST_CAP_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1189,6 +1189,14 @@ int msm_vdec_start_input(struct msm_vidc_inst *inst)
|
|||||||
core = inst->core;
|
core = inst->core;
|
||||||
s_vpr_h(inst->sid, "%s()\n", __func__);
|
s_vpr_h(inst->sid, "%s()\n", __func__);
|
||||||
|
|
||||||
|
if (is_input_meta_enabled(inst) &&
|
||||||
|
!inst->vb2q[INPUT_META_PORT].streaming) {
|
||||||
|
s_vpr_e(inst->sid,
|
||||||
|
"%s: Meta port must be streamed on before data port\n",
|
||||||
|
__func__);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
//rc = msm_vidc_check_session_supported(inst);
|
//rc = msm_vidc_check_session_supported(inst);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto error;
|
goto error;
|
||||||
@@ -1390,6 +1398,14 @@ int msm_vdec_start_output(struct msm_vidc_inst *inst)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_output_meta_enabled(inst) &&
|
||||||
|
!inst->vb2q[OUTPUT_META_PORT].streaming) {
|
||||||
|
s_vpr_e(inst->sid,
|
||||||
|
"%s: Meta port must be streamed on before data port\n",
|
||||||
|
__func__);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
rc = msm_vdec_set_output_properties(inst);
|
rc = msm_vdec_set_output_properties(inst);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto error;
|
goto error;
|
||||||
@@ -1556,15 +1572,23 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||||||
fmt = &inst->fmts[INPUT_META_PORT];
|
fmt = &inst->fmts[INPUT_META_PORT];
|
||||||
fmt->type = INPUT_META_PLANE;
|
fmt->type = INPUT_META_PLANE;
|
||||||
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
||||||
fmt->fmt.meta.buffersize = call_session_op(core, buffer_size,
|
if (is_input_meta_enabled(inst)) {
|
||||||
inst, MSM_VIDC_BUF_INPUT_META);
|
fmt->fmt.meta.buffersize = call_session_op(core,
|
||||||
inst->buffers.input_meta.min_count =
|
buffer_size, inst, MSM_VIDC_BUF_INPUT_META);
|
||||||
inst->buffers.input.min_count;
|
inst->buffers.input_meta.min_count =
|
||||||
inst->buffers.input_meta.extra_count =
|
inst->buffers.input.min_count;
|
||||||
inst->buffers.input.extra_count;
|
inst->buffers.input_meta.extra_count =
|
||||||
inst->buffers.input_meta.actual_count =
|
inst->buffers.input.extra_count;
|
||||||
inst->buffers.input.actual_count;
|
inst->buffers.input_meta.actual_count =
|
||||||
inst->buffers.input_meta.size = fmt->fmt.meta.buffersize;
|
inst->buffers.input.actual_count;
|
||||||
|
inst->buffers.input_meta.size = fmt->fmt.meta.buffersize;
|
||||||
|
} else {
|
||||||
|
fmt->fmt.meta.buffersize = 0;
|
||||||
|
inst->buffers.input_meta.min_count = 0;
|
||||||
|
inst->buffers.input_meta.extra_count = 0;
|
||||||
|
inst->buffers.input_meta.actual_count = 0;
|
||||||
|
inst->buffers.input_meta.size = 0;
|
||||||
|
}
|
||||||
s_vpr_h(inst->sid,
|
s_vpr_h(inst->sid,
|
||||||
"%s: input meta: size %d min_count %d extra_count %d\n",
|
"%s: input meta: size %d min_count %d extra_count %d\n",
|
||||||
__func__, fmt->fmt.meta.buffersize,
|
__func__, fmt->fmt.meta.buffersize,
|
||||||
@@ -1623,15 +1647,23 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||||||
fmt = &inst->fmts[OUTPUT_META_PORT];
|
fmt = &inst->fmts[OUTPUT_META_PORT];
|
||||||
fmt->type = OUTPUT_META_PLANE;
|
fmt->type = OUTPUT_META_PLANE;
|
||||||
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
||||||
fmt->fmt.meta.buffersize = call_session_op(core, buffer_size,
|
if (is_output_meta_enabled(inst)) {
|
||||||
inst, MSM_VIDC_BUF_OUTPUT_META);
|
fmt->fmt.meta.buffersize = call_session_op(core,
|
||||||
inst->buffers.output_meta.min_count =
|
buffer_size, inst, MSM_VIDC_BUF_OUTPUT_META);
|
||||||
inst->buffers.output.min_count;
|
inst->buffers.output_meta.min_count =
|
||||||
inst->buffers.output_meta.extra_count =
|
inst->buffers.output.min_count;
|
||||||
inst->buffers.output.extra_count;
|
inst->buffers.output_meta.extra_count =
|
||||||
inst->buffers.output_meta.actual_count =
|
inst->buffers.output.extra_count;
|
||||||
inst->buffers.output.actual_count;
|
inst->buffers.output_meta.actual_count =
|
||||||
inst->buffers.output_meta.size = fmt->fmt.meta.buffersize;
|
inst->buffers.output.actual_count;
|
||||||
|
inst->buffers.output_meta.size = fmt->fmt.meta.buffersize;
|
||||||
|
} else {
|
||||||
|
fmt->fmt.meta.buffersize = 0;
|
||||||
|
inst->buffers.output_meta.min_count = 0;
|
||||||
|
inst->buffers.output_meta.extra_count = 0;
|
||||||
|
inst->buffers.output_meta.actual_count = 0;
|
||||||
|
inst->buffers.output_meta.size = 0;
|
||||||
|
}
|
||||||
s_vpr_h(inst->sid,
|
s_vpr_h(inst->sid,
|
||||||
"%s: output meta: size %d min_count %d extra_count %d\n",
|
"%s: output meta: size %d min_count %d extra_count %d\n",
|
||||||
__func__, fmt->fmt.meta.buffersize,
|
__func__, fmt->fmt.meta.buffersize,
|
||||||
|
@@ -729,6 +729,14 @@ int msm_venc_start_input(struct msm_vidc_inst *inst)
|
|||||||
core = inst->core;
|
core = inst->core;
|
||||||
s_vpr_h(inst->sid, "%s()\n", __func__);
|
s_vpr_h(inst->sid, "%s()\n", __func__);
|
||||||
|
|
||||||
|
if (is_input_meta_enabled(inst) &&
|
||||||
|
!inst->vb2q[INPUT_META_PORT].streaming) {
|
||||||
|
s_vpr_e(inst->sid,
|
||||||
|
"%s: Meta port must be streamed on before data port\n",
|
||||||
|
__func__);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
//rc = msm_vidc_check_session_supported(inst);
|
//rc = msm_vidc_check_session_supported(inst);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto error;
|
goto error;
|
||||||
@@ -836,6 +844,14 @@ int msm_venc_start_output(struct msm_vidc_inst *inst)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_output_meta_enabled(inst) &&
|
||||||
|
!inst->vb2q[OUTPUT_META_PORT].streaming) {
|
||||||
|
s_vpr_e(inst->sid,
|
||||||
|
"%s: Meta port must be streamed on before data port\n",
|
||||||
|
__func__);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
rc = msm_venc_set_output_properties(inst);
|
rc = msm_venc_set_output_properties(inst);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto error;
|
goto error;
|
||||||
@@ -950,15 +966,23 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||||||
fmt = &inst->fmts[INPUT_META_PORT];
|
fmt = &inst->fmts[INPUT_META_PORT];
|
||||||
fmt->type = INPUT_META_PLANE;
|
fmt->type = INPUT_META_PLANE;
|
||||||
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
||||||
fmt->fmt.meta.buffersize = call_session_op(core, buffer_size,
|
if (is_input_meta_enabled(inst)) {
|
||||||
inst, MSM_VIDC_BUF_INPUT_META);
|
fmt->fmt.meta.buffersize = call_session_op(core,
|
||||||
inst->buffers.input_meta.min_count =
|
buffer_size, inst, MSM_VIDC_BUF_OUTPUT_META);
|
||||||
inst->buffers.input.min_count;
|
inst->buffers.input_meta.min_count =
|
||||||
inst->buffers.input_meta.extra_count =
|
inst->buffers.input.min_count;
|
||||||
inst->buffers.input.extra_count;
|
inst->buffers.input_meta.extra_count =
|
||||||
inst->buffers.input_meta.actual_count =
|
inst->buffers.input.extra_count;
|
||||||
inst->buffers.input.actual_count;
|
inst->buffers.input_meta.actual_count =
|
||||||
inst->buffers.input_meta.size = fmt->fmt.meta.buffersize;
|
inst->buffers.input.actual_count;
|
||||||
|
inst->buffers.input_meta.size = fmt->fmt.meta.buffersize;
|
||||||
|
} else {
|
||||||
|
fmt->fmt.meta.buffersize = 0;
|
||||||
|
inst->buffers.input_meta.min_count = 0;
|
||||||
|
inst->buffers.input_meta.extra_count = 0;
|
||||||
|
inst->buffers.input_meta.actual_count = 0;
|
||||||
|
inst->buffers.input_meta.size = 0;
|
||||||
|
}
|
||||||
s_vpr_h(inst->sid,
|
s_vpr_h(inst->sid,
|
||||||
"%s: input meta: size %d min_count %d extra_count %d\n",
|
"%s: input meta: size %d min_count %d extra_count %d\n",
|
||||||
__func__, fmt->fmt.meta.buffersize,
|
__func__, fmt->fmt.meta.buffersize,
|
||||||
@@ -1036,15 +1060,23 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
|||||||
fmt = &inst->fmts[OUTPUT_META_PORT];
|
fmt = &inst->fmts[OUTPUT_META_PORT];
|
||||||
fmt->type = OUTPUT_META_PLANE;
|
fmt->type = OUTPUT_META_PLANE;
|
||||||
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
fmt->fmt.meta.dataformat = V4L2_META_FMT_VIDC;
|
||||||
fmt->fmt.meta.buffersize = call_session_op(core, buffer_size,
|
if (is_output_meta_enabled(inst)) {
|
||||||
inst, MSM_VIDC_BUF_OUTPUT_META);
|
fmt->fmt.meta.buffersize = call_session_op(core,
|
||||||
inst->buffers.output_meta.min_count =
|
buffer_size, inst, MSM_VIDC_BUF_OUTPUT_META);
|
||||||
inst->buffers.output.min_count;
|
inst->buffers.output_meta.min_count =
|
||||||
inst->buffers.output_meta.extra_count =
|
inst->buffers.output.min_count;
|
||||||
inst->buffers.output.extra_count;
|
inst->buffers.output_meta.extra_count =
|
||||||
inst->buffers.output_meta.actual_count =
|
inst->buffers.output.extra_count;
|
||||||
inst->buffers.output.actual_count;
|
inst->buffers.output_meta.actual_count =
|
||||||
inst->buffers.output_meta.size = fmt->fmt.meta.buffersize;
|
inst->buffers.output.actual_count;
|
||||||
|
inst->buffers.output_meta.size = fmt->fmt.meta.buffersize;
|
||||||
|
} else {
|
||||||
|
fmt->fmt.meta.buffersize = 0;
|
||||||
|
inst->buffers.output_meta.min_count = 0;
|
||||||
|
inst->buffers.output_meta.extra_count = 0;
|
||||||
|
inst->buffers.output_meta.actual_count = 0;
|
||||||
|
inst->buffers.output_meta.size = 0;
|
||||||
|
}
|
||||||
s_vpr_h(inst->sid,
|
s_vpr_h(inst->sid,
|
||||||
"%s: output meta: size %d min_count %d extra_count %d\n",
|
"%s: output meta: size %d min_count %d extra_count %d\n",
|
||||||
__func__, fmt->fmt.meta.buffersize,
|
__func__, fmt->fmt.meta.buffersize,
|
||||||
|
@@ -133,14 +133,38 @@ static const char *msm_vidc_get_priv_ctrl_name(u32 sid, u32 control_id)
|
|||||||
return "Blur Resolution";
|
return "Blur Resolution";
|
||||||
case V4L2_CID_MPEG_VIDC_VIDEO_VPE_CSC_CUSTOM_MATRIX:
|
case V4L2_CID_MPEG_VIDC_VIDEO_VPE_CSC_CUSTOM_MATRIX:
|
||||||
return "CSC Custom Matrix";
|
return "CSC Custom Matrix";
|
||||||
case V4L2_CID_MPEG_VIDC_METADATA_ENABLE:
|
|
||||||
return "Metadata Enable";
|
|
||||||
case V4L2_CID_MPEG_VIDC_METADATA_DISABLE:
|
|
||||||
return "Metadata Disable";
|
|
||||||
case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY:
|
case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY:
|
||||||
return "H264 Display Delay";
|
return "H264 Display Delay";
|
||||||
case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE:
|
case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE:
|
||||||
return "H264 Display Delay Enable";
|
return "H264 Display Delay Enable";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_LTR_MARK_USE_DETAILS:
|
||||||
|
return "LTR Mark Use Details Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_SEQ_HEADER_NAL:
|
||||||
|
return "Seq Header NAL Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_DPB_LUMA_CHROMA_MISR:
|
||||||
|
return "DPB Luma-Chroma MISR Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_OPB_LUMA_CHROMA_MISR:
|
||||||
|
return "OPB Luma-Chroma MISR Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_INTERLACE:
|
||||||
|
return "Interlace Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_CONCEALED_MB_COUNT:
|
||||||
|
return "Concealed MB Count Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_HISTOGRAM_INFO:
|
||||||
|
return "Historgram Info Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_SEI_MASTERING_DISPLAY_COLOUR:
|
||||||
|
return "SEI Mastering Display Color Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_SEI_CONTENT_LIGHT_LEVEL:
|
||||||
|
return "SEI Content Lighting Level Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_HDR10PLUS:
|
||||||
|
return "HDR10PLUS Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_EVA_STATS:
|
||||||
|
return "EVA Stats Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_BUFFER_TAG:
|
||||||
|
return "Buffer Tag Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_SUBFRAME_OUTPUT:
|
||||||
|
return "Subframe Output Metadata";
|
||||||
|
case V4L2_CID_MPEG_VIDC_METADATA_ROI_INFO:
|
||||||
|
return "ROI Info Metadata";
|
||||||
default:
|
default:
|
||||||
s_vpr_e(sid, "%s: ctrl name not available for ctrl id %#x\n",
|
s_vpr_e(sid, "%s: ctrl name not available for ctrl id %#x\n",
|
||||||
__func__, control_id);
|
__func__, control_id);
|
||||||
|
@@ -833,6 +833,13 @@ int msm_vidc_queue_buffer(struct msm_vidc_inst *inst, struct vb2_buffer *vb2)
|
|||||||
|
|
||||||
print_vidc_buffer(VIDC_HIGH, "qbuf", inst, buf);
|
print_vidc_buffer(VIDC_HIGH, "qbuf", inst, buf);
|
||||||
meta = get_meta_buffer(inst, buf);
|
meta = get_meta_buffer(inst, buf);
|
||||||
|
if (!meta) {
|
||||||
|
if (is_meta_enabled(inst, buf->type)) {
|
||||||
|
print_vidc_buffer(VIDC_ERR, "missing meta for",
|
||||||
|
inst, buf);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
rc = venus_hfi_queue_buffer(inst, buf, meta);
|
rc = venus_hfi_queue_buffer(inst, buf, meta);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
@@ -71,10 +71,35 @@ enum v4l2_mpeg_vidc_blur_types {
|
|||||||
(V4L2_CID_MPEG_VIDC_BASE + 0x12)
|
(V4L2_CID_MPEG_VIDC_BASE + 0x12)
|
||||||
|
|
||||||
/* various Metadata - encoder & decoder */
|
/* various Metadata - encoder & decoder */
|
||||||
#define V4L2_CID_MPEG_VIDC_METADATA_ENABLE \
|
#define V4L2_CID_MPEG_VIDC_METADATA_LTR_MARK_USE_DETAILS \
|
||||||
(V4L2_CID_MPEG_VIDC_BASE + 0x13)
|
(V4L2_CID_MPEG_VIDC_BASE + 0x13)
|
||||||
#define V4L2_CID_MPEG_VIDC_METADATA_DISABLE \
|
#define V4L2_CID_MPEG_VIDC_METADATA_SEQ_HEADER_NAL \
|
||||||
(V4L2_CID_MPEG_VIDC_BASE + 0x14)
|
(V4L2_CID_MPEG_VIDC_BASE + 0x14)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_DPB_LUMA_CHROMA_MISR \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x15)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_OPB_LUMA_CHROMA_MISR \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x16)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_INTERLACE \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x17)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_CONCEALED_MB_COUNT \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x18)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_HISTOGRAM_INFO \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x19)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_SEI_MASTERING_DISPLAY_COLOUR \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x1A)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_SEI_CONTENT_LIGHT_LEVEL \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x1B)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_HDR10PLUS \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x1C)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_EVA_STATS \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x1D)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_BUFFER_TAG \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x1E)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_SUBFRAME_OUTPUT \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x1F)
|
||||||
|
#define V4L2_CID_MPEG_VIDC_METADATA_ROI_INFO \
|
||||||
|
(V4L2_CID_MPEG_VIDC_BASE + 0x20)
|
||||||
|
|
||||||
enum v4l2_mpeg_vidc_metapayload_header_flags {
|
enum v4l2_mpeg_vidc_metapayload_header_flags {
|
||||||
METADATA_FLAGS_NONE = 0,
|
METADATA_FLAGS_NONE = 0,
|
||||||
METADATA_FLAGS_TOP_FIELD = (1 << 0),
|
METADATA_FLAGS_TOP_FIELD = (1 << 0),
|
||||||
|
Reference in New Issue
Block a user