video: driver: add max num reorder frames support

add support for HFI_PROP_MAX_NUM_REORDER_FRAMES.
add ctrl for this metadata for avc and hevc.

Change-Id: I9a7b95f130e58f810255aff23e9b605304841072
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
This commit is contained in:
Darshana Patil
2021-08-03 16:52:47 -07:00
parent 756a01af02
commit 05270719fb
7 changed files with 74 additions and 23 deletions

View File

@@ -1598,6 +1598,11 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
0, 100, 0, 100,
1, 100, 1, 100,
V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY}, V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY},
{META_MAX_NUM_REORDER_FRAMES, DEC, HEVC | H264,
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
1, V4L2_MPEG_MSM_VIDC_DISABLE,
V4L2_CID_MPEG_VIDC_METADATA_MAX_NUM_REORDER_FRAMES,
HFI_PROP_MAX_NUM_REORDER_FRAMES},
}; };
/* /*

View File

@@ -123,7 +123,8 @@ static inline bool is_output_meta_enabled(struct msm_vidc_inst *inst)
inst->capabilities->cap[META_SEI_CLL].value || inst->capabilities->cap[META_SEI_CLL].value ||
inst->capabilities->cap[META_BUF_TAG].value || inst->capabilities->cap[META_BUF_TAG].value ||
inst->capabilities->cap[META_DPB_TAG_LIST].value || inst->capabilities->cap[META_DPB_TAG_LIST].value ||
inst->capabilities->cap[META_SUBFRAME_OUTPUT].value); inst->capabilities->cap[META_SUBFRAME_OUTPUT].value ||
inst->capabilities->cap[META_MAX_NUM_REORDER_FRAMES].value);
} else if (is_encode_session(inst)) { } else if (is_encode_session(inst)) {
enabled = (inst->capabilities->cap[META_LTR_MARK_USE].value || enabled = (inst->capabilities->cap[META_LTR_MARK_USE].value ||
inst->capabilities->cap[META_BUF_TAG].value); inst->capabilities->cap[META_BUF_TAG].value);

View File

@@ -472,6 +472,7 @@ enum msm_vidc_inst_capability_type {
META_ROI_INFO, META_ROI_INFO,
META_DEC_QP_METADATA, META_DEC_QP_METADATA,
COMPLEXITY, COMPLEXITY,
META_MAX_NUM_REORDER_FRAMES,
INST_CAP_MAX, INST_CAP_MAX,
}; };

View File

@@ -138,8 +138,10 @@ static int msm_vdec_set_bitstream_resolution(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&resolution, &resolution,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -173,8 +175,10 @@ static int msm_vdec_set_linear_stride_scanline(struct msm_vidc_inst *inst)
HFI_PAYLOAD_U64, HFI_PAYLOAD_U64,
&payload, &payload,
sizeof(u64)); sizeof(u64));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -215,8 +219,10 @@ static int msm_vdec_set_crop_offsets(struct msm_vidc_inst *inst,
HFI_PAYLOAD_64_PACKED, HFI_PAYLOAD_64_PACKED,
&payload, &payload,
sizeof(u64)); sizeof(u64));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -248,8 +254,10 @@ static int msm_vdec_set_bit_depth(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&bitdepth, &bitdepth,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -305,8 +313,10 @@ static int msm_vdec_set_coded_frames(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&coded_frames, &coded_frames,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -333,9 +343,10 @@ static int msm_vdec_set_min_output_count(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&min_output, &min_output,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -359,8 +370,10 @@ static int msm_vdec_set_picture_order_count(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&poc, &poc,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -425,8 +438,10 @@ static int msm_vdec_set_colorspace(struct msm_vidc_inst *inst,
HFI_PAYLOAD_32_PACKED, HFI_PAYLOAD_32_PACKED,
&color_info, &color_info,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -452,8 +467,10 @@ static int msm_vdec_set_profile(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32_ENUM, HFI_PAYLOAD_U32_ENUM,
&profile, &profile,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -479,8 +496,10 @@ static int msm_vdec_set_level(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32_ENUM, HFI_PAYLOAD_U32_ENUM,
&level, &level,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -506,8 +525,10 @@ static int msm_vdec_set_tier(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32_ENUM, HFI_PAYLOAD_U32_ENUM,
&tier, &tier,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -531,8 +552,10 @@ static int msm_vdec_set_colorformat(struct msm_vidc_inst *inst)
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&hfi_colorformat, &hfi_colorformat,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -561,8 +584,10 @@ static int msm_vdec_set_output_order(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&output_order, &output_order,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -587,11 +612,14 @@ static int msm_vdec_set_rap_frame(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&rap_frame, &rap_frame,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc; return rc;
} }
return rc;
}
static int msm_vdec_set_thumbnail_mode(struct msm_vidc_inst *inst, static int msm_vdec_set_thumbnail_mode(struct msm_vidc_inst *inst,
enum msm_vidc_port_type port) enum msm_vidc_port_type port)
{ {
@@ -612,8 +640,10 @@ static int msm_vdec_set_thumbnail_mode(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&thumbnail_mode, &thumbnail_mode,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -639,8 +669,10 @@ static int msm_vdec_set_conceal_color_8bit(struct msm_vidc_inst *inst,
HFI_PAYLOAD_32_PACKED, HFI_PAYLOAD_32_PACKED,
&conceal_color_8bit, &conceal_color_8bit,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -666,8 +698,10 @@ static int msm_vdec_set_conceal_color_10bit(struct msm_vidc_inst *inst,
HFI_PAYLOAD_32_PACKED, HFI_PAYLOAD_32_PACKED,
&conceal_color_10bit, &conceal_color_10bit,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__); i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
return rc; return rc;
} }
@@ -689,8 +723,11 @@ static int msm_vdec_set_host_max_buf_count(struct msm_vidc_inst *inst,
HFI_PAYLOAD_U32, HFI_PAYLOAD_U32,
&count, &count,
sizeof(u32)); sizeof(u32));
if (rc) if (rc) {
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc; return rc;
}
return 0; return 0;
} }
@@ -1023,6 +1060,7 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
META_DPB_TAG_LIST, META_DPB_TAG_LIST,
META_SUBFRAME_OUTPUT, META_SUBFRAME_OUTPUT,
META_DEC_QP_METADATA, META_DEC_QP_METADATA,
META_MAX_NUM_REORDER_FRAMES,
}; };
if (!inst || !inst->core || !inst->capabilities) { if (!inst || !inst->core || !inst->capabilities) {

View File

@@ -181,6 +181,7 @@ static const struct msm_vidc_cap_name cap_name_arr[] = {
{META_ROI_INFO, "META_ROI_INFO" }, {META_ROI_INFO, "META_ROI_INFO" },
{META_DEC_QP_METADATA, "META_DEC_QP_METADATA" }, {META_DEC_QP_METADATA, "META_DEC_QP_METADATA" },
{COMPLEXITY, "COMPLEXITY" }, {COMPLEXITY, "COMPLEXITY" },
{META_MAX_NUM_REORDER_FRAMES, "META_MAX_NUM_REORDER_FRAMES"},
{INST_CAP_MAX, "INST_CAP_MAX" }, {INST_CAP_MAX, "INST_CAP_MAX" },
}; };

View File

@@ -46,9 +46,10 @@ void print_psc_properties(const char *str, struct msm_vidc_inst *inst,
return; return;
i_vpr_h(inst, i_vpr_h(inst,
"%s: resolution %#x, crop offsets[0] %#x, crop offsets[1] %#x, bit depth %#x, coded frames %d " "%s: width %d, height %d, crop offsets[0] %#x, crop offsets[1] %#x, bit depth %#x, coded frames %d "
"fw min count %d, poc %d, color info %d, profile %d, level %d, tier %d ", "fw min count %d, poc %d, color info %d, profile %d, level %d, tier %d\n",
str, subsc_params.bitstream_resolution, str, (subsc_params.bitstream_resolution & HFI_BITMASK_BITSTREAM_WIDTH) >> 16,
(subsc_params.bitstream_resolution & HFI_BITMASK_BITSTREAM_HEIGHT),
subsc_params.crop_offsets[0], subsc_params.crop_offsets[1], subsc_params.crop_offsets[0], subsc_params.crop_offsets[1],
subsc_params.bit_depth, subsc_params.coded_frames, subsc_params.bit_depth, subsc_params.coded_frames,
subsc_params.fw_min_count, subsc_params.pic_order_cnt, subsc_params.fw_min_count, subsc_params.pic_order_cnt,

View File

@@ -135,6 +135,9 @@ enum v4l2_mpeg_vidc_blur_types {
/* Encoder Complexity control */ /* Encoder Complexity control */
#define V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY \ #define V4L2_CID_MPEG_VIDC_VENC_COMPLEXITY \
(V4L2_CID_MPEG_VIDC_BASE + 0x2F) (V4L2_CID_MPEG_VIDC_BASE + 0x2F)
/* Decoder Max Number of Reorder Frames */
#define V4L2_CID_MPEG_VIDC_METADATA_MAX_NUM_REORDER_FRAMES \
(V4L2_CID_MPEG_VIDC_BASE + 0x30)
/* Deprecate below controls once availble in gki and gsi bionic header */ /* Deprecate below controls once availble in gki and gsi bionic header */
#ifndef V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID #ifndef V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID
@@ -264,6 +267,7 @@ enum v4l2_mpeg_vidc_metadata {
METADATA_DEC_QP_METADATA = 0x0300016f, METADATA_DEC_QP_METADATA = 0x0300016f,
METADATA_ROI_INFO = 0x03000173, METADATA_ROI_INFO = 0x03000173,
METADATA_DPB_TAG_LIST = 0x03000179, METADATA_DPB_TAG_LIST = 0x03000179,
METADATA_MAX_NUM_REORDER_FRAMES = 0x03000127,
}; };
enum meta_interlace_info { enum meta_interlace_info {
META_INTERLACE_INFO_NONE = 0x00000000, META_INTERLACE_INFO_NONE = 0x00000000,