video: driver: refine image session handling
Amended below logics for image session. - set constant quality - set tier: V4L2_MPEG_VIDEO_HEVC_TIER_MAIN - frame_rate: 1 - enable subframe metadata - stage: - image encode: 2 stage - image decode: 1 stage - pipe: 4(work_route) - power mode: max_quality. Change-Id: I67acd5284910e7cbe26446b5dfc526d002b98981 Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
@@ -305,7 +305,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
/* Enc: Keeping CABAC and CAVLC as same bitrate.
|
||||
* Dec: there's no use of Bitrate cap
|
||||
*/
|
||||
{BIT_RATE, ENC, CODECS_ALL,
|
||||
{BIT_RATE, ENC, H264|HEVC,
|
||||
1, 220000000, 1, 20000000,
|
||||
V4L2_CID_MPEG_VIDEO_BITRATE,
|
||||
HFI_PROP_TOTAL_BITRATE,
|
||||
@@ -363,7 +363,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
1, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE},
|
||||
|
||||
{CONSTANT_QUALITY, ENC, HEVC|HEIC,
|
||||
{CONSTANT_QUALITY, ENC, HEVC,
|
||||
1, MAX_CONSTANT_QUALITY, 1, 90,
|
||||
V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY,
|
||||
HFI_PROP_CONSTANT_QUALITY,
|
||||
@@ -884,7 +884,7 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
* go/videogki
|
||||
*/
|
||||
|
||||
{HEVC_TIER, ENC|DEC, HEVC|HEIC,
|
||||
{HEVC_TIER, ENC|DEC, HEVC,
|
||||
V4L2_MPEG_VIDEO_HEVC_TIER_MAIN,
|
||||
V4L2_MPEG_VIDEO_HEVC_TIER_HIGH,
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_TIER_MAIN) |
|
||||
@@ -1230,6 +1230,13 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT,
|
||||
{BITRATE_MODE}, {0},
|
||||
msm_vidc_adjust_delta_based_rc, msm_vidc_set_u32},
|
||||
{CONSTANT_QUALITY, ENC, HEIC,
|
||||
1, MAX_CONSTANT_QUALITY, 1, 100,
|
||||
V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY,
|
||||
HFI_PROP_CONSTANT_QUALITY,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED,
|
||||
{BITRATE_MODE}, {0},
|
||||
NULL, msm_vidc_set_constant_quality},
|
||||
{GRID, ENC, HEIC,
|
||||
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
1, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
@@ -1255,8 +1262,9 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
NULL, msm_vidc_set_u32},
|
||||
{PROFILE, ENC|DEC, HEIC,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE),
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10,
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) |
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10),
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
|
||||
V4L2_CID_MPEG_VIDEO_HEVC_PROFILE,
|
||||
HFI_PROP_PROFILE,
|
||||
@@ -1264,6 +1272,30 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
||||
{PIX_FMTS},
|
||||
{0},
|
||||
msm_vidc_adjust_profile, msm_vidc_set_u32_enum},
|
||||
{HEVC_TIER, ENC|DEC, HEIC,
|
||||
V4L2_MPEG_VIDEO_HEVC_TIER_MAIN,
|
||||
V4L2_MPEG_VIDEO_HEVC_TIER_MAIN,
|
||||
BIT(V4L2_MPEG_VIDEO_HEVC_TIER_MAIN),
|
||||
V4L2_MPEG_VIDEO_HEVC_TIER_MAIN,
|
||||
V4L2_CID_MPEG_VIDEO_HEVC_TIER,
|
||||
HFI_PROP_TIER,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
|
||||
{0},
|
||||
{0},
|
||||
NULL, msm_vidc_set_u32_enum},
|
||||
{FRAME_RATE, ENC, HEIC,
|
||||
(MINIMUM_FPS << 16), (MAXIMUM_FPS << 16),
|
||||
1, (MINIMUM_FPS << 16),
|
||||
0,
|
||||
HFI_PROP_FRAME_RATE,
|
||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT,
|
||||
{0}, {0},
|
||||
NULL, msm_vidc_set_q16},
|
||||
{META_SUBFRAME_OUTPUT, ENC, HEIC,
|
||||
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},
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -542,17 +542,7 @@ int msm_buffer_size_iris2(struct msm_vidc_inst *inst,
|
||||
return size;
|
||||
}
|
||||
|
||||
static int msm_buffer_encoder_dpb_count(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return msm_vidc_get_recon_buf_count(inst);
|
||||
}
|
||||
|
||||
static int msm_buffer_decoder_dpb_count(struct msm_vidc_inst *inst)
|
||||
static int msm_buffer_dpb_count(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int count = 0;
|
||||
u32 color_fmt;
|
||||
@@ -562,6 +552,8 @@ static int msm_buffer_decoder_dpb_count(struct msm_vidc_inst *inst)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* decoder dpb buffer count */
|
||||
if (is_decode_session(inst)) {
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
if (is_linear_colorformat(color_fmt))
|
||||
count = inst->buffers.output.min_count;
|
||||
@@ -569,6 +561,10 @@ static int msm_buffer_decoder_dpb_count(struct msm_vidc_inst *inst)
|
||||
return count;
|
||||
}
|
||||
|
||||
/* encoder dpb buffer count */
|
||||
return msm_vidc_get_recon_buf_count(inst);
|
||||
}
|
||||
|
||||
int msm_buffer_min_count_iris2(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type)
|
||||
{
|
||||
@@ -579,7 +575,6 @@ int msm_buffer_min_count_iris2(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
switch (buffer_type) {
|
||||
case MSM_VIDC_BUF_INPUT:
|
||||
case MSM_VIDC_BUF_INPUT_META:
|
||||
@@ -594,39 +589,18 @@ int msm_buffer_min_count_iris2(struct msm_vidc_inst *inst,
|
||||
case MSM_VIDC_BUF_NON_COMV:
|
||||
case MSM_VIDC_BUF_LINE:
|
||||
case MSM_VIDC_BUF_PERSIST:
|
||||
case MSM_VIDC_BUF_ARP:
|
||||
case MSM_VIDC_BUF_VPSS:
|
||||
count = msm_vidc_internal_buffer_count(inst, buffer_type);
|
||||
break;
|
||||
case MSM_VIDC_BUF_DPB:
|
||||
count = msm_buffer_decoder_dpb_count(inst);
|
||||
count = msm_buffer_dpb_count(inst);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (is_encode_session(inst)) {
|
||||
switch (buffer_type) {
|
||||
case MSM_VIDC_BUF_INPUT:
|
||||
case MSM_VIDC_BUF_INPUT_META:
|
||||
count = msm_vidc_input_min_count(inst);
|
||||
break;
|
||||
case MSM_VIDC_BUF_OUTPUT:
|
||||
case MSM_VIDC_BUF_OUTPUT_META:
|
||||
count = msm_vidc_output_min_count(inst);
|
||||
break;
|
||||
case MSM_VIDC_BUF_BIN:
|
||||
case MSM_VIDC_BUF_COMV:
|
||||
case MSM_VIDC_BUF_NON_COMV:
|
||||
case MSM_VIDC_BUF_LINE:
|
||||
case MSM_VIDC_BUF_ARP:
|
||||
case MSM_VIDC_BUF_VPSS:
|
||||
count = 1;
|
||||
break;
|
||||
case MSM_VIDC_BUF_DPB:
|
||||
count = msm_buffer_encoder_dpb_count(inst);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
i_vpr_l(inst, "%s: type %u, count %u\n", __func__, buffer_type, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -653,5 +627,6 @@ int msm_buffer_extra_count_iris2(struct msm_vidc_inst *inst,
|
||||
break;
|
||||
}
|
||||
|
||||
i_vpr_l(inst, "%s: type %u, count %u\n", __func__, buffer_type, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -532,6 +532,12 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst* inst)
|
||||
out_f = &inst->fmts[OUTPUT_PORT];
|
||||
inp_f = &inst->fmts[INPUT_PORT];
|
||||
|
||||
if (is_image_decode_session(inst))
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
|
||||
if (is_image_session(inst))
|
||||
goto exit;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
height = out_f->fmt.pix_mp.height;
|
||||
width = out_f->fmt.pix_mp.width;
|
||||
@@ -563,6 +569,7 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst* inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
exit:
|
||||
i_vpr_h(inst, "Configuring work mode = %u low latency = %u",
|
||||
work_mode, lowlatency);
|
||||
msm_vidc_update_cap_value(inst, STAGE, work_mode, __func__);
|
||||
@@ -587,6 +594,9 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst* inst)
|
||||
core = inst->core;
|
||||
work_route = core->capabilities[NUM_VPP_PIPE].value;
|
||||
|
||||
if (is_image_session(inst))
|
||||
goto exit;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE)
|
||||
@@ -609,6 +619,7 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst* inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
exit:
|
||||
i_vpr_h(inst, "Configuring work route = %u", work_route);
|
||||
msm_vidc_update_cap_value(inst, PIPE, work_route, __func__);
|
||||
|
||||
@@ -620,7 +631,7 @@ int msm_vidc_decide_quality_mode_iris2(struct msm_vidc_inst* inst)
|
||||
struct msm_vidc_inst_capability* capability = NULL;
|
||||
struct msm_vidc_core *core;
|
||||
u32 mbpf, mbps, max_hq_mbpf, max_hq_mbps;
|
||||
u32 mode;
|
||||
u32 mode = MSM_VIDC_POWER_SAVE_MODE;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
@@ -632,7 +643,12 @@ int msm_vidc_decide_quality_mode_iris2(struct msm_vidc_inst* inst)
|
||||
if (!is_encode_session(inst))
|
||||
return 0;
|
||||
|
||||
mode = MSM_VIDC_POWER_SAVE_MODE;
|
||||
/* image session always runs at quality mode */
|
||||
if (is_image_session(inst)) {
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mbpf = msm_vidc_get_mbs_per_frame(inst);
|
||||
mbps = mbpf * msm_vidc_get_fps(inst);
|
||||
core = inst->core;
|
||||
@@ -644,6 +660,7 @@ int msm_vidc_decide_quality_mode_iris2(struct msm_vidc_inst* inst)
|
||||
(mbpf <= max_hq_mbpf && mbps <= max_hq_mbps))
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
|
||||
exit:
|
||||
msm_vidc_update_cap_value(inst, QUALITY_MODE, mode, __func__);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -674,6 +674,7 @@ struct msm_vidc_hfi_frame_info {
|
||||
u32 cr;
|
||||
u32 cf;
|
||||
u32 data_corrupt;
|
||||
u32 overflow;
|
||||
};
|
||||
|
||||
struct msm_vidc_decode_vpp_delay {
|
||||
|
||||
@@ -123,7 +123,7 @@ static int msm_venc_set_colorformat(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_venc_set_linear_alignment_factor(struct msm_vidc_inst *inst,
|
||||
static int msm_venc_set_stride_scanline(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -240,6 +240,9 @@ static int msm_venc_set_crop_offsets(struct msm_vidc_inst *inst,
|
||||
bottom_offset = (inst->fmts[port].fmt.pix_mp.height -
|
||||
inst->crop.height);
|
||||
|
||||
if (is_image_session(inst))
|
||||
right_offset = bottom_offset = 0;
|
||||
|
||||
crop[0] = left_offset << 16 | top_offset;
|
||||
crop[1] = right_offset << 16 | bottom_offset;
|
||||
i_vpr_h(inst, "%s: left_offset: %d top_offset: %d "
|
||||
@@ -475,7 +478,7 @@ static int msm_venc_set_input_properties(struct msm_vidc_inst *inst)
|
||||
static const struct msm_venc_prop_type_handle prop_type_handle_arr[] = {
|
||||
{HFI_PROP_COLOR_FORMAT, msm_venc_set_colorformat },
|
||||
{HFI_PROP_RAW_RESOLUTION, msm_venc_set_raw_resolution },
|
||||
{HFI_PROP_LINEAR_STRIDE_SCANLINE, msm_venc_set_linear_alignment_factor },
|
||||
{HFI_PROP_LINEAR_STRIDE_SCANLINE, msm_venc_set_stride_scanline },
|
||||
{HFI_PROP_BUFFER_HOST_MAX_COUNT, msm_venc_set_host_max_buf_count },
|
||||
{HFI_PROP_SIGNAL_COLOR_INFO, msm_venc_set_colorspace },
|
||||
};
|
||||
|
||||
@@ -176,6 +176,9 @@ u32 msm_vidc_internal_buffer_count(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_encode_session(inst))
|
||||
return 1;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
if (buffer_type == MSM_VIDC_BUF_BIN ||
|
||||
buffer_type == MSM_VIDC_BUF_LINE ||
|
||||
|
||||
@@ -817,9 +817,13 @@ int msm_vidc_adjust_profile(void *instance, struct v4l2_ctrl *ctrl)
|
||||
adjusted_value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
|
||||
} else {
|
||||
/* 8 bit profile for 8 bit color format */
|
||||
if (adjusted_value == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10)
|
||||
if (adjusted_value == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10) {
|
||||
if (is_image_session(inst))
|
||||
adjusted_value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE;
|
||||
else
|
||||
adjusted_value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN;
|
||||
}
|
||||
}
|
||||
|
||||
msm_vidc_update_cap_value(inst, PROFILE,
|
||||
adjusted_value, __func__);
|
||||
@@ -1367,13 +1371,14 @@ int msm_vidc_set_header_mode(void *instance,
|
||||
else if (header_mode == V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME)
|
||||
hfi_value |= HFI_SEQ_HEADER_JOINED_WITH_1ST_FRAME;
|
||||
|
||||
if (prepend_sps_pps) {
|
||||
if (prepend_sps_pps)
|
||||
hfi_value |= HFI_SEQ_HEADER_PREFIX_WITH_SYNC_FRAME;
|
||||
}
|
||||
|
||||
if (hdr_metadata) {
|
||||
if (hdr_metadata)
|
||||
hfi_value |= HFI_SEQ_HEADER_METADATA;
|
||||
}
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32_ENUM,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
@@ -1402,8 +1407,11 @@ int msm_vidc_set_deblock_mode(void *instance,
|
||||
|
||||
beta = inst->capabilities->cap[LF_BETA].value + lf_offset;
|
||||
alpha = inst->capabilities->cap[LF_ALPHA].value + lf_offset;
|
||||
|
||||
hfi_value = (alpha << 16) | (beta << 8) | lf_mode;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_32_PACKED,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1432,6 +1440,9 @@ int msm_vidc_set_constant_quality(void *instance,
|
||||
|
||||
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1455,6 +1466,9 @@ int msm_vidc_set_use_and_mark_ltr(void *instance,
|
||||
|
||||
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1510,6 +1524,10 @@ int msm_vidc_set_min_qp(void *instance,
|
||||
|
||||
hfi_value = i_frame_qp | p_frame_qp << 8 | b_frame_qp << 16 |
|
||||
client_qp_enable << 24;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_32_PACKED,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1565,6 +1583,10 @@ int msm_vidc_set_max_qp(void *instance,
|
||||
|
||||
hfi_value = i_frame_qp | p_frame_qp << 8 | b_frame_qp << 16 |
|
||||
client_qp_enable << 24;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_32_PACKED,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1618,6 +1640,10 @@ int msm_vidc_set_frame_qp(void *instance,
|
||||
|
||||
hfi_value = i_frame_qp | p_frame_qp << 8 | b_frame_qp << 16 |
|
||||
client_qp_enable << 24;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_32_PACKED,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1643,6 +1669,9 @@ int msm_vidc_set_req_sync_frame(void *instance,
|
||||
else
|
||||
hfi_value = HFI_SYNC_FRAME_REQUEST_WITHOUT_SEQ_HDR;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32_ENUM,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1670,6 +1699,9 @@ int msm_vidc_set_chroma_qp_index_offset(void *instance,
|
||||
chroma_qp = inst->capabilities->cap[cap_id].value + offset;
|
||||
hfi_value = chroma_qp_offset_mode | chroma_qp << 8 | chroma_qp << 16 ;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_32_PACKED,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1703,6 +1735,8 @@ int msm_vidc_set_slice_count(void* instance,
|
||||
hfi_value = inst->capabilities->cap[SLICE_MAX_BYTES].value;
|
||||
set_cap_id = SLICE_MAX_BYTES;
|
||||
}
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, set_cap_id, HFI_PAYLOAD_U32,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
@@ -1729,6 +1763,8 @@ int msm_vidc_set_nal_length(void* instance,
|
||||
if (rc)
|
||||
return -EINVAL;
|
||||
}
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32_ENUM,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
@@ -1831,6 +1867,9 @@ int msm_vidc_set_flip(void *instance,
|
||||
if (vflip)
|
||||
hfi_value |= HFI_VERTICAL_FLIP;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32_ENUM,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1852,6 +1891,9 @@ int msm_vidc_set_q16(void *instance,
|
||||
|
||||
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_Q16,
|
||||
&hfi_value, sizeof(u32), __func__);
|
||||
|
||||
@@ -1877,7 +1919,6 @@ int msm_vidc_set_u32(void *instance,
|
||||
} else {
|
||||
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||
}
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
@@ -1923,8 +1964,11 @@ int msm_vidc_set_s32(void *instance,
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||
|
||||
i_vpr_h(inst, "set cap: name: %24s, value: %#10x, hfi: %#10x\n", cap_name(cap_id),
|
||||
inst->capabilities->cap[cap_id].value, hfi_value);
|
||||
|
||||
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_S32,
|
||||
&hfi_value, sizeof(s32), __func__);
|
||||
|
||||
|
||||
@@ -3885,6 +3885,7 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct v4l2_format *fmt;
|
||||
u32 pix_fmt, profile;
|
||||
bool allow = false;
|
||||
int rc = 0;
|
||||
|
||||
@@ -3898,12 +3899,14 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
|
||||
if (!is_image_session(inst))
|
||||
return 0;
|
||||
|
||||
pix_fmt = capability->cap[PIX_FMTS].value;
|
||||
profile = capability->cap[PROFILE].value;
|
||||
|
||||
if (is_image_encode_session(inst)) {
|
||||
/* is linear color fmt */
|
||||
allow = is_linear_colorformat(capability->cap[PIX_FMTS].value);
|
||||
allow = is_linear_colorformat(pix_fmt);
|
||||
if (!allow) {
|
||||
i_vpr_e(inst, "%s: compressed fmt: %#x\n", __func__,
|
||||
capability->cap[PIX_FMTS].value);
|
||||
i_vpr_e(inst, "%s: compressed fmt: %#x\n", __func__, pix_fmt);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -3943,10 +3946,12 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
/* is profile type Still Pic */
|
||||
allow = (capability->cap[PROFILE].value ==
|
||||
V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE);
|
||||
if (is_10bit_colorformat(pix_fmt))
|
||||
allow = profile == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
|
||||
else
|
||||
allow = profile == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE;
|
||||
if (!allow) {
|
||||
i_vpr_e(inst, "%s: profile is not still pic type: %#x\n", __func__,
|
||||
i_vpr_e(inst, "%s: profile not valid: %#x\n", __func__,
|
||||
capability->cap[PROFILE].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -462,6 +462,9 @@ static int get_driver_buffer_flags(struct msm_vidc_inst *inst, u32 hfi_flags)
|
||||
if (inst->hfi_frame_info.data_corrupt)
|
||||
driver_flags |= MSM_VIDC_BUF_FLAG_ERROR;
|
||||
|
||||
if (inst->hfi_frame_info.overflow)
|
||||
driver_flags |= MSM_VIDC_BUF_FLAG_ERROR;
|
||||
|
||||
if (inst->hfi_frame_info.no_output) {
|
||||
if (inst->capabilities->cap[META_BUF_TAG].value &&
|
||||
!(hfi_flags & HFI_BUF_FW_FLAG_CODEC_CONFIG))
|
||||
@@ -544,7 +547,7 @@ static int handle_output_buffer(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
struct msm_vidc_buffers *buffers;
|
||||
struct msm_vidc_buffer *buf;
|
||||
bool found;
|
||||
bool found, fatal = false;
|
||||
|
||||
buffers = msm_vidc_get_buffers(inst, MSM_VIDC_BUF_OUTPUT, __func__);
|
||||
if (!buffers)
|
||||
@@ -573,8 +576,25 @@ static int handle_output_buffer(struct msm_vidc_inst *inst,
|
||||
/* encoder output is not expected to be corrupted */
|
||||
if (inst->hfi_frame_info.data_corrupt) {
|
||||
i_vpr_e(inst, "%s: encode output is corrupted\n", __func__);
|
||||
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
|
||||
fatal = true;
|
||||
}
|
||||
if (inst->hfi_frame_info.overflow) {
|
||||
/* overflow not expected for image session */
|
||||
if (is_image_session(inst)) {
|
||||
i_vpr_e(inst, "%s: overflow detected for an image session\n",
|
||||
__func__);
|
||||
fatal = true;
|
||||
}
|
||||
|
||||
/* overflow not expected for cbr_cfr session */
|
||||
if (!buffer->data_size && inst->hfi_rc_type == HFI_RC_CBR_CFR) {
|
||||
i_vpr_e(inst, "%s: overflow detected for cbr_cfr session\n",
|
||||
__func__);
|
||||
fatal = true;
|
||||
}
|
||||
}
|
||||
if (fatal)
|
||||
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user