video: driver: remove capability pointer
Remove capability pointer and allocate memory with max cap size. Change-Id: I7f53e3b35439f91b72f057695b6e63f71bfecc0a Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
This commit is contained in:
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
Load Diff
@@ -16,18 +16,16 @@
|
||||
|
||||
int msm_vidc_adjust_ir_period(void *instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
s32 adjusted_value, all_intra = 0, roi_enable = 0,
|
||||
pix_fmts = MSM_VIDC_FMT_NONE;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
adjusted_value = ctrl ? ctrl->val : capability->cap[IR_PERIOD].value;
|
||||
adjusted_value = ctrl ? ctrl->val : inst->capabilities[IR_PERIOD].value;
|
||||
|
||||
if (msm_vidc_get_parent_value(inst, IR_PERIOD, ALL_INTRA,
|
||||
&all_intra, __func__) ||
|
||||
@@ -82,11 +80,10 @@ exit:
|
||||
|
||||
int msm_vidc_adjust_dec_frame_rate(void *instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
u32 adjusted_value = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -96,8 +93,7 @@ int msm_vidc_adjust_dec_frame_rate(void *instance, struct v4l2_ctrl *ctrl)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
adjusted_value = ctrl ? ctrl->val : capability->cap[FRAME_RATE].value;
|
||||
adjusted_value = ctrl ? ctrl->val : inst->capabilities[FRAME_RATE].value;
|
||||
msm_vidc_update_cap_value(inst, FRAME_RATE, adjusted_value, __func__);
|
||||
|
||||
return 0;
|
||||
@@ -105,11 +101,10 @@ int msm_vidc_adjust_dec_frame_rate(void *instance, struct v4l2_ctrl *ctrl)
|
||||
|
||||
int msm_vidc_adjust_dec_operating_rate(void *instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
u32 adjusted_value = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -119,8 +114,7 @@ int msm_vidc_adjust_dec_operating_rate(void *instance, struct v4l2_ctrl *ctrl)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
adjusted_value = ctrl ? ctrl->val : capability->cap[OPERATING_RATE].value;
|
||||
adjusted_value = ctrl ? ctrl->val : inst->capabilities[OPERATING_RATE].value;
|
||||
msm_vidc_update_cap_value(inst, OPERATING_RATE, adjusted_value, __func__);
|
||||
|
||||
return 0;
|
||||
@@ -128,12 +122,11 @@ int msm_vidc_adjust_dec_operating_rate(void *instance, struct v4l2_ctrl *ctrl)
|
||||
|
||||
int msm_vidc_adjust_delivery_mode(void *instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
s32 adjusted_value;
|
||||
s32 slice_mode = -1;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -141,9 +134,8 @@ int msm_vidc_adjust_delivery_mode(void *instance, struct v4l2_ctrl *ctrl)
|
||||
if (is_decode_session(inst))
|
||||
return 0;
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
adjusted_value = ctrl ? ctrl->val : capability->cap[DELIVERY_MODE].value;
|
||||
adjusted_value = ctrl ? ctrl->val : inst->capabilities[DELIVERY_MODE].value;
|
||||
|
||||
if (msm_vidc_get_parent_value(inst, DELIVERY_MODE, SLICE_MODE,
|
||||
&slice_mode, __func__))
|
||||
@@ -167,14 +159,14 @@ int msm_vidc_set_ir_period(void *instance,
|
||||
u32 ir_type = 0;
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
core = inst->core;
|
||||
|
||||
if (inst->capabilities->cap[IR_TYPE].value ==
|
||||
if (inst->capabilities[IR_TYPE].value ==
|
||||
V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_RANDOM) {
|
||||
if (inst->bufq[OUTPUT_PORT].vb2q->streaming) {
|
||||
i_vpr_h(inst, "%s: dynamic random intra refresh not allowed\n",
|
||||
@@ -182,19 +174,19 @@ int msm_vidc_set_ir_period(void *instance,
|
||||
return 0;
|
||||
}
|
||||
ir_type = HFI_PROP_IR_RANDOM_PERIOD;
|
||||
} else if (inst->capabilities->cap[IR_TYPE].value ==
|
||||
} else if (inst->capabilities[IR_TYPE].value ==
|
||||
V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC) {
|
||||
ir_type = HFI_PROP_IR_CYCLIC_PERIOD;
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid ir_type %d\n",
|
||||
__func__, inst->capabilities->cap[IR_TYPE]);
|
||||
__func__, inst->capabilities[IR_TYPE]);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = venus_hfi_set_ir_period(inst, ir_type, cap_id);
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: failed to set ir period %d\n",
|
||||
__func__, inst->capabilities->cap[IR_PERIOD].value);
|
||||
__func__, inst->capabilities[IR_PERIOD].value);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -206,7 +198,6 @@ int msm_vidc_set_signal_color_info(void *instance,
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
u32 color_info, matrix_coeff, transfer_char, primaries, range;
|
||||
u32 full_range = 0;
|
||||
u32 colour_description_present_flag = 0;
|
||||
@@ -216,18 +207,17 @@ int msm_vidc_set_signal_color_info(void *instance,
|
||||
/* Unspecified video format */
|
||||
u32 video_format = 5;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (!(capability->cap[cap_id].flags & CAP_FLAG_CLIENT_SET)) {
|
||||
if (!(inst->capabilities[cap_id].flags & CAP_FLAG_CLIENT_SET)) {
|
||||
i_vpr_h(inst, "%s: colorspace not configured via control\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
color_info = capability->cap[cap_id].value;
|
||||
color_info = inst->capabilities[cap_id].value;
|
||||
matrix_coeff = color_info & 0xFF;
|
||||
transfer_char = (color_info & 0xFF00) >> 8;
|
||||
primaries = (color_info & 0xFF0000) >> 16;
|
||||
@@ -279,21 +269,19 @@ int msm_vidc_set_signal_color_info(void *instance,
|
||||
|
||||
int msm_vidc_adjust_csc(void *instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
s32 adjusted_value;
|
||||
s32 pix_fmt = -1;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (is_decode_session(inst))
|
||||
return 0;
|
||||
|
||||
adjusted_value = ctrl ? ctrl->val : capability->cap[CSC].value;
|
||||
adjusted_value = ctrl ? ctrl->val : inst->capabilities[CSC].value;
|
||||
|
||||
if (msm_vidc_get_parent_value(inst, CSC, PIX_FMTS,
|
||||
&pix_fmt, __func__))
|
||||
|
@@ -339,7 +339,7 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
struct msm_vidc_core* core;
|
||||
u32 count = 0, data_size = 0, pixel_count = 0, fps = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -347,7 +347,7 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
output_fmt = &inst->fmts[OUTPUT_PORT];
|
||||
input_fmt = &inst->fmts[INPUT_PORT];
|
||||
|
||||
fps = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
fps = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
pixel_count = output_fmt->fmt.pix_mp.width *
|
||||
output_fmt->fmt.pix_mp.height;
|
||||
|
||||
@@ -360,7 +360,7 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
"%s: session %ux%u@%u fps does not support ring buffer\n",
|
||||
__func__, output_fmt->fmt.pix_mp.width,
|
||||
output_fmt->fmt.pix_mp.height, fps);
|
||||
inst->capabilities->cap[cap_id].value = 0;
|
||||
inst->capabilities[cap_id].value = 0;
|
||||
} else {
|
||||
data_size = input_fmt->fmt.pix_mp.plane_fmt[0].sizeimage;
|
||||
rc = call_session_op(core, ring_buf_count, inst, data_size);
|
||||
@@ -369,11 +369,11 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
__func__);
|
||||
/* ignore error */
|
||||
rc = 0;
|
||||
inst->capabilities->cap[cap_id].value = 0;
|
||||
inst->capabilities[cap_id].value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
count = inst->capabilities->cap[cap_id].value;
|
||||
count = inst->capabilities[cap_id].value;
|
||||
i_vpr_h(inst, "%s: ring buffer count: %u\n", __func__, count);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
HFI_PROP_ENC_RING_BIN_BUF,
|
||||
|
@@ -233,7 +233,7 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
struct msm_vidc_core* core;
|
||||
u32 count = 0, data_size = 0, pixel_count = 0, fps = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -241,7 +241,7 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
output_fmt = &inst->fmts[OUTPUT_PORT];
|
||||
input_fmt = &inst->fmts[INPUT_PORT];
|
||||
|
||||
fps = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
fps = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
pixel_count = output_fmt->fmt.pix_mp.width *
|
||||
output_fmt->fmt.pix_mp.height;
|
||||
|
||||
@@ -254,7 +254,7 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
"%s: session %ux%u@%u fps does not support ring buffer\n",
|
||||
__func__, output_fmt->fmt.pix_mp.width,
|
||||
output_fmt->fmt.pix_mp.height, fps);
|
||||
inst->capabilities->cap[cap_id].value = 0;
|
||||
inst->capabilities[cap_id].value = 0;
|
||||
} else {
|
||||
data_size = input_fmt->fmt.pix_mp.plane_fmt[0].sizeimage;
|
||||
rc = call_session_op(core, ring_buf_count, inst, data_size);
|
||||
@@ -263,11 +263,11 @@ static int msm_vidc_set_ring_buffer_count_pineapple(void *instance,
|
||||
__func__);
|
||||
/* ignore error */
|
||||
rc = 0;
|
||||
inst->capabilities->cap[cap_id].value = 0;
|
||||
inst->capabilities[cap_id].value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
count = inst->capabilities->cap[cap_id].value;
|
||||
count = inst->capabilities[cap_id].value;
|
||||
i_vpr_h(inst, "%s: ring buffer count: %u\n", __func__, count);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
HFI_PROP_ENC_RING_BIN_BUF,
|
||||
|
@@ -24,7 +24,7 @@ static u32 msm_vidc_decoder_bin_size_iris2(struct msm_vidc_inst *inst)
|
||||
bool is_interlaced;
|
||||
u32 vpp_delay;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ static u32 msm_vidc_decoder_bin_size_iris2(struct msm_vidc_inst *inst)
|
||||
vpp_delay = inst->decode_vpp_delay.size;
|
||||
else
|
||||
vpp_delay = DEFAULT_BSE_VPP_DELAY;
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_PROGRESSIVE)
|
||||
is_interlaced = false;
|
||||
else
|
||||
@@ -189,7 +189,7 @@ static u32 msm_vidc_decoder_persist_size_iris2(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[META_DOLBY_RPU].value)
|
||||
if (inst->capabilities[META_DOLBY_RPU].value)
|
||||
rpu_enabled = 1;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
@@ -214,7 +214,7 @@ static u32 msm_vidc_decoder_dpb_size_iris2(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_fmt = inst->capabilities[PIX_FMTS].value;
|
||||
if (!is_linear_colorformat(color_fmt))
|
||||
return size;
|
||||
|
||||
@@ -258,7 +258,7 @@ static u32 msm_vidc_encoder_bin_size_iris2(struct msm_vidc_inst *inst)
|
||||
u32 width, height, num_vpp_pipes, stage;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ static u32 msm_vidc_encoder_bin_size_iris2(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
stage = inst->capabilities->cap[STAGE].value;
|
||||
stage = inst->capabilities[STAGE].value;
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
@@ -291,13 +291,13 @@ static u32 msm_vidc_get_recon_buf_count(struct msm_vidc_inst *inst)
|
||||
bool is_hybrid_hp = false;
|
||||
u32 hfi_codec = 0;
|
||||
|
||||
n_bframe = inst->capabilities->cap[B_FRAME].value;
|
||||
ltr_count = inst->capabilities->cap[LTR_COUNT].value;
|
||||
n_bframe = inst->capabilities[B_FRAME].value;
|
||||
ltr_count = inst->capabilities[LTR_COUNT].value;
|
||||
|
||||
if (inst->hfi_layer_type == HFI_HIER_B) {
|
||||
hb_layers = inst->capabilities->cap[ENH_LAYER_COUNT].value + 1;
|
||||
hb_layers = inst->capabilities[ENH_LAYER_COUNT].value + 1;
|
||||
} else {
|
||||
hp_layers = inst->capabilities->cap[ENH_LAYER_COUNT].value + 1;
|
||||
hp_layers = inst->capabilities[ENH_LAYER_COUNT].value + 1;
|
||||
if (inst->hfi_layer_type == HFI_HIER_P_HYBRID_LTR)
|
||||
is_hybrid_hp = true;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ static u32 msm_vidc_encoder_comv_size_iris2(struct msm_vidc_inst* inst)
|
||||
u32 width, height, num_recon = 0;
|
||||
struct v4l2_format* f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -381,12 +381,12 @@ static u32 msm_vidc_encoder_line_size_iris2(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
core = inst->core;
|
||||
if (!core->capabilities || !inst->capabilities) {
|
||||
if (!core->capabilities) {
|
||||
i_vpr_e(inst, "%s: invalid capabilities\n", __func__);
|
||||
return size;
|
||||
}
|
||||
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
pixfmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
pixfmt = inst->capabilities[PIX_FMTS].value;
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
@@ -409,7 +409,7 @@ static u32 msm_vidc_encoder_dpb_size_iris2(struct msm_vidc_inst *inst)
|
||||
struct v4l2_format *f;
|
||||
bool is_tenbit;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -418,7 +418,7 @@ static u32 msm_vidc_encoder_dpb_size_iris2(struct msm_vidc_inst *inst)
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
|
||||
pixfmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
pixfmt = inst->capabilities[PIX_FMTS].value;
|
||||
is_tenbit = (pixfmt == MSM_VIDC_FMT_P010 || pixfmt == MSM_VIDC_FMT_TP10C);
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
@@ -452,7 +452,7 @@ static u32 msm_vidc_encoder_vpss_size_iris2(struct msm_vidc_inst* inst)
|
||||
u32 width, height, driver_colorfmt;
|
||||
struct v4l2_format* f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -478,7 +478,7 @@ static u32 msm_vidc_encoder_vpss_size_iris2(struct msm_vidc_inst* inst)
|
||||
driver_colorfmt = v4l2_colorformat_to_driver(inst,
|
||||
f->fmt.pix_mp.pixelformat, __func__);
|
||||
is_tenbit = is_10bit_colorformat(driver_colorfmt);
|
||||
if (inst->capabilities->cap[BLUR_TYPES].value != MSM_VIDC_BLUR_NONE)
|
||||
if (inst->capabilities[BLUR_TYPES].value != MSM_VIDC_BLUR_NONE)
|
||||
blur = true;
|
||||
|
||||
HFI_BUFFER_VPSS_ENC(size, width, height, ds_enable, blur, is_tenbit);
|
||||
@@ -562,7 +562,7 @@ static int msm_vidc_input_min_count_iris2(struct msm_vidc_inst* inst)
|
||||
u32 input_min_count = 0;
|
||||
u32 total_hb_layer = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -571,9 +571,9 @@ static int msm_vidc_input_min_count_iris2(struct msm_vidc_inst* inst)
|
||||
input_min_count = MIN_DEC_INPUT_BUFFERS;
|
||||
} else if (is_encode_session(inst)) {
|
||||
total_hb_layer = is_hierb_type_requested(inst) ?
|
||||
inst->capabilities->cap[ENH_LAYER_COUNT].value + 1 : 0;
|
||||
inst->capabilities[ENH_LAYER_COUNT].value + 1 : 0;
|
||||
if (inst->codec == MSM_VIDC_H264 &&
|
||||
!inst->capabilities->cap[LAYER_ENABLE].value) {
|
||||
!inst->capabilities[LAYER_ENABLE].value) {
|
||||
total_hb_layer = 0;
|
||||
}
|
||||
HFI_IRIS2_ENC_MIN_INPUT_BUF_COUNT(input_min_count,
|
||||
@@ -601,7 +601,7 @@ static int msm_buffer_dpb_count(struct msm_vidc_inst *inst)
|
||||
|
||||
/* decoder dpb buffer count */
|
||||
if (is_decode_session(inst)) {
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_fmt = inst->capabilities[PIX_FMTS].value;
|
||||
if (is_linear_colorformat(color_fmt))
|
||||
count = inst->buffers.output.min_count;
|
||||
|
||||
|
@@ -815,7 +815,7 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst* inst)
|
||||
u32 width, height;
|
||||
bool res_ok = false;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -833,9 +833,9 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst* inst)
|
||||
height = inp_f->fmt.pix_mp.height;
|
||||
width = inp_f->fmt.pix_mp.width;
|
||||
res_ok = res_is_less_than(width, height, 1280, 720);
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE ||
|
||||
inst->capabilities->cap[LOWLATENCY_MODE].value ||
|
||||
inst->capabilities[LOWLATENCY_MODE].value ||
|
||||
res_ok) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
@@ -844,13 +844,13 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst* inst)
|
||||
width = inst->crop.width;
|
||||
res_ok = !res_is_greater_than(width, height, 4096, 2160);
|
||||
if (res_ok &&
|
||||
(inst->capabilities->cap[LOWLATENCY_MODE].value)) {
|
||||
(inst->capabilities[LOWLATENCY_MODE].value)) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
if (inst->capabilities->cap[LOSSLESS].value)
|
||||
if (inst->capabilities[LOSSLESS].value)
|
||||
work_mode = MSM_VIDC_STAGE_2;
|
||||
|
||||
if (!inst->capabilities->cap[GOP_SIZE].value)
|
||||
if (!inst->capabilities[GOP_SIZE].value)
|
||||
work_mode = MSM_VIDC_STAGE_2;
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid session type\n", __func__);
|
||||
@@ -859,8 +859,8 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst* inst)
|
||||
|
||||
exit:
|
||||
i_vpr_h(inst, "Configuring work mode = %u low latency = %u, gop size = %u\n",
|
||||
work_mode, inst->capabilities->cap[LOWLATENCY_MODE].value,
|
||||
inst->capabilities->cap[GOP_SIZE].value);
|
||||
work_mode, inst->capabilities[LOWLATENCY_MODE].value,
|
||||
inst->capabilities[GOP_SIZE].value);
|
||||
msm_vidc_update_cap_value(inst, STAGE, work_mode, __func__);
|
||||
|
||||
return 0;
|
||||
@@ -883,13 +883,13 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst* inst)
|
||||
goto exit;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE)
|
||||
work_route = MSM_VIDC_PIPE_1;
|
||||
} else if (is_encode_session(inst)) {
|
||||
u32 slice_mode;
|
||||
|
||||
slice_mode = inst->capabilities->cap[SLICE_MODE].value;
|
||||
slice_mode = inst->capabilities[SLICE_MODE].value;
|
||||
|
||||
/*TODO Pipe=1 for legacy CBR*/
|
||||
if (slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES)
|
||||
@@ -909,21 +909,18 @@ exit:
|
||||
|
||||
int msm_vidc_adjust_blur_type_iris2(void *instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
s32 adjusted_value;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
s32 rc_type = -1, cac = -1;
|
||||
s32 pix_fmts = -1, min_quality = -1;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
adjusted_value = ctrl ? ctrl->val :
|
||||
capability->cap[BLUR_TYPES].value;
|
||||
inst->capabilities[BLUR_TYPES].value;
|
||||
|
||||
if (adjusted_value == MSM_VIDC_BLUR_NONE)
|
||||
return 0;
|
||||
@@ -959,18 +956,15 @@ int msm_vidc_adjust_blur_type_iris2(void *instance, struct v4l2_ctrl *ctrl)
|
||||
|
||||
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 = MSM_VIDC_POWER_SAVE_MODE;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (!is_encode_session(inst))
|
||||
return 0;
|
||||
|
||||
@@ -989,13 +983,13 @@ int msm_vidc_decide_quality_mode_iris2(struct msm_vidc_inst* inst)
|
||||
/* NRT session to have max quality unless client configures lesser complexity */
|
||||
if (!is_realtime_session(inst) && mbpf <= max_hq_mbpf) {
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
if (capability->cap[COMPLEXITY].value < DEFAULT_COMPLEXITY)
|
||||
if (inst->capabilities[COMPLEXITY].value < DEFAULT_COMPLEXITY)
|
||||
mode = MSM_VIDC_POWER_SAVE_MODE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Power saving always disabled for CQ and LOSSLESS RC modes. */
|
||||
if (capability->cap[LOSSLESS].value ||
|
||||
if (inst->capabilities[LOSSLESS].value ||
|
||||
(mbpf <= max_hq_mbpf && mbps <= max_hq_mbps))
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
|
||||
|
@@ -22,7 +22,7 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
u32 base_cycles = 0;
|
||||
u32 fps, mbpf;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return freq;
|
||||
}
|
||||
@@ -42,26 +42,26 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
* Even though, most part is common now, in future it may change
|
||||
* between them.
|
||||
*/
|
||||
fw_cycles = fps * inst->capabilities->cap[MB_CYCLES_FW].value;
|
||||
fw_vpp_cycles = fps * inst->capabilities->cap[MB_CYCLES_FW_VPP].value;
|
||||
fw_cycles = fps * inst->capabilities[MB_CYCLES_FW].value;
|
||||
fw_vpp_cycles = fps * inst->capabilities[MB_CYCLES_FW_VPP].value;
|
||||
|
||||
if (inst->domain == MSM_VIDC_ENCODER) {
|
||||
vpp_cycles_per_mb = is_low_power_session(inst) ?
|
||||
inst->capabilities->cap[MB_CYCLES_LP].value :
|
||||
inst->capabilities->cap[MB_CYCLES_VPP].value;
|
||||
inst->capabilities[MB_CYCLES_LP].value :
|
||||
inst->capabilities[MB_CYCLES_VPP].value;
|
||||
|
||||
vpp_cycles = mbs_per_second * vpp_cycles_per_mb /
|
||||
inst->capabilities->cap[PIPE].value;
|
||||
inst->capabilities[PIPE].value;
|
||||
|
||||
/* Factor 1.25 for IbP and 1.375 for I1B2b1P GOP structure */
|
||||
if (inst->capabilities->cap[B_FRAME].value > 1)
|
||||
if (inst->capabilities[B_FRAME].value > 1)
|
||||
vpp_cycles += (vpp_cycles / 4) + (vpp_cycles / 8);
|
||||
else if (inst->capabilities->cap[B_FRAME].value)
|
||||
else if (inst->capabilities[B_FRAME].value)
|
||||
vpp_cycles += vpp_cycles / 4;
|
||||
/* 21 / 20 is minimum overhead factor */
|
||||
vpp_cycles += max(div_u64(vpp_cycles, 20), fw_vpp_cycles);
|
||||
/* 1.01 is multi-pipe overhead */
|
||||
if (inst->capabilities->cap[PIPE].value > 1)
|
||||
if (inst->capabilities[PIPE].value > 1)
|
||||
vpp_cycles += div_u64(vpp_cycles, 100);
|
||||
/*
|
||||
* 1080p@480fps usecase needs exactly 338MHz
|
||||
@@ -80,20 +80,20 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
|
||||
/* VSP */
|
||||
/* bitrate is based on fps, scale it using operating rate */
|
||||
operating_rate = inst->capabilities->cap[OPERATING_RATE].value >> 16;
|
||||
operating_rate = inst->capabilities[OPERATING_RATE].value >> 16;
|
||||
if (operating_rate >
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16) &&
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16)) {
|
||||
(inst->capabilities[FRAME_RATE].value >> 16) &&
|
||||
(inst->capabilities[FRAME_RATE].value >> 16)) {
|
||||
vsp_factor_num = operating_rate;
|
||||
vsp_factor_den = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
vsp_factor_den = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
}
|
||||
vsp_cycles = div_u64(((u64)inst->capabilities->cap[BIT_RATE].value *
|
||||
vsp_cycles = div_u64(((u64)inst->capabilities[BIT_RATE].value *
|
||||
vsp_factor_num), vsp_factor_den);
|
||||
|
||||
base_cycles = inst->capabilities->cap[MB_CYCLES_VSP].value;
|
||||
base_cycles = inst->capabilities[MB_CYCLES_VSP].value;
|
||||
if (inst->codec == MSM_VIDC_VP9) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 170, 100);
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 135, 100);
|
||||
} else {
|
||||
@@ -103,30 +103,30 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
/* VSP FW Overhead 1.05 */
|
||||
vsp_cycles = div_u64(vsp_cycles * 21, 20);
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
vsp_cycles = vsp_cycles * 3;
|
||||
|
||||
vsp_cycles += mbs_per_second * base_cycles;
|
||||
|
||||
} else if (inst->domain == MSM_VIDC_DECODER) {
|
||||
/* VPP */
|
||||
vpp_cycles = mbs_per_second * inst->capabilities->cap[MB_CYCLES_VPP].value /
|
||||
inst->capabilities->cap[PIPE].value;
|
||||
vpp_cycles = mbs_per_second * inst->capabilities[MB_CYCLES_VPP].value /
|
||||
inst->capabilities[PIPE].value;
|
||||
/* 21 / 20 is minimum overhead factor */
|
||||
vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles);
|
||||
/* 1.059 is multi-pipe overhead */
|
||||
if (inst->capabilities->cap[PIPE].value > 1)
|
||||
if (inst->capabilities[PIPE].value > 1)
|
||||
vpp_cycles += div_u64(vpp_cycles * 59, 1000);
|
||||
|
||||
/* VSP */
|
||||
base_cycles = inst->has_bframe ?
|
||||
80 : inst->capabilities->cap[MB_CYCLES_VSP].value;
|
||||
80 : inst->capabilities[MB_CYCLES_VSP].value;
|
||||
bitrate = fps * data_size * 8;
|
||||
vsp_cycles = bitrate;
|
||||
|
||||
if (inst->codec == MSM_VIDC_VP9) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 170, 100);
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 135, 100);
|
||||
} else {
|
||||
@@ -136,7 +136,7 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
/* VSP FW overhead 1.05 */
|
||||
vsp_cycles = div_u64(vsp_cycles * 21, 20);
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
vsp_cycles = vsp_cycles * 3;
|
||||
|
||||
vsp_cycles += mbs_per_second * base_cycles;
|
||||
@@ -146,9 +146,9 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
vsp_cycles += div_u64(vpp_cycles * 25, 100);
|
||||
|
||||
if (inst->codec == MSM_VIDC_VP9 &&
|
||||
inst->capabilities->cap[STAGE].value ==
|
||||
inst->capabilities[STAGE].value ==
|
||||
MSM_VIDC_STAGE_2 &&
|
||||
inst->capabilities->cap[PIPE].value == 4 &&
|
||||
inst->capabilities[PIPE].value == 4 &&
|
||||
bitrate > 90000000)
|
||||
vsp_cycles = msm_vidc_max_freq(inst);
|
||||
} else {
|
||||
|
@@ -24,7 +24,7 @@ static u32 msm_vidc_decoder_bin_size_iris3(struct msm_vidc_inst *inst)
|
||||
bool is_interlaced;
|
||||
u32 vpp_delay;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ static u32 msm_vidc_decoder_bin_size_iris3(struct msm_vidc_inst *inst)
|
||||
vpp_delay = inst->decode_vpp_delay.size;
|
||||
else
|
||||
vpp_delay = DEFAULT_BSE_VPP_DELAY;
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_PROGRESSIVE)
|
||||
is_interlaced = false;
|
||||
else
|
||||
@@ -70,7 +70,7 @@ static u32 msm_vidc_decoder_comv_size_iris3(struct msm_vidc_inst* inst)
|
||||
u32 width, height, num_comv, vpp_delay;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ static u32 msm_vidc_decoder_comv_size_iris3(struct msm_vidc_inst* inst)
|
||||
* should not be allocated separately.
|
||||
* When DRAP is disabled, COMV buffer must be allocated.
|
||||
*/
|
||||
if (inst->capabilities->cap[DRAP].value)
|
||||
if (inst->capabilities[DRAP].value)
|
||||
size = 0;
|
||||
else
|
||||
HFI_BUFFER_COMV_AV1D(size, width, height, num_comv);
|
||||
@@ -242,7 +242,7 @@ static u32 msm_vidc_decoder_persist_size_iris3(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[META_DOLBY_RPU].value)
|
||||
if (inst->capabilities[META_DOLBY_RPU].value)
|
||||
rpu_enabled = 1;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264) {
|
||||
@@ -259,10 +259,10 @@ static u32 msm_vidc_decoder_persist_size_iris3(struct msm_vidc_inst *inst)
|
||||
* When DRAP is disabled, COMV buffer should not be included in PERSIST
|
||||
* buffer.
|
||||
*/
|
||||
if (inst->capabilities->cap[DRAP].value)
|
||||
if (inst->capabilities[DRAP].value)
|
||||
HFI_BUFFER_PERSIST_AV1D(size,
|
||||
inst->capabilities->cap[FRAME_WIDTH].max,
|
||||
inst->capabilities->cap[FRAME_HEIGHT].max, 16);
|
||||
inst->capabilities[FRAME_WIDTH].max,
|
||||
inst->capabilities[FRAME_HEIGHT].max, 16);
|
||||
else
|
||||
HFI_BUFFER_PERSIST_AV1D(size, 0, 0, 0);
|
||||
}
|
||||
@@ -289,13 +289,13 @@ static u32 msm_vidc_decoder_dpb_size_iris3(struct msm_vidc_inst *inst)
|
||||
* for linear formats. For AV1, DPB is needed for film-grain
|
||||
* enabled bitstreams (UBWC & linear).
|
||||
*/
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_fmt = inst->capabilities[PIX_FMTS].value;
|
||||
if (!is_linear_colorformat(color_fmt)) {
|
||||
if (inst->codec != MSM_VIDC_AV1)
|
||||
return size;
|
||||
|
||||
if (inst->codec == MSM_VIDC_AV1 &&
|
||||
!inst->capabilities->cap[FILM_GRAIN].value)
|
||||
!inst->capabilities[FILM_GRAIN].value)
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ static u32 msm_vidc_encoder_bin_size_iris3(struct msm_vidc_inst *inst)
|
||||
u32 width, height, num_vpp_pipes, stage, profile;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -351,11 +351,11 @@ static u32 msm_vidc_encoder_bin_size_iris3(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
stage = inst->capabilities->cap[STAGE].value;
|
||||
stage = inst->capabilities[STAGE].value;
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
profile = inst->capabilities->cap[PROFILE].value;
|
||||
profile = inst->capabilities[PROFILE].value;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
HFI_BUFFER_BIN_H264E(size, inst->hfi_rc_type, width,
|
||||
@@ -375,13 +375,13 @@ static u32 msm_vidc_get_recon_buf_count(struct msm_vidc_inst *inst)
|
||||
bool is_hybrid_hp = false;
|
||||
u32 hfi_codec = 0;
|
||||
|
||||
n_bframe = inst->capabilities->cap[B_FRAME].value;
|
||||
ltr_count = inst->capabilities->cap[LTR_COUNT].value;
|
||||
n_bframe = inst->capabilities[B_FRAME].value;
|
||||
ltr_count = inst->capabilities[LTR_COUNT].value;
|
||||
|
||||
if (inst->hfi_layer_type == HFI_HIER_B) {
|
||||
hb_layers = inst->capabilities->cap[ENH_LAYER_COUNT].value + 1;
|
||||
hb_layers = inst->capabilities[ENH_LAYER_COUNT].value + 1;
|
||||
} else {
|
||||
hp_layers = inst->capabilities->cap[ENH_LAYER_COUNT].value + 1;
|
||||
hp_layers = inst->capabilities[ENH_LAYER_COUNT].value + 1;
|
||||
if (inst->hfi_layer_type == HFI_HIER_P_HYBRID_LTR)
|
||||
is_hybrid_hp = true;
|
||||
}
|
||||
@@ -403,7 +403,7 @@ static u32 msm_vidc_encoder_comv_size_iris3(struct msm_vidc_inst* inst)
|
||||
u32 width, height, num_recon = 0;
|
||||
struct v4l2_format* f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -465,12 +465,12 @@ static u32 msm_vidc_encoder_line_size_iris3(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
core = inst->core;
|
||||
if (!core->capabilities || !inst->capabilities) {
|
||||
if (!core->capabilities) {
|
||||
i_vpr_e(inst, "%s: invalid capabilities\n", __func__);
|
||||
return size;
|
||||
}
|
||||
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
pixfmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
pixfmt = inst->capabilities[PIX_FMTS].value;
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
@@ -493,7 +493,7 @@ static u32 msm_vidc_encoder_dpb_size_iris3(struct msm_vidc_inst *inst)
|
||||
struct v4l2_format *f;
|
||||
bool is_tenbit;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -502,7 +502,7 @@ static u32 msm_vidc_encoder_dpb_size_iris3(struct msm_vidc_inst *inst)
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
|
||||
pixfmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
pixfmt = inst->capabilities[PIX_FMTS].value;
|
||||
is_tenbit = (pixfmt == MSM_VIDC_FMT_P010 || pixfmt == MSM_VIDC_FMT_TP10C);
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
@@ -536,7 +536,7 @@ static u32 msm_vidc_encoder_vpss_size_iris3(struct msm_vidc_inst* inst)
|
||||
u32 width, height, driver_colorfmt;
|
||||
struct v4l2_format* f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -562,7 +562,7 @@ static u32 msm_vidc_encoder_vpss_size_iris3(struct msm_vidc_inst* inst)
|
||||
driver_colorfmt = v4l2_colorformat_to_driver(inst,
|
||||
f->fmt.pix_mp.pixelformat, __func__);
|
||||
is_tenbit = is_10bit_colorformat(driver_colorfmt);
|
||||
if (inst->capabilities->cap[BLUR_TYPES].value != MSM_VIDC_BLUR_NONE)
|
||||
if (inst->capabilities[BLUR_TYPES].value != MSM_VIDC_BLUR_NONE)
|
||||
blur = true;
|
||||
|
||||
HFI_BUFFER_VPSS_ENC(size, width, height, ds_enable, blur, is_tenbit);
|
||||
@@ -579,7 +579,7 @@ static u32 msm_vidc_encoder_output_size_iris3(struct msm_vidc_inst *inst)
|
||||
u32 hfi_rc_type = HFI_RC_VBR_CFR;
|
||||
enum msm_vidc_codec_type codec;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -589,8 +589,8 @@ static u32 msm_vidc_encoder_output_size_iris3(struct msm_vidc_inst *inst)
|
||||
if (codec == MSM_VIDC_HEVC || codec == MSM_VIDC_HEIC)
|
||||
is_ten_bit = true;
|
||||
|
||||
bitrate_mode = inst->capabilities->cap[BITRATE_MODE].value;
|
||||
frame_rc = inst->capabilities->cap[FRAME_RC_ENABLE].value;
|
||||
bitrate_mode = inst->capabilities[BITRATE_MODE].value;
|
||||
frame_rc = inst->capabilities[FRAME_RC_ENABLE].value;
|
||||
if (!frame_rc && !is_image_session(inst))
|
||||
hfi_rc_type = HFI_RC_OFF;
|
||||
else if (bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ)
|
||||
@@ -681,7 +681,7 @@ static int msm_vidc_input_min_count_iris3(struct msm_vidc_inst* inst)
|
||||
u32 input_min_count = 0;
|
||||
u32 total_hb_layer = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -690,9 +690,9 @@ static int msm_vidc_input_min_count_iris3(struct msm_vidc_inst* inst)
|
||||
input_min_count = MIN_DEC_INPUT_BUFFERS;
|
||||
} else if (is_encode_session(inst)) {
|
||||
total_hb_layer = is_hierb_type_requested(inst) ?
|
||||
inst->capabilities->cap[ENH_LAYER_COUNT].value + 1 : 0;
|
||||
inst->capabilities[ENH_LAYER_COUNT].value + 1 : 0;
|
||||
if (inst->codec == MSM_VIDC_H264 &&
|
||||
!inst->capabilities->cap[LAYER_ENABLE].value) {
|
||||
!inst->capabilities[LAYER_ENABLE].value) {
|
||||
total_hb_layer = 0;
|
||||
}
|
||||
HFI_IRIS3_ENC_MIN_INPUT_BUF_COUNT(input_min_count,
|
||||
@@ -720,10 +720,10 @@ static int msm_buffer_dpb_count(struct msm_vidc_inst *inst)
|
||||
|
||||
/* decoder dpb buffer count */
|
||||
if (is_decode_session(inst)) {
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_fmt = inst->capabilities[PIX_FMTS].value;
|
||||
if (is_linear_colorformat(color_fmt) ||
|
||||
(inst->codec == MSM_VIDC_AV1 &&
|
||||
(inst->capabilities->cap[FILM_GRAIN].value)))
|
||||
(inst->capabilities[FILM_GRAIN].value)))
|
||||
count = inst->buffers.output.min_count;
|
||||
|
||||
return count;
|
||||
@@ -743,13 +743,13 @@ static int msm_buffer_delivery_mode_based_min_count_iris3(struct msm_vidc_inst *
|
||||
u32 slice_mode = 0;
|
||||
u32 delivery_mode = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return count;
|
||||
}
|
||||
|
||||
slice_mode = inst->capabilities->cap[SLICE_MODE].value;
|
||||
delivery_mode = inst->capabilities->cap[DELIVERY_MODE].value;
|
||||
slice_mode = inst->capabilities[SLICE_MODE].value;
|
||||
delivery_mode = inst->capabilities[DELIVERY_MODE].value;
|
||||
|
||||
if (slice_mode != V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB ||
|
||||
(!delivery_mode))
|
||||
@@ -759,7 +759,7 @@ static int msm_buffer_delivery_mode_based_min_count_iris3(struct msm_vidc_inst *
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
|
||||
max_mbs_per_slice = inst->capabilities->cap[SLICE_MAX_MB].value;
|
||||
max_mbs_per_slice = inst->capabilities[SLICE_MAX_MB].value;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
hfi_codec = HFI_CODEC_ENCODE_AVC;
|
||||
|
@@ -862,7 +862,7 @@ int msm_vidc_decide_work_mode_iris3(struct msm_vidc_inst* inst)
|
||||
u32 width, height;
|
||||
bool res_ok = false;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -880,9 +880,9 @@ int msm_vidc_decide_work_mode_iris3(struct msm_vidc_inst* inst)
|
||||
height = inp_f->fmt.pix_mp.height;
|
||||
width = inp_f->fmt.pix_mp.width;
|
||||
res_ok = res_is_less_than(width, height, 1280, 720);
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE ||
|
||||
inst->capabilities->cap[LOWLATENCY_MODE].value ||
|
||||
inst->capabilities[LOWLATENCY_MODE].value ||
|
||||
res_ok) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
@@ -891,17 +891,17 @@ int msm_vidc_decide_work_mode_iris3(struct msm_vidc_inst* inst)
|
||||
width = inst->crop.width;
|
||||
res_ok = !res_is_greater_than(width, height, 4096, 2160);
|
||||
if (res_ok &&
|
||||
(inst->capabilities->cap[LOWLATENCY_MODE].value)) {
|
||||
(inst->capabilities[LOWLATENCY_MODE].value)) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
if (inst->capabilities->cap[SLICE_MODE].value ==
|
||||
if (inst->capabilities[SLICE_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
if (inst->capabilities->cap[LOSSLESS].value)
|
||||
if (inst->capabilities[LOSSLESS].value)
|
||||
work_mode = MSM_VIDC_STAGE_2;
|
||||
|
||||
if (!inst->capabilities->cap[GOP_SIZE].value)
|
||||
if (!inst->capabilities[GOP_SIZE].value)
|
||||
work_mode = MSM_VIDC_STAGE_2;
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid session type\n", __func__);
|
||||
@@ -910,8 +910,8 @@ int msm_vidc_decide_work_mode_iris3(struct msm_vidc_inst* inst)
|
||||
|
||||
exit:
|
||||
i_vpr_h(inst, "Configuring work mode = %u low latency = %u, gop size = %u\n",
|
||||
work_mode, inst->capabilities->cap[LOWLATENCY_MODE].value,
|
||||
inst->capabilities->cap[GOP_SIZE].value);
|
||||
work_mode, inst->capabilities[LOWLATENCY_MODE].value,
|
||||
inst->capabilities[GOP_SIZE].value);
|
||||
msm_vidc_update_cap_value(inst, STAGE, work_mode, __func__);
|
||||
|
||||
return 0;
|
||||
@@ -934,13 +934,13 @@ int msm_vidc_decide_work_route_iris3(struct msm_vidc_inst* inst)
|
||||
goto exit;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE)
|
||||
work_route = MSM_VIDC_PIPE_1;
|
||||
} else if (is_encode_session(inst)) {
|
||||
u32 slice_mode;
|
||||
|
||||
slice_mode = inst->capabilities->cap[SLICE_MODE].value;
|
||||
slice_mode = inst->capabilities[SLICE_MODE].value;
|
||||
|
||||
/*TODO Pipe=1 for legacy CBR*/
|
||||
if (slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES)
|
||||
@@ -960,30 +960,27 @@ exit:
|
||||
|
||||
int msm_vidc_decide_quality_mode_iris3(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 = MSM_VIDC_POWER_SAVE_MODE;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (!is_encode_session(inst))
|
||||
return 0;
|
||||
|
||||
/* image or lossless or all intra runs at quality mode */
|
||||
if (is_image_session(inst) || capability->cap[LOSSLESS].value ||
|
||||
capability->cap[ALL_INTRA].value) {
|
||||
if (is_image_session(inst) || inst->capabilities[LOSSLESS].value ||
|
||||
inst->capabilities[ALL_INTRA].value) {
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
goto decision_done;
|
||||
}
|
||||
|
||||
/* for lesser complexity, make LP for all resolution */
|
||||
if (capability->cap[COMPLEXITY].value < DEFAULT_COMPLEXITY) {
|
||||
if (inst->capabilities[COMPLEXITY].value < DEFAULT_COMPLEXITY) {
|
||||
mode = MSM_VIDC_POWER_SAVE_MODE;
|
||||
goto decision_done;
|
||||
}
|
||||
@@ -995,8 +992,8 @@ int msm_vidc_decide_quality_mode_iris3(struct msm_vidc_inst* inst)
|
||||
max_hq_mbps = core->capabilities[MAX_MBPS_HQ].value;;
|
||||
|
||||
if (!is_realtime_session(inst)) {
|
||||
if (((capability->cap[COMPLEXITY].flags & CAP_FLAG_CLIENT_SET) &&
|
||||
(capability->cap[COMPLEXITY].value >= DEFAULT_COMPLEXITY)) ||
|
||||
if (((inst->capabilities[COMPLEXITY].flags & CAP_FLAG_CLIENT_SET) &&
|
||||
(inst->capabilities[COMPLEXITY].value >= DEFAULT_COMPLEXITY)) ||
|
||||
mbpf <= max_hq_mbpf) {
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
goto decision_done;
|
||||
@@ -1014,7 +1011,6 @@ decision_done:
|
||||
|
||||
int msm_vidc_adjust_bitrate_boost_iris3(void* instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability* capability = NULL;
|
||||
s32 adjusted_value;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
s32 rc_type = -1;
|
||||
@@ -1022,15 +1018,13 @@ int msm_vidc_adjust_bitrate_boost_iris3(void* instance, struct v4l2_ctrl *ctrl)
|
||||
struct v4l2_format *f;
|
||||
u32 max_bitrate = 0, bitrate = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
adjusted_value = ctrl ? ctrl->val :
|
||||
capability->cap[BITRATE_BOOST].value;
|
||||
inst->capabilities[BITRATE_BOOST].value;
|
||||
|
||||
if (inst->bufq[OUTPUT_PORT].vb2q->streaming)
|
||||
return 0;
|
||||
@@ -1048,7 +1042,7 @@ int msm_vidc_adjust_bitrate_boost_iris3(void* instance, struct v4l2_ctrl *ctrl)
|
||||
goto adjust;
|
||||
}
|
||||
|
||||
frame_rate = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
frame_rate = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
f= &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
@@ -1058,7 +1052,7 @@ int msm_vidc_adjust_bitrate_boost_iris3(void* instance, struct v4l2_ctrl *ctrl)
|
||||
* if client did not set, keep max bitrate boost upto 4k@60fps
|
||||
* and remove bitrate boost after 4k@60fps
|
||||
*/
|
||||
if (capability->cap[BITRATE_BOOST].flags & CAP_FLAG_CLIENT_SET) {
|
||||
if (inst->capabilities[BITRATE_BOOST].flags & CAP_FLAG_CLIENT_SET) {
|
||||
/* accept client set bitrate boost value as is */
|
||||
} else {
|
||||
if (res_is_less_than_or_equal_to(width, height, 4096, 2176) &&
|
||||
@@ -1069,7 +1063,7 @@ int msm_vidc_adjust_bitrate_boost_iris3(void* instance, struct v4l2_ctrl *ctrl)
|
||||
}
|
||||
|
||||
max_bitrate = msm_vidc_get_max_bitrate(inst);
|
||||
bitrate = inst->capabilities->cap[BIT_RATE].value;
|
||||
bitrate = inst->capabilities[BIT_RATE].value;
|
||||
if (adjusted_value) {
|
||||
if ((bitrate + bitrate / (100 / adjusted_value)) > max_bitrate) {
|
||||
i_vpr_h(inst,
|
||||
|
@@ -37,7 +37,7 @@ static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_s
|
||||
if (inst->codec == MSM_VIDC_H264) {
|
||||
codec_input->codec = CODEC_H264;
|
||||
codec_input->lcu_size = 16;
|
||||
if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC)
|
||||
codec_input->entropy_coding_mode = CODEC_ENTROPY_CODING_CABAC;
|
||||
else
|
||||
@@ -56,24 +56,24 @@ static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_s
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
codec_input->pipe_num = inst->capabilities->cap[PIPE].value;
|
||||
codec_input->pipe_num = inst->capabilities[PIPE].value;
|
||||
codec_input->frame_rate = inst->max_rate;
|
||||
|
||||
port = inst->domain == MSM_VIDC_DECODER ? INPUT_PORT : OUTPUT_PORT;
|
||||
codec_input->frame_width = inst->fmts[port].fmt.pix_mp.width;
|
||||
codec_input->frame_height = inst->fmts[port].fmt.pix_mp.height;
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1) {
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1) {
|
||||
codec_input->vsp_vpp_mode = CODEC_VSPVPP_MODE_1S;
|
||||
} else if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
} else if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
codec_input->vsp_vpp_mode = CODEC_VSPVPP_MODE_2S;
|
||||
} else {
|
||||
d_vpr_e("%s: invalid stage %d\n", __func__,
|
||||
inst->capabilities->cap[STAGE].value);
|
||||
inst->capabilities[STAGE].value);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[BIT_DEPTH].value == BIT_DEPTH_8)
|
||||
if (inst->capabilities[BIT_DEPTH].value == BIT_DEPTH_8)
|
||||
codec_input->bitdepth = CODEC_BITDEPTH_8;
|
||||
else
|
||||
codec_input->bitdepth = CODEC_BITDEPTH_10;
|
||||
@@ -81,7 +81,7 @@ static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_s
|
||||
/*
|
||||
* Used for calculating Encoder GOP Complexity
|
||||
* hierachical_layer=0..7 used as Array Index
|
||||
* inst->capabilities->cap[B_FRAME].value=[ 0 1 2 ]
|
||||
* inst->capabilities[B_FRAME].value=[ 0 1 2]
|
||||
* TODO how to map?
|
||||
*/
|
||||
|
||||
@@ -155,15 +155,15 @@ static int msm_vidc_init_codec_input_bus(struct msm_vidc_inst *inst, struct vidc
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
codec_input->entropy_coding_mode = CODEC_ENTROPY_CODING_CABAC;
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC) {
|
||||
codec_input->entropy_coding_mode = CODEC_ENTROPY_CODING_CAVLC;
|
||||
} else {
|
||||
d_vpr_e("%s: invalid entropy %d\n", __func__,
|
||||
inst->capabilities->cap[ENTROPY_MODE].value);
|
||||
inst->capabilities[ENTROPY_MODE].value);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ static u64 msm_vidc_calc_freq_iris3_new(struct msm_vidc_inst *inst, u32 data_siz
|
||||
struct api_calculation_freq_output codec_output;
|
||||
u32 fps, mbpf;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return freq;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ u64 msm_vidc_calc_freq_iris3(struct msm_vidc_inst *inst, u32 data_size)
|
||||
{
|
||||
u64 freq = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return freq;
|
||||
}
|
||||
@@ -387,7 +387,7 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
u32 base_cycles = 0;
|
||||
u32 fps, mbpf;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return freq;
|
||||
}
|
||||
@@ -408,26 +408,26 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
* Even though, most part is common now, in future it may change
|
||||
* between them.
|
||||
*/
|
||||
fw_cycles = fps * inst->capabilities->cap[MB_CYCLES_FW].value;
|
||||
fw_vpp_cycles = fps * inst->capabilities->cap[MB_CYCLES_FW_VPP].value;
|
||||
fw_cycles = fps * inst->capabilities[MB_CYCLES_FW].value;
|
||||
fw_vpp_cycles = fps * inst->capabilities[MB_CYCLES_FW_VPP].value;
|
||||
|
||||
if (inst->domain == MSM_VIDC_ENCODER) {
|
||||
vpp_cycles_per_mb = is_low_power_session(inst) ?
|
||||
inst->capabilities->cap[MB_CYCLES_LP].value :
|
||||
inst->capabilities->cap[MB_CYCLES_VPP].value;
|
||||
inst->capabilities[MB_CYCLES_LP].value :
|
||||
inst->capabilities[MB_CYCLES_VPP].value;
|
||||
|
||||
vpp_cycles = mbs_per_second * vpp_cycles_per_mb /
|
||||
inst->capabilities->cap[PIPE].value;
|
||||
inst->capabilities[PIPE].value;
|
||||
|
||||
/* Factor 1.25 for IbP and 1.375 for I1B2b1P GOP structure */
|
||||
if (inst->capabilities->cap[B_FRAME].value > 1)
|
||||
if (inst->capabilities[B_FRAME].value > 1)
|
||||
vpp_cycles += (vpp_cycles / 4) + (vpp_cycles / 8);
|
||||
else if (inst->capabilities->cap[B_FRAME].value)
|
||||
else if (inst->capabilities[B_FRAME].value)
|
||||
vpp_cycles += vpp_cycles / 4;
|
||||
/* 21 / 20 is minimum overhead factor */
|
||||
vpp_cycles += max(div_u64(vpp_cycles, 20), fw_vpp_cycles);
|
||||
/* 1.01 is multi-pipe overhead */
|
||||
if (inst->capabilities->cap[PIPE].value > 1)
|
||||
if (inst->capabilities[PIPE].value > 1)
|
||||
vpp_cycles += div_u64(vpp_cycles, 100);
|
||||
/*
|
||||
* 1080p@480fps usecase needs exactly 338MHz
|
||||
@@ -445,25 +445,25 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
vpp_cycles += div_u64(vpp_cycles * 5, 100);
|
||||
|
||||
/* increase vpp_cycles by 50% for preprocessing */
|
||||
if (inst->capabilities->cap[REQUEST_PREPROCESS].value)
|
||||
if (inst->capabilities[REQUEST_PREPROCESS].value)
|
||||
vpp_cycles = vpp_cycles + vpp_cycles / 2;
|
||||
|
||||
/* VSP */
|
||||
/* bitrate is based on fps, scale it using operating rate */
|
||||
operating_rate = inst->capabilities->cap[OPERATING_RATE].value >> 16;
|
||||
operating_rate = inst->capabilities[OPERATING_RATE].value >> 16;
|
||||
if (operating_rate >
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16) &&
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16)) {
|
||||
(inst->capabilities[FRAME_RATE].value >> 16) &&
|
||||
(inst->capabilities[FRAME_RATE].value >> 16)) {
|
||||
vsp_factor_num = operating_rate;
|
||||
vsp_factor_den = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
vsp_factor_den = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
}
|
||||
vsp_cycles = div_u64(((u64)inst->capabilities->cap[BIT_RATE].value *
|
||||
vsp_cycles = div_u64(((u64)inst->capabilities[BIT_RATE].value *
|
||||
vsp_factor_num), vsp_factor_den);
|
||||
|
||||
base_cycles = inst->capabilities->cap[MB_CYCLES_VSP].value;
|
||||
base_cycles = inst->capabilities[MB_CYCLES_VSP].value;
|
||||
if (inst->codec == MSM_VIDC_VP9) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 170, 100);
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 135, 100);
|
||||
} else {
|
||||
@@ -473,18 +473,18 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
/* VSP FW Overhead 1.05 */
|
||||
vsp_cycles = div_u64(vsp_cycles * 21, 20);
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
vsp_cycles = vsp_cycles * 3;
|
||||
|
||||
vsp_cycles += mbs_per_second * base_cycles;
|
||||
|
||||
} else if (inst->domain == MSM_VIDC_DECODER) {
|
||||
/* VPP */
|
||||
vpp_cycles = mbs_per_second * inst->capabilities->cap[MB_CYCLES_VPP].value /
|
||||
inst->capabilities->cap[PIPE].value;
|
||||
vpp_cycles = mbs_per_second * inst->capabilities[MB_CYCLES_VPP].value /
|
||||
inst->capabilities[PIPE].value;
|
||||
/* 21 / 20 is minimum overhead factor */
|
||||
vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles);
|
||||
if (inst->capabilities->cap[PIPE].value > 1) {
|
||||
if (inst->capabilities[PIPE].value > 1) {
|
||||
if (inst->codec == MSM_VIDC_AV1) {
|
||||
/*
|
||||
* Additional vpp_cycles are required for bitstreams with
|
||||
@@ -493,7 +493,7 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
* non-recommended tiles: 1080P_V4XH2_V4X1, UHD_V8X4_V8X1,
|
||||
* 8KUHD_V8X8_V8X1
|
||||
*/
|
||||
if (inst->capabilities->cap[SUPER_BLOCK].value)
|
||||
if (inst->capabilities[SUPER_BLOCK].value)
|
||||
vpp_cycles += div_u64(vpp_cycles * 1464, 1000);
|
||||
else
|
||||
vpp_cycles += div_u64(vpp_cycles * 410, 1000);
|
||||
@@ -536,7 +536,7 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
input_bitrate_mbps = fps * data_size * 8 / (1024 * 1024);
|
||||
vsp_hw_min_frequency = freq_tbl_value * 1000 * input_bitrate_mbps;
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
vsp_hw_min_frequency +=
|
||||
(bitrate_2stage[bitrate_entry] * fw_sw_vsp_offset - 1);
|
||||
vsp_hw_min_frequency = div_u64(vsp_hw_min_frequency,
|
||||
@@ -553,13 +553,13 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
vsp_cycles = vsp_hw_min_frequency * 1000000;
|
||||
} else {
|
||||
base_cycles = inst->has_bframe ?
|
||||
80 : inst->capabilities->cap[MB_CYCLES_VSP].value;
|
||||
80 : inst->capabilities[MB_CYCLES_VSP].value;
|
||||
bitrate = fps * data_size * 8;
|
||||
vsp_cycles = bitrate;
|
||||
|
||||
if (inst->codec == MSM_VIDC_VP9) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 170, 100);
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 135, 100);
|
||||
} else {
|
||||
@@ -569,7 +569,7 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
/* VSP FW overhead 1.05 */
|
||||
vsp_cycles = div_u64(vsp_cycles * 21, 20);
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
vsp_cycles = vsp_cycles * 3;
|
||||
|
||||
vsp_cycles += mbs_per_second * base_cycles;
|
||||
@@ -584,9 +584,9 @@ static u64 msm_vidc_calc_freq_iris3_legacy(struct msm_vidc_inst *inst, u32 data_
|
||||
}
|
||||
|
||||
if (inst->codec == MSM_VIDC_VP9 &&
|
||||
inst->capabilities->cap[STAGE].value ==
|
||||
inst->capabilities[STAGE].value ==
|
||||
MSM_VIDC_STAGE_2 &&
|
||||
inst->capabilities->cap[PIPE].value == 4 &&
|
||||
inst->capabilities[PIPE].value == 4 &&
|
||||
bitrate > 90000000)
|
||||
vsp_cycles = msm_vidc_max_freq(inst);
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ static u32 msm_vidc_decoder_bin_size_iris33(struct msm_vidc_inst *inst)
|
||||
bool is_interlaced;
|
||||
u32 vpp_delay;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ static u32 msm_vidc_decoder_bin_size_iris33(struct msm_vidc_inst *inst)
|
||||
vpp_delay = inst->decode_vpp_delay.size;
|
||||
else
|
||||
vpp_delay = DEFAULT_BSE_VPP_DELAY;
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_PROGRESSIVE)
|
||||
is_interlaced = false;
|
||||
else
|
||||
@@ -70,7 +70,7 @@ static u32 msm_vidc_decoder_comv_size_iris33(struct msm_vidc_inst* inst)
|
||||
u32 width, height, num_comv, vpp_delay;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ static u32 msm_vidc_decoder_comv_size_iris33(struct msm_vidc_inst* inst)
|
||||
* should not be allocated separately.
|
||||
* When DRAP is disabled, COMV buffer must be allocated.
|
||||
*/
|
||||
if (inst->capabilities->cap[DRAP].value)
|
||||
if (inst->capabilities[DRAP].value)
|
||||
size = 0;
|
||||
else
|
||||
HFI_BUFFER_COMV_AV1D(size, width, height, num_comv);
|
||||
@@ -242,7 +242,7 @@ static u32 msm_vidc_decoder_persist_size_iris33(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[META_DOLBY_RPU].value)
|
||||
if (inst->capabilities[META_DOLBY_RPU].value)
|
||||
rpu_enabled = 1;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264) {
|
||||
@@ -259,10 +259,10 @@ static u32 msm_vidc_decoder_persist_size_iris33(struct msm_vidc_inst *inst)
|
||||
* When DRAP is disabled, COMV buffer should not be included in PERSIST
|
||||
* buffer.
|
||||
*/
|
||||
if (inst->capabilities->cap[DRAP].value)
|
||||
if (inst->capabilities[DRAP].value)
|
||||
HFI_BUFFER_PERSIST_AV1D(size,
|
||||
inst->capabilities->cap[FRAME_WIDTH].max,
|
||||
inst->capabilities->cap[FRAME_HEIGHT].max, 16);
|
||||
inst->capabilities[FRAME_WIDTH].max,
|
||||
inst->capabilities[FRAME_HEIGHT].max, 16);
|
||||
else
|
||||
HFI_BUFFER_PERSIST_AV1D(size, 0, 0, 0);
|
||||
}
|
||||
@@ -289,13 +289,13 @@ static u32 msm_vidc_decoder_dpb_size_iris33(struct msm_vidc_inst *inst)
|
||||
* for linear formats. For AV1, DPB is needed for film-grain
|
||||
* enabled bitstreams (UBWC & linear).
|
||||
*/
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_fmt = inst->capabilities[PIX_FMTS].value;
|
||||
if (!is_linear_colorformat(color_fmt)) {
|
||||
if (inst->codec != MSM_VIDC_AV1)
|
||||
return size;
|
||||
|
||||
if (inst->codec == MSM_VIDC_AV1 &&
|
||||
!inst->capabilities->cap[FILM_GRAIN].value)
|
||||
!inst->capabilities[FILM_GRAIN].value)
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ static u32 msm_vidc_encoder_bin_size_iris33(struct msm_vidc_inst *inst)
|
||||
u32 width, height, num_vpp_pipes, stage, profile, ring_buf_count;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -351,12 +351,12 @@ static u32 msm_vidc_encoder_bin_size_iris33(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
stage = inst->capabilities->cap[STAGE].value;
|
||||
stage = inst->capabilities[STAGE].value;
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
profile = inst->capabilities->cap[PROFILE].value;
|
||||
ring_buf_count = inst->capabilities->cap[ENC_RING_BUFFER_COUNT].value;
|
||||
profile = inst->capabilities[PROFILE].value;
|
||||
ring_buf_count = inst->capabilities[ENC_RING_BUFFER_COUNT].value;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
HFI_BUFFER_BIN_H264E(size, inst->hfi_rc_type, width,
|
||||
@@ -376,13 +376,13 @@ static u32 msm_vidc_get_recon_buf_count(struct msm_vidc_inst *inst)
|
||||
bool is_hybrid_hp = false;
|
||||
u32 hfi_codec = 0;
|
||||
|
||||
n_bframe = inst->capabilities->cap[B_FRAME].value;
|
||||
ltr_count = inst->capabilities->cap[LTR_COUNT].value;
|
||||
n_bframe = inst->capabilities[B_FRAME].value;
|
||||
ltr_count = inst->capabilities[LTR_COUNT].value;
|
||||
|
||||
if (inst->hfi_layer_type == HFI_HIER_B) {
|
||||
hb_layers = inst->capabilities->cap[ENH_LAYER_COUNT].value + 1;
|
||||
hb_layers = inst->capabilities[ENH_LAYER_COUNT].value + 1;
|
||||
} else {
|
||||
hp_layers = inst->capabilities->cap[ENH_LAYER_COUNT].value + 1;
|
||||
hp_layers = inst->capabilities[ENH_LAYER_COUNT].value + 1;
|
||||
if (inst->hfi_layer_type == HFI_HIER_P_HYBRID_LTR)
|
||||
is_hybrid_hp = true;
|
||||
}
|
||||
@@ -404,7 +404,7 @@ static u32 msm_vidc_encoder_comv_size_iris33(struct msm_vidc_inst* inst)
|
||||
u32 width, height, num_recon = 0;
|
||||
struct v4l2_format* f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return size;
|
||||
}
|
||||
@@ -466,12 +466,12 @@ static u32 msm_vidc_encoder_line_size_iris33(struct msm_vidc_inst *inst)
|
||||
return size;
|
||||
}
|
||||
core = inst->core;
|
||||
if (!core->capabilities || !inst->capabilities) {
|
||||
if (!core->capabilities) {
|
||||
i_vpr_e(inst, "%s: invalid capabilities\n", __func__);
|
||||
return size;
|
||||
}
|
||||
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
pixfmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
pixfmt = inst->capabilities[PIX_FMTS].value;
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
@@ -494,7 +494,7 @@ static u32 msm_vidc_encoder_dpb_size_iris33(struct msm_vidc_inst *inst)
|
||||
struct v4l2_format *f;
|
||||
bool is_tenbit;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -503,7 +503,7 @@ static u32 msm_vidc_encoder_dpb_size_iris33(struct msm_vidc_inst *inst)
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
|
||||
pixfmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
pixfmt = inst->capabilities[PIX_FMTS].value;
|
||||
is_tenbit = (pixfmt == MSM_VIDC_FMT_P010 || pixfmt == MSM_VIDC_FMT_TP10C);
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
@@ -537,7 +537,7 @@ static u32 msm_vidc_encoder_vpss_size_iris33(struct msm_vidc_inst* inst)
|
||||
u32 width, height, driver_colorfmt;
|
||||
struct v4l2_format* f;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -563,7 +563,7 @@ static u32 msm_vidc_encoder_vpss_size_iris33(struct msm_vidc_inst* inst)
|
||||
driver_colorfmt = v4l2_colorformat_to_driver(inst,
|
||||
f->fmt.pix_mp.pixelformat, __func__);
|
||||
is_tenbit = is_10bit_colorformat(driver_colorfmt);
|
||||
if (inst->capabilities->cap[BLUR_TYPES].value != MSM_VIDC_BLUR_NONE)
|
||||
if (inst->capabilities[BLUR_TYPES].value != MSM_VIDC_BLUR_NONE)
|
||||
blur = true;
|
||||
|
||||
HFI_BUFFER_VPSS_ENC(size, width, height, ds_enable, blur, is_tenbit);
|
||||
@@ -580,7 +580,7 @@ static u32 msm_vidc_encoder_output_size_iris33(struct msm_vidc_inst *inst)
|
||||
u32 hfi_rc_type = HFI_RC_VBR_CFR;
|
||||
enum msm_vidc_codec_type codec;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -590,8 +590,8 @@ static u32 msm_vidc_encoder_output_size_iris33(struct msm_vidc_inst *inst)
|
||||
if (codec == MSM_VIDC_HEVC || codec == MSM_VIDC_HEIC)
|
||||
is_ten_bit = true;
|
||||
|
||||
bitrate_mode = inst->capabilities->cap[BITRATE_MODE].value;
|
||||
frame_rc = inst->capabilities->cap[FRAME_RC_ENABLE].value;
|
||||
bitrate_mode = inst->capabilities[BITRATE_MODE].value;
|
||||
frame_rc = inst->capabilities[FRAME_RC_ENABLE].value;
|
||||
if (!frame_rc && !is_image_session(inst))
|
||||
hfi_rc_type = HFI_RC_OFF;
|
||||
else if (bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ)
|
||||
@@ -682,7 +682,7 @@ static int msm_vidc_input_min_count_iris33(struct msm_vidc_inst* inst)
|
||||
u32 input_min_count = 0;
|
||||
u32 total_hb_layer = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -691,9 +691,9 @@ static int msm_vidc_input_min_count_iris33(struct msm_vidc_inst* inst)
|
||||
input_min_count = MIN_DEC_INPUT_BUFFERS;
|
||||
} else if (is_encode_session(inst)) {
|
||||
total_hb_layer = is_hierb_type_requested(inst) ?
|
||||
inst->capabilities->cap[ENH_LAYER_COUNT].value + 1 : 0;
|
||||
inst->capabilities[ENH_LAYER_COUNT].value + 1 : 0;
|
||||
if (inst->codec == MSM_VIDC_H264 &&
|
||||
!inst->capabilities->cap[LAYER_ENABLE].value) {
|
||||
!inst->capabilities[LAYER_ENABLE].value) {
|
||||
total_hb_layer = 0;
|
||||
}
|
||||
HFI_IRIS3_ENC_MIN_INPUT_BUF_COUNT(input_min_count,
|
||||
@@ -721,10 +721,10 @@ static int msm_buffer_dpb_count(struct msm_vidc_inst *inst)
|
||||
|
||||
/* decoder dpb buffer count */
|
||||
if (is_decode_session(inst)) {
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_fmt = inst->capabilities[PIX_FMTS].value;
|
||||
if (is_linear_colorformat(color_fmt) ||
|
||||
(inst->codec == MSM_VIDC_AV1 &&
|
||||
(inst->capabilities->cap[FILM_GRAIN].value)))
|
||||
(inst->capabilities[FILM_GRAIN].value)))
|
||||
count = inst->buffers.output.min_count;
|
||||
|
||||
return count;
|
||||
@@ -744,13 +744,13 @@ static int msm_buffer_delivery_mode_based_min_count_iris33(struct msm_vidc_inst
|
||||
u32 slice_mode = 0;
|
||||
u32 delivery_mode = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return count;
|
||||
}
|
||||
|
||||
slice_mode = inst->capabilities->cap[SLICE_MODE].value;
|
||||
delivery_mode = inst->capabilities->cap[DELIVERY_MODE].value;
|
||||
slice_mode = inst->capabilities[SLICE_MODE].value;
|
||||
delivery_mode = inst->capabilities[DELIVERY_MODE].value;
|
||||
|
||||
if (slice_mode != V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB ||
|
||||
(!delivery_mode))
|
||||
@@ -760,7 +760,7 @@ static int msm_buffer_delivery_mode_based_min_count_iris33(struct msm_vidc_inst
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
|
||||
max_mbs_per_slice = inst->capabilities->cap[SLICE_MAX_MB].value;
|
||||
max_mbs_per_slice = inst->capabilities[SLICE_MAX_MB].value;
|
||||
|
||||
if (inst->codec == MSM_VIDC_H264)
|
||||
hfi_codec = HFI_CODEC_ENCODE_AVC;
|
||||
|
@@ -993,7 +993,7 @@ int msm_vidc_decide_work_mode_iris33(struct msm_vidc_inst* inst)
|
||||
u32 width, height;
|
||||
bool res_ok = false;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1011,9 +1011,9 @@ int msm_vidc_decide_work_mode_iris33(struct msm_vidc_inst* inst)
|
||||
height = inp_f->fmt.pix_mp.height;
|
||||
width = inp_f->fmt.pix_mp.width;
|
||||
res_ok = res_is_less_than(width, height, 1280, 720);
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE ||
|
||||
inst->capabilities->cap[LOWLATENCY_MODE].value ||
|
||||
inst->capabilities[LOWLATENCY_MODE].value ||
|
||||
res_ok) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
@@ -1022,17 +1022,17 @@ int msm_vidc_decide_work_mode_iris33(struct msm_vidc_inst* inst)
|
||||
width = inst->crop.width;
|
||||
res_ok = !res_is_greater_than(width, height, 4096, 2160);
|
||||
if (res_ok &&
|
||||
(inst->capabilities->cap[LOWLATENCY_MODE].value)) {
|
||||
(inst->capabilities[LOWLATENCY_MODE].value)) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
if (inst->capabilities->cap[SLICE_MODE].value ==
|
||||
if (inst->capabilities[SLICE_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES) {
|
||||
work_mode = MSM_VIDC_STAGE_1;
|
||||
}
|
||||
if (inst->capabilities->cap[LOSSLESS].value)
|
||||
if (inst->capabilities[LOSSLESS].value)
|
||||
work_mode = MSM_VIDC_STAGE_2;
|
||||
|
||||
if (!inst->capabilities->cap[GOP_SIZE].value)
|
||||
if (!inst->capabilities[GOP_SIZE].value)
|
||||
work_mode = MSM_VIDC_STAGE_2;
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid session type\n", __func__);
|
||||
@@ -1041,8 +1041,8 @@ int msm_vidc_decide_work_mode_iris33(struct msm_vidc_inst* inst)
|
||||
|
||||
exit:
|
||||
i_vpr_h(inst, "Configuring work mode = %u low latency = %u, gop size = %u\n",
|
||||
work_mode, inst->capabilities->cap[LOWLATENCY_MODE].value,
|
||||
inst->capabilities->cap[GOP_SIZE].value);
|
||||
work_mode, inst->capabilities[LOWLATENCY_MODE].value,
|
||||
inst->capabilities[GOP_SIZE].value);
|
||||
msm_vidc_update_cap_value(inst, STAGE, work_mode, __func__);
|
||||
|
||||
return 0;
|
||||
@@ -1065,13 +1065,13 @@ int msm_vidc_decide_work_route_iris33(struct msm_vidc_inst* inst)
|
||||
goto exit;
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE)
|
||||
work_route = MSM_VIDC_PIPE_1;
|
||||
} else if (is_encode_session(inst)) {
|
||||
u32 slice_mode;
|
||||
|
||||
slice_mode = inst->capabilities->cap[SLICE_MODE].value;
|
||||
slice_mode = inst->capabilities[SLICE_MODE].value;
|
||||
|
||||
/*TODO Pipe=1 for legacy CBR*/
|
||||
if (slice_mode == V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES)
|
||||
@@ -1091,30 +1091,27 @@ exit:
|
||||
|
||||
int msm_vidc_decide_quality_mode_iris33(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 = MSM_VIDC_POWER_SAVE_MODE;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (!is_encode_session(inst))
|
||||
return 0;
|
||||
|
||||
/* image or lossless or all intra runs at quality mode */
|
||||
if (is_image_session(inst) || capability->cap[LOSSLESS].value ||
|
||||
capability->cap[ALL_INTRA].value) {
|
||||
if (is_image_session(inst) || inst->capabilities[LOSSLESS].value ||
|
||||
inst->capabilities[ALL_INTRA].value) {
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
goto decision_done;
|
||||
}
|
||||
|
||||
/* for lesser complexity, make LP for all resolution */
|
||||
if (capability->cap[COMPLEXITY].value < DEFAULT_COMPLEXITY) {
|
||||
if (inst->capabilities[COMPLEXITY].value < DEFAULT_COMPLEXITY) {
|
||||
mode = MSM_VIDC_POWER_SAVE_MODE;
|
||||
goto decision_done;
|
||||
}
|
||||
@@ -1126,8 +1123,8 @@ int msm_vidc_decide_quality_mode_iris33(struct msm_vidc_inst* inst)
|
||||
max_hq_mbps = core->capabilities[MAX_MBPS_HQ].value;;
|
||||
|
||||
if (!is_realtime_session(inst)) {
|
||||
if (((capability->cap[COMPLEXITY].flags & CAP_FLAG_CLIENT_SET) &&
|
||||
(capability->cap[COMPLEXITY].value >= DEFAULT_COMPLEXITY)) ||
|
||||
if (((inst->capabilities[COMPLEXITY].flags & CAP_FLAG_CLIENT_SET) &&
|
||||
(inst->capabilities[COMPLEXITY].value >= DEFAULT_COMPLEXITY)) ||
|
||||
mbpf <= max_hq_mbpf) {
|
||||
mode = MSM_VIDC_MAX_QUALITY_MODE;
|
||||
goto decision_done;
|
||||
@@ -1145,7 +1142,6 @@ decision_done:
|
||||
|
||||
int msm_vidc_adjust_bitrate_boost_iris33(void* instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability* capability = NULL;
|
||||
s32 adjusted_value;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
s32 rc_type = -1;
|
||||
@@ -1153,15 +1149,13 @@ int msm_vidc_adjust_bitrate_boost_iris33(void* instance, struct v4l2_ctrl *ctrl)
|
||||
struct v4l2_format *f;
|
||||
u32 max_bitrate = 0, bitrate = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
adjusted_value = ctrl ? ctrl->val :
|
||||
capability->cap[BITRATE_BOOST].value;
|
||||
inst->capabilities[BITRATE_BOOST].value;
|
||||
|
||||
if (inst->bufq[OUTPUT_PORT].vb2q->streaming)
|
||||
return 0;
|
||||
@@ -1179,7 +1173,7 @@ int msm_vidc_adjust_bitrate_boost_iris33(void* instance, struct v4l2_ctrl *ctrl)
|
||||
goto adjust;
|
||||
}
|
||||
|
||||
frame_rate = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
frame_rate = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
f= &inst->fmts[OUTPUT_PORT];
|
||||
width = f->fmt.pix_mp.width;
|
||||
height = f->fmt.pix_mp.height;
|
||||
@@ -1189,7 +1183,7 @@ int msm_vidc_adjust_bitrate_boost_iris33(void* instance, struct v4l2_ctrl *ctrl)
|
||||
* if client did not set, keep max bitrate boost upto 4k@60fps
|
||||
* and remove bitrate boost after 4k@60fps
|
||||
*/
|
||||
if (capability->cap[BITRATE_BOOST].flags & CAP_FLAG_CLIENT_SET) {
|
||||
if (inst->capabilities[BITRATE_BOOST].flags & CAP_FLAG_CLIENT_SET) {
|
||||
/* accept client set bitrate boost value as is */
|
||||
} else {
|
||||
if (res_is_less_than_or_equal_to(width, height, 4096, 2176) &&
|
||||
@@ -1200,7 +1194,7 @@ int msm_vidc_adjust_bitrate_boost_iris33(void* instance, struct v4l2_ctrl *ctrl)
|
||||
}
|
||||
|
||||
max_bitrate = msm_vidc_get_max_bitrate(inst);
|
||||
bitrate = inst->capabilities->cap[BIT_RATE].value;
|
||||
bitrate = inst->capabilities[BIT_RATE].value;
|
||||
if (adjusted_value) {
|
||||
if ((bitrate + bitrate / (100 / adjusted_value)) > max_bitrate) {
|
||||
i_vpr_h(inst,
|
||||
|
@@ -25,17 +25,17 @@ static int msm_vidc_get_hier_layer_val(struct msm_vidc_inst *inst)
|
||||
int hierachical_layer = CODEC_GOP_IPP;
|
||||
|
||||
if (inst->domain == MSM_VIDC_ENCODER) {
|
||||
if (inst->capabilities->cap[ALL_INTRA].value) {
|
||||
if (inst->capabilities[ALL_INTRA].value) {
|
||||
/* no P and B frames case */
|
||||
hierachical_layer = CODEC_GOP_IONLY;
|
||||
} else if (inst->capabilities->cap[B_FRAME].value == 0) {
|
||||
} else if (inst->capabilities[B_FRAME].value == 0) {
|
||||
/* no B frames case */
|
||||
hierachical_layer = CODEC_GOP_IPP;
|
||||
} else { /* P and B frames enabled case */
|
||||
if (inst->capabilities->cap[ENH_LAYER_COUNT].value == 0 ||
|
||||
inst->capabilities->cap[ENH_LAYER_COUNT].value == 1)
|
||||
if (inst->capabilities[ENH_LAYER_COUNT].value == 0 ||
|
||||
inst->capabilities[ENH_LAYER_COUNT].value == 1)
|
||||
hierachical_layer = CODEC_GOP_IbP;
|
||||
else if (inst->capabilities->cap[ENH_LAYER_COUNT].value == 2)
|
||||
else if (inst->capabilities[ENH_LAYER_COUNT].value == 2)
|
||||
hierachical_layer = CODEC_GOP_I1B2b1P;
|
||||
else
|
||||
hierachical_layer = CODEC_GOP_I3B4b1P;
|
||||
@@ -65,7 +65,7 @@ static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_s
|
||||
if (inst->codec == MSM_VIDC_H264) {
|
||||
codec_input->codec = CODEC_H264;
|
||||
codec_input->lcu_size = 16;
|
||||
if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
codec_input->entropy_coding_mode = CODEC_ENTROPY_CODING_CABAC;
|
||||
codec_input->codec = CODEC_H264;
|
||||
@@ -87,24 +87,24 @@ static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_s
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
codec_input->pipe_num = inst->capabilities->cap[PIPE].value;
|
||||
codec_input->pipe_num = inst->capabilities[PIPE].value;
|
||||
codec_input->frame_rate = inst->max_rate;
|
||||
|
||||
port = inst->domain == MSM_VIDC_DECODER ? INPUT_PORT : OUTPUT_PORT;
|
||||
codec_input->frame_width = inst->fmts[port].fmt.pix_mp.width;
|
||||
codec_input->frame_height = inst->fmts[port].fmt.pix_mp.height;
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1) {
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1) {
|
||||
codec_input->vsp_vpp_mode = CODEC_VSPVPP_MODE_1S;
|
||||
} else if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
} else if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
codec_input->vsp_vpp_mode = CODEC_VSPVPP_MODE_2S;
|
||||
} else {
|
||||
d_vpr_e("%s: invalid stage %d\n", __func__,
|
||||
inst->capabilities->cap[STAGE].value);
|
||||
inst->capabilities[STAGE].value);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[BIT_DEPTH].value == BIT_DEPTH_8)
|
||||
if (inst->capabilities[BIT_DEPTH].value == BIT_DEPTH_8)
|
||||
codec_input->bitdepth = CODEC_BITDEPTH_8;
|
||||
else
|
||||
codec_input->bitdepth = CODEC_BITDEPTH_10;
|
||||
@@ -126,7 +126,7 @@ static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_s
|
||||
(codec_input->frame_rate * data_size * 8) / 1000000;
|
||||
else
|
||||
codec_input->bitrate_mbps =
|
||||
inst->capabilities->cap[BIT_RATE].value / 1000000;
|
||||
inst->capabilities[BIT_RATE].value / 1000000;
|
||||
|
||||
/* disable av1d commercial tile */
|
||||
codec_input->av1d_commer_tile_enable = 0;
|
||||
@@ -157,17 +157,17 @@ static int msm_vidc_init_codec_input_bus(struct msm_vidc_inst *inst, struct vidc
|
||||
codec_input->chipset_gen = MSM_PINEAPPLE;
|
||||
|
||||
if (d->codec == MSM_VIDC_H264) {
|
||||
if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
codec_input->entropy_coding_mode = CODEC_ENTROPY_CODING_CABAC;
|
||||
codec_input->codec = CODEC_H264;
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC) {
|
||||
codec_input->entropy_coding_mode = CODEC_ENTROPY_CODING_CAVLC;
|
||||
codec_input->codec = CODEC_H264_CAVLC;
|
||||
} else {
|
||||
d_vpr_e("%s: invalid entropy %d\n", __func__,
|
||||
inst->capabilities->cap[ENTROPY_MODE].value);
|
||||
inst->capabilities[ENTROPY_MODE].value);
|
||||
return -EINVAL;
|
||||
}
|
||||
} else if (d->codec == MSM_VIDC_HEVC) {
|
||||
@@ -366,7 +366,7 @@ static u64 msm_vidc_calc_freq_iris33_new(struct msm_vidc_inst *inst, u32 data_si
|
||||
struct api_calculation_freq_output codec_output;
|
||||
u32 fps, mbpf;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return freq;
|
||||
}
|
||||
@@ -386,7 +386,7 @@ static u64 msm_vidc_calc_freq_iris33_new(struct msm_vidc_inst *inst, u32 data_si
|
||||
return freq;
|
||||
|
||||
if (inst->domain == MSM_VIDC_ENCODER) {
|
||||
if (!inst->capabilities->cap[ENC_RING_BUFFER_COUNT].value &&
|
||||
if (!inst->capabilities[ENC_RING_BUFFER_COUNT].value &&
|
||||
is_vpp_cycles_close_to_freq_corner(core,
|
||||
codec_output.vpp_min_freq)) {
|
||||
/*
|
||||
@@ -456,7 +456,7 @@ u64 msm_vidc_calc_freq_iris33(struct msm_vidc_inst *inst, u32 data_size)
|
||||
{
|
||||
u64 freq = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return freq;
|
||||
}
|
||||
@@ -481,7 +481,7 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
u32 base_cycles = 0;
|
||||
u32 fps, mbpf;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return freq;
|
||||
}
|
||||
@@ -502,26 +502,26 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
* Even though, most part is common now, in future it may change
|
||||
* between them.
|
||||
*/
|
||||
fw_cycles = fps * inst->capabilities->cap[MB_CYCLES_FW].value;
|
||||
fw_vpp_cycles = fps * inst->capabilities->cap[MB_CYCLES_FW_VPP].value;
|
||||
fw_cycles = fps * inst->capabilities[MB_CYCLES_FW].value;
|
||||
fw_vpp_cycles = fps * inst->capabilities[MB_CYCLES_FW_VPP].value;
|
||||
|
||||
if (inst->domain == MSM_VIDC_ENCODER) {
|
||||
vpp_cycles_per_mb = is_low_power_session(inst) ?
|
||||
inst->capabilities->cap[MB_CYCLES_LP].value :
|
||||
inst->capabilities->cap[MB_CYCLES_VPP].value;
|
||||
inst->capabilities[MB_CYCLES_LP].value :
|
||||
inst->capabilities[MB_CYCLES_VPP].value;
|
||||
|
||||
vpp_cycles = mbs_per_second * vpp_cycles_per_mb /
|
||||
inst->capabilities->cap[PIPE].value;
|
||||
inst->capabilities[PIPE].value;
|
||||
|
||||
/* Factor 1.25 for IbP and 1.375 for I1B2b1P GOP structure */
|
||||
if (inst->capabilities->cap[B_FRAME].value > 1)
|
||||
if (inst->capabilities[B_FRAME].value > 1)
|
||||
vpp_cycles += (vpp_cycles / 4) + (vpp_cycles / 8);
|
||||
else if (inst->capabilities->cap[B_FRAME].value)
|
||||
else if (inst->capabilities[B_FRAME].value)
|
||||
vpp_cycles += vpp_cycles / 4;
|
||||
/* 21 / 20 is minimum overhead factor */
|
||||
vpp_cycles += max(div_u64(vpp_cycles, 20), fw_vpp_cycles);
|
||||
/* 1.01 is multi-pipe overhead */
|
||||
if (inst->capabilities->cap[PIPE].value > 1)
|
||||
if (inst->capabilities[PIPE].value > 1)
|
||||
vpp_cycles += div_u64(vpp_cycles, 100);
|
||||
/*
|
||||
* 1080p@480fps usecase needs exactly 338MHz
|
||||
@@ -539,25 +539,25 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
vpp_cycles += div_u64(vpp_cycles * 5, 100);
|
||||
|
||||
/* increase vpp_cycles by 50% for preprocessing */
|
||||
if (inst->capabilities->cap[REQUEST_PREPROCESS].value)
|
||||
if (inst->capabilities[REQUEST_PREPROCESS].value)
|
||||
vpp_cycles = vpp_cycles + vpp_cycles / 2;
|
||||
|
||||
/* VSP */
|
||||
/* bitrate is based on fps, scale it using operating rate */
|
||||
operating_rate = inst->capabilities->cap[OPERATING_RATE].value >> 16;
|
||||
operating_rate = inst->capabilities[OPERATING_RATE].value >> 16;
|
||||
if (operating_rate >
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16) &&
|
||||
(inst->capabilities->cap[FRAME_RATE].value >> 16)) {
|
||||
(inst->capabilities[FRAME_RATE].value >> 16) &&
|
||||
(inst->capabilities[FRAME_RATE].value >> 16)) {
|
||||
vsp_factor_num = operating_rate;
|
||||
vsp_factor_den = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
vsp_factor_den = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
}
|
||||
vsp_cycles = div_u64(((u64)inst->capabilities->cap[BIT_RATE].value *
|
||||
vsp_cycles = div_u64(((u64)inst->capabilities[BIT_RATE].value *
|
||||
vsp_factor_num), vsp_factor_den);
|
||||
|
||||
base_cycles = inst->capabilities->cap[MB_CYCLES_VSP].value;
|
||||
base_cycles = inst->capabilities[MB_CYCLES_VSP].value;
|
||||
if (inst->codec == MSM_VIDC_VP9) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 170, 100);
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 135, 100);
|
||||
} else {
|
||||
@@ -567,18 +567,18 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
/* VSP FW Overhead 1.05 */
|
||||
vsp_cycles = div_u64(vsp_cycles * 21, 20);
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
vsp_cycles = vsp_cycles * 3;
|
||||
|
||||
vsp_cycles += mbs_per_second * base_cycles;
|
||||
|
||||
} else if (inst->domain == MSM_VIDC_DECODER) {
|
||||
/* VPP */
|
||||
vpp_cycles = mbs_per_second * inst->capabilities->cap[MB_CYCLES_VPP].value /
|
||||
inst->capabilities->cap[PIPE].value;
|
||||
vpp_cycles = mbs_per_second * inst->capabilities[MB_CYCLES_VPP].value /
|
||||
inst->capabilities[PIPE].value;
|
||||
/* 21 / 20 is minimum overhead factor */
|
||||
vpp_cycles += max(vpp_cycles / 20, fw_vpp_cycles);
|
||||
if (inst->capabilities->cap[PIPE].value > 1) {
|
||||
if (inst->capabilities[PIPE].value > 1) {
|
||||
if (inst->codec == MSM_VIDC_AV1) {
|
||||
/*
|
||||
* Additional vpp_cycles are required for bitstreams with
|
||||
@@ -587,7 +587,7 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
* non-recommended tiles: 1080P_V4XH2_V4X1, UHD_V8X4_V8X1,
|
||||
* 8KUHD_V8X8_V8X1
|
||||
*/
|
||||
if (inst->capabilities->cap[SUPER_BLOCK].value)
|
||||
if (inst->capabilities[SUPER_BLOCK].value)
|
||||
vpp_cycles += div_u64(vpp_cycles * 1464, 1000);
|
||||
else
|
||||
vpp_cycles += div_u64(vpp_cycles * 410, 1000);
|
||||
@@ -630,7 +630,7 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
input_bitrate_mbps = fps * data_size * 8 / (1024 * 1024);
|
||||
vsp_hw_min_frequency = freq_tbl_value * 1000 * input_bitrate_mbps;
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_2) {
|
||||
vsp_hw_min_frequency +=
|
||||
(bitrate_2stage[bitrate_entry] * fw_sw_vsp_offset - 1);
|
||||
vsp_hw_min_frequency = div_u64(vsp_hw_min_frequency,
|
||||
@@ -647,13 +647,13 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
vsp_cycles = vsp_hw_min_frequency * 1000000;
|
||||
} else {
|
||||
base_cycles = inst->has_bframe ?
|
||||
80 : inst->capabilities->cap[MB_CYCLES_VSP].value;
|
||||
80 : inst->capabilities[MB_CYCLES_VSP].value;
|
||||
bitrate = fps * data_size * 8;
|
||||
vsp_cycles = bitrate;
|
||||
|
||||
if (inst->codec == MSM_VIDC_VP9) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 170, 100);
|
||||
} else if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
} else if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC) {
|
||||
vsp_cycles = div_u64(vsp_cycles * 135, 100);
|
||||
} else {
|
||||
@@ -663,7 +663,7 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
/* VSP FW overhead 1.05 */
|
||||
vsp_cycles = div_u64(vsp_cycles * 21, 20);
|
||||
|
||||
if (inst->capabilities->cap[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
if (inst->capabilities[STAGE].value == MSM_VIDC_STAGE_1)
|
||||
vsp_cycles = vsp_cycles * 3;
|
||||
|
||||
vsp_cycles += mbs_per_second * base_cycles;
|
||||
@@ -678,9 +678,9 @@ u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size)
|
||||
}
|
||||
|
||||
if (inst->codec == MSM_VIDC_VP9 &&
|
||||
inst->capabilities->cap[STAGE].value ==
|
||||
inst->capabilities[STAGE].value ==
|
||||
MSM_VIDC_STAGE_2 &&
|
||||
inst->capabilities->cap[PIPE].value == 4 &&
|
||||
inst->capabilities[PIPE].value == 4 &&
|
||||
bitrate > 90000000)
|
||||
vsp_cycles = msm_vidc_max_freq(inst);
|
||||
}
|
||||
@@ -1277,7 +1277,7 @@ int msm_vidc_ring_buf_count_iris33(struct msm_vidc_inst *inst, u32 data_size)
|
||||
struct api_calculation_input codec_input;
|
||||
struct api_calculation_freq_output codec_output;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1305,10 +1305,10 @@ int msm_vidc_ring_buf_count_iris33(struct msm_vidc_inst *inst, u32 data_size)
|
||||
if (is_vpp_cycles_close_to_freq_corner(core,
|
||||
codec_output.vpp_min_freq))
|
||||
/* enables ring buffer */
|
||||
inst->capabilities->cap[ENC_RING_BUFFER_COUNT].value =
|
||||
inst->capabilities[ENC_RING_BUFFER_COUNT].value =
|
||||
MAX_ENC_RING_BUF_COUNT;
|
||||
else
|
||||
inst->capabilities->cap[ENC_RING_BUFFER_COUNT].value = 0;
|
||||
inst->capabilities[ENC_RING_BUFFER_COUNT].value = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ static inline bool is_image_session(struct msm_vidc_inst *inst)
|
||||
|
||||
static inline bool is_secure_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!(inst->capabilities->cap[SECURE_MODE].value);
|
||||
return !!(inst->capabilities[SECURE_MODE].value);
|
||||
}
|
||||
|
||||
static inline bool is_input_buffer(enum msm_vidc_buffer_type buffer_type)
|
||||
@@ -70,7 +70,7 @@ static inline bool is_output_meta_buffer(enum msm_vidc_buffer_type buffer_type)
|
||||
|
||||
static inline bool is_ts_reorder_allowed(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!(inst->capabilities->cap[TS_REORDER].value &&
|
||||
return !!(inst->capabilities[TS_REORDER].value &&
|
||||
is_decode_session(inst) && !is_image_session(inst));
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ static inline bool is_scaling_enabled(struct msm_vidc_inst *inst)
|
||||
|
||||
static inline bool is_rotation_90_or_270(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return inst->capabilities->cap[ROTATION].value == 90 ||
|
||||
inst->capabilities->cap[ROTATION].value == 270;
|
||||
return inst->capabilities[ROTATION].value == 90 ||
|
||||
inst->capabilities[ROTATION].value == 270;
|
||||
}
|
||||
|
||||
static inline bool is_internal_buffer(enum msm_vidc_buffer_type buffer_type)
|
||||
@@ -103,7 +103,7 @@ static inline bool is_internal_buffer(enum msm_vidc_buffer_type buffer_type)
|
||||
|
||||
static inline bool is_meta_cap(struct msm_vidc_inst *inst, u32 cap)
|
||||
{
|
||||
if (inst->capabilities->cap[cap].flags & CAP_FLAG_META)
|
||||
if (inst->capabilities[cap].flags & CAP_FLAG_META)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -116,8 +116,8 @@ static inline bool is_meta_rx_inp_enabled(struct msm_vidc_inst *inst, u32 cap)
|
||||
if (!is_meta_cap(inst, cap))
|
||||
return false;
|
||||
|
||||
if (inst->capabilities->cap[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities->cap[cap].value & MSM_VIDC_META_RX_INPUT)
|
||||
if (inst->capabilities[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities[cap].value & MSM_VIDC_META_RX_INPUT)
|
||||
enabled = true;
|
||||
|
||||
return enabled;
|
||||
@@ -130,8 +130,8 @@ static inline bool is_meta_rx_out_enabled(struct msm_vidc_inst *inst, u32 cap)
|
||||
if (!is_meta_cap(inst, cap))
|
||||
return false;
|
||||
|
||||
if (inst->capabilities->cap[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities->cap[cap].value & MSM_VIDC_META_RX_OUTPUT)
|
||||
if (inst->capabilities[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities[cap].value & MSM_VIDC_META_RX_OUTPUT)
|
||||
enabled = true;
|
||||
|
||||
return enabled;
|
||||
@@ -144,8 +144,8 @@ static inline bool is_meta_tx_inp_enabled(struct msm_vidc_inst *inst, u32 cap)
|
||||
if (!is_meta_cap(inst, cap))
|
||||
return false;
|
||||
|
||||
if (inst->capabilities->cap[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities->cap[cap].value & MSM_VIDC_META_TX_INPUT)
|
||||
if (inst->capabilities[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities[cap].value & MSM_VIDC_META_TX_INPUT)
|
||||
enabled = true;
|
||||
|
||||
return enabled;
|
||||
@@ -158,8 +158,8 @@ static inline bool is_dyn_meta_tx_inp_enabled(struct msm_vidc_inst *inst, u32 ca
|
||||
if (!is_meta_cap(inst, cap))
|
||||
return false;
|
||||
|
||||
if (inst->capabilities->cap[cap].value & MSM_VIDC_META_DYN_ENABLE &&
|
||||
inst->capabilities->cap[cap].value & MSM_VIDC_META_TX_INPUT)
|
||||
if (inst->capabilities[cap].value & MSM_VIDC_META_DYN_ENABLE &&
|
||||
inst->capabilities[cap].value & MSM_VIDC_META_TX_INPUT)
|
||||
enabled = true;
|
||||
|
||||
return enabled;
|
||||
@@ -172,8 +172,8 @@ static inline bool is_meta_tx_out_enabled(struct msm_vidc_inst *inst, u32 cap)
|
||||
if (!is_meta_cap(inst, cap))
|
||||
return false;
|
||||
|
||||
if (inst->capabilities->cap[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities->cap[cap].value & MSM_VIDC_META_TX_OUTPUT)
|
||||
if (inst->capabilities[cap].value & MSM_VIDC_META_ENABLE &&
|
||||
inst->capabilities[cap].value & MSM_VIDC_META_TX_OUTPUT)
|
||||
enabled = true;
|
||||
|
||||
return enabled;
|
||||
@@ -186,8 +186,8 @@ static inline bool is_dyn_meta_tx_out_enabled(struct msm_vidc_inst *inst, u32 ca
|
||||
if (!is_meta_cap(inst, cap))
|
||||
return false;
|
||||
|
||||
if (inst->capabilities->cap[cap].value & MSM_VIDC_META_DYN_ENABLE &&
|
||||
inst->capabilities->cap[cap].value & MSM_VIDC_META_TX_OUTPUT)
|
||||
if (inst->capabilities[cap].value & MSM_VIDC_META_DYN_ENABLE &&
|
||||
inst->capabilities[cap].value & MSM_VIDC_META_TX_OUTPUT)
|
||||
enabled = true;
|
||||
|
||||
return enabled;
|
||||
@@ -323,37 +323,37 @@ static inline bool is_rgba_colorformat(enum msm_vidc_colorformat_type colorforma
|
||||
|
||||
static inline bool is_thumbnail_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!(inst->capabilities->cap[THUMBNAIL_MODE].value);
|
||||
return !!(inst->capabilities[THUMBNAIL_MODE].value);
|
||||
}
|
||||
|
||||
static inline bool is_low_power_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return (inst->capabilities->cap[QUALITY_MODE].value ==
|
||||
return (inst->capabilities[QUALITY_MODE].value ==
|
||||
MSM_VIDC_POWER_SAVE_MODE);
|
||||
}
|
||||
|
||||
static inline bool is_realtime_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return inst->capabilities->cap[PRIORITY].value == 0 ? true : false;
|
||||
return inst->capabilities[PRIORITY].value == 0 ? true : false;
|
||||
}
|
||||
|
||||
static inline bool is_critical_priority_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!(inst->capabilities->cap[CRITICAL_PRIORITY].value);
|
||||
return !!(inst->capabilities[CRITICAL_PRIORITY].value);
|
||||
}
|
||||
|
||||
static inline bool is_lowlatency_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!(inst->capabilities->cap[LOWLATENCY_MODE].value);
|
||||
return !!(inst->capabilities[LOWLATENCY_MODE].value);
|
||||
}
|
||||
|
||||
static inline bool is_hierb_type_requested(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return (inst->codec == MSM_VIDC_H264 &&
|
||||
inst->capabilities->cap[LAYER_TYPE].value ==
|
||||
inst->capabilities[LAYER_TYPE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B) ||
|
||||
(inst->codec == MSM_VIDC_HEVC &&
|
||||
inst->capabilities->cap[LAYER_TYPE].value ==
|
||||
inst->capabilities[LAYER_TYPE].value ==
|
||||
V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B);
|
||||
}
|
||||
|
||||
@@ -386,9 +386,9 @@ static inline bool is_enc_slice_delivery_mode(struct msm_vidc_inst *inst)
|
||||
if (is_decode_session(inst))
|
||||
return false;
|
||||
|
||||
return (inst->capabilities->cap[SLICE_MODE].value ==
|
||||
return (inst->capabilities[SLICE_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB &&
|
||||
inst->capabilities->cap[DELIVERY_MODE].value);
|
||||
inst->capabilities[DELIVERY_MODE].value);
|
||||
}
|
||||
|
||||
const char *cap_name(enum msm_vidc_inst_capability_type cap_id);
|
||||
|
@@ -132,7 +132,7 @@ struct msm_vidc_inst {
|
||||
struct msm_vidc_debug debug;
|
||||
struct debug_buf_count debug_count;
|
||||
struct msm_vidc_statistics stats;
|
||||
struct msm_vidc_inst_capability *capabilities;
|
||||
struct msm_vidc_inst_cap capabilities[INST_CAP_MAX+1];
|
||||
struct completion completions[MAX_SIGNAL];
|
||||
struct msm_vidc_fence_context fence_context;
|
||||
bool active;
|
||||
|
@@ -291,7 +291,7 @@ static int msm_vdec_set_cabac(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cabac = inst->capabilities->cap[ENTROPY_MODE].value;
|
||||
cabac = inst->capabilities[ENTROPY_MODE].value;
|
||||
inst->subcr_params[port].cabac = cabac;
|
||||
i_vpr_h(inst, "%s: entropy mode: %d", __func__, cabac);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
@@ -318,7 +318,7 @@ static int msm_vdec_set_coded_frames(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_PROGRESSIVE)
|
||||
coded_frames = HFI_BITMASK_FRAME_MBS_ONLY_FLAG;
|
||||
inst->subcr_params[port].coded_frames = coded_frames;
|
||||
@@ -472,7 +472,7 @@ static int msm_vdec_set_profile(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
profile = inst->capabilities->cap[PROFILE].value;
|
||||
profile = inst->capabilities[PROFILE].value;
|
||||
inst->subcr_params[port].profile = profile;
|
||||
i_vpr_h(inst, "%s: profile: %d", __func__, profile);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
@@ -501,7 +501,7 @@ static int msm_vdec_set_level(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
level = inst->capabilities->cap[LEVEL].value;
|
||||
level = inst->capabilities[LEVEL].value;
|
||||
inst->subcr_params[port].level = level;
|
||||
i_vpr_h(inst, "%s: level: %d", __func__, level);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
@@ -530,7 +530,7 @@ static int msm_vdec_set_tier(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tier = inst->capabilities->cap[HEVC_TIER].value;
|
||||
tier = inst->capabilities[HEVC_TIER].value;
|
||||
inst->subcr_params[port].tier = tier;
|
||||
i_vpr_h(inst, "%s: tier: %d", __func__, tier);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
@@ -560,7 +560,7 @@ static int msm_vdec_set_av1_film_grain_present(struct msm_vidc_inst *inst,
|
||||
}
|
||||
|
||||
inst->subcr_params[port].av1_film_grain_present =
|
||||
inst->capabilities->cap[FILM_GRAIN].value;
|
||||
inst->capabilities[FILM_GRAIN].value;
|
||||
fg_present = inst->subcr_params[port].av1_film_grain_present;
|
||||
i_vpr_h(inst, "%s: film grain present: %d", __func__, fg_present);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
@@ -590,7 +590,7 @@ static int msm_vdec_set_av1_superblock_enabled(struct msm_vidc_inst *inst,
|
||||
}
|
||||
|
||||
inst->subcr_params[port].av1_super_block_enabled =
|
||||
inst->capabilities->cap[SUPER_BLOCK].value;
|
||||
inst->capabilities[SUPER_BLOCK].value;
|
||||
sb_enabled = inst->subcr_params[port].av1_super_block_enabled;
|
||||
i_vpr_h(inst, "%s: super block enabled: %d", __func__, sb_enabled);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
@@ -617,9 +617,9 @@ static int msm_vdec_set_opb_enable(struct msm_vidc_inst *inst)
|
||||
if (inst->codec != MSM_VIDC_AV1)
|
||||
return 0;
|
||||
|
||||
color_fmt = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_fmt = inst->capabilities[PIX_FMTS].value;
|
||||
if (is_linear_colorformat(color_fmt) ||
|
||||
inst->capabilities->cap[FILM_GRAIN].value)
|
||||
inst->capabilities[FILM_GRAIN].value)
|
||||
opb_enable = 1;
|
||||
|
||||
i_vpr_h(inst, "%s: OPB enable: %d", __func__, opb_enable);
|
||||
@@ -975,15 +975,13 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
payload[0] = HFI_MODE_METADATA;
|
||||
if (port == INPUT_PORT) {
|
||||
for (i = INST_CAP_NONE + 1; i < INST_CAP_MAX; i++) {
|
||||
@@ -996,7 +994,7 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -1011,7 +1009,7 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -1038,15 +1036,13 @@ static int msm_vdec_set_delivery_mode_metadata(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
payload[0] = HFI_MODE_METADATA;
|
||||
|
||||
if (port == INPUT_PORT) {
|
||||
@@ -1058,7 +1054,7 @@ static int msm_vdec_set_delivery_mode_metadata(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -1073,7 +1069,7 @@ static int msm_vdec_set_delivery_mode_metadata(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -1100,26 +1096,24 @@ static int msm_vdec_set_delivery_mode_property(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
static const u32 property_output_list[] = {
|
||||
META_OUTBUF_FENCE,
|
||||
};
|
||||
static const u32 property_input_list[] = {};
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
payload[0] = HFI_MODE_PROPERTY;
|
||||
|
||||
if (port == INPUT_PORT) {
|
||||
for (i = 0; i < ARRAY_SIZE(property_input_list); i++) {
|
||||
if (capability->cap[property_input_list[i]].value) {
|
||||
if (inst->capabilities[property_input_list[i]].value) {
|
||||
payload[count + 1] =
|
||||
capability->cap[property_input_list[i]].hfi_id;
|
||||
inst->capabilities[property_input_list[i]].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -1135,13 +1129,13 @@ static int msm_vdec_set_delivery_mode_property(struct msm_vidc_inst *inst,
|
||||
* delivery mode property.
|
||||
*/
|
||||
payload[count + 1] =
|
||||
capability->cap[property_output_list[i]].hfi_id;
|
||||
inst->capabilities[property_output_list[i]].hfi_id;
|
||||
count++;
|
||||
continue;
|
||||
}
|
||||
if (capability->cap[property_output_list[i]].value) {
|
||||
if (inst->capabilities[property_output_list[i]].value) {
|
||||
payload[count + 1] =
|
||||
capability->cap[property_output_list[i]].hfi_id;
|
||||
inst->capabilities[property_output_list[i]].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -1171,7 +1165,7 @@ int msm_vdec_init_input_subcr_params(struct msm_vidc_inst *inst)
|
||||
u32 colour_description_present_flag = 0;
|
||||
u32 video_signal_type_present_flag = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1211,12 +1205,12 @@ int msm_vdec_init_input_subcr_params(struct msm_vidc_inst *inst)
|
||||
((video_format << 26) & 0x1C000000) |
|
||||
((video_signal_type_present_flag << 29) & 0x20000000);
|
||||
|
||||
subsc_params->profile = inst->capabilities->cap[PROFILE].value;
|
||||
subsc_params->level = inst->capabilities->cap[LEVEL].value;
|
||||
subsc_params->tier = inst->capabilities->cap[HEVC_TIER].value;
|
||||
subsc_params->pic_order_cnt = inst->capabilities->cap[POC].value;
|
||||
subsc_params->bit_depth = inst->capabilities->cap[BIT_DEPTH].value;
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
subsc_params->profile = inst->capabilities[PROFILE].value;
|
||||
subsc_params->level = inst->capabilities[LEVEL].value;
|
||||
subsc_params->tier = inst->capabilities[HEVC_TIER].value;
|
||||
subsc_params->pic_order_cnt = inst->capabilities[POC].value;
|
||||
subsc_params->bit_depth = inst->capabilities[BIT_DEPTH].value;
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_PROGRESSIVE)
|
||||
subsc_params->coded_frames = HFI_BITMASK_FRAME_MBS_ONLY_FLAG;
|
||||
else
|
||||
@@ -1230,12 +1224,12 @@ int msm_vdec_set_num_comv(struct msm_vidc_inst *inst)
|
||||
int rc = 0;
|
||||
u32 num_comv = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
num_comv = inst->capabilities->cap[NUM_COMV].value;
|
||||
num_comv = inst->capabilities[NUM_COMV].value;
|
||||
i_vpr_h(inst, "%s: num COMV: %d", __func__, num_comv);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
HFI_PROP_COMV_BUFFER_COUNT,
|
||||
@@ -1263,7 +1257,7 @@ static int msm_vdec_read_input_subcr_params(struct msm_vidc_inst *inst)
|
||||
u32 video_signal_type_present_flag = 0;
|
||||
enum msm_vidc_colorformat_type output_fmt;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1377,7 +1371,7 @@ static int msm_vdec_read_input_subcr_params(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
/* disable META_OUTBUF_FENCE if session is Interlace type */
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE) {
|
||||
msm_vidc_update_cap_value(inst, META_OUTBUF_FENCE,
|
||||
MSM_VIDC_META_RX_INPUT |
|
||||
@@ -1762,13 +1756,11 @@ static int msm_vdec_update_max_map_output_count(struct msm_vidc_inst *inst)
|
||||
int msm_vdec_streamon_output(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (is_output_meta_enabled(inst) &&
|
||||
!inst->bufq[OUTPUT_META_PORT].vb2q->streaming) {
|
||||
@@ -1778,8 +1770,8 @@ int msm_vdec_streamon_output(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (capability->cap[CODED_FRAMES].value == CODED_FRAMES_INTERLACE &&
|
||||
!is_ubwc_colorformat(capability->cap[PIX_FMTS].value)) {
|
||||
if (inst->capabilities[CODED_FRAMES].value == CODED_FRAMES_INTERLACE &&
|
||||
!is_ubwc_colorformat(inst->capabilities[PIX_FMTS].value)) {
|
||||
i_vpr_e(inst,
|
||||
"%s: interlace with non-ubwc color format is unsupported\n",
|
||||
__func__);
|
||||
@@ -2006,13 +1998,13 @@ int msm_vdec_qbuf(struct msm_vidc_inst *inst, struct vb2_buffer *vb2)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !vb2 || !inst->capabilities) {
|
||||
if (!inst || !vb2) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->adjust_priority) {
|
||||
s32 priority = inst->capabilities->cap[PRIORITY].value;
|
||||
s32 priority = inst->capabilities[PRIORITY].value;
|
||||
|
||||
priority += inst->adjust_priority;
|
||||
inst->adjust_priority = 0;
|
||||
@@ -2029,7 +2021,7 @@ int msm_vdec_qbuf(struct msm_vidc_inst *inst, struct vb2_buffer *vb2)
|
||||
return rc;
|
||||
|
||||
if (vb2->type == OUTPUT_MPLANE) {
|
||||
if (inst->capabilities->cap[DPB_LIST].value) {
|
||||
if (inst->capabilities[DPB_LIST].value) {
|
||||
rc = msm_vdec_release_nonref_buffers(inst);
|
||||
if (rc)
|
||||
return rc;
|
||||
@@ -2099,21 +2091,19 @@ int msm_vdec_stop_cmd(struct msm_vidc_inst *inst)
|
||||
|
||||
int msm_vdec_start_cmd(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
i_vpr_h(inst, "received cmd: resume\n");
|
||||
vb2_clear_last_buffer_dequeued(inst->bufq[OUTPUT_META_PORT].vb2q);
|
||||
vb2_clear_last_buffer_dequeued(inst->bufq[OUTPUT_PORT].vb2q);
|
||||
|
||||
if (capability->cap[CODED_FRAMES].value == CODED_FRAMES_INTERLACE &&
|
||||
!is_ubwc_colorformat(capability->cap[PIX_FMTS].value)) {
|
||||
if (inst->capabilities[CODED_FRAMES].value == CODED_FRAMES_INTERLACE &&
|
||||
!is_ubwc_colorformat(inst->capabilities[PIX_FMTS].value)) {
|
||||
i_vpr_e(inst,
|
||||
"%s: interlace with non-ubwc color format is unsupported\n",
|
||||
__func__);
|
||||
@@ -2527,13 +2517,13 @@ static int msm_vdec_check_colorformat_supported(struct msm_vidc_inst* inst,
|
||||
* bit_depth 10 bit supports 10 bit colorformats only
|
||||
* interlace supports ubwc colorformats only
|
||||
*/
|
||||
if (inst->capabilities->cap[BIT_DEPTH].value == BIT_DEPTH_8 &&
|
||||
if (inst->capabilities[BIT_DEPTH].value == BIT_DEPTH_8 &&
|
||||
!is_8bit_colorformat(colorformat))
|
||||
supported = false;
|
||||
if (inst->capabilities->cap[BIT_DEPTH].value == BIT_DEPTH_10 &&
|
||||
if (inst->capabilities[BIT_DEPTH].value == BIT_DEPTH_10 &&
|
||||
!is_10bit_colorformat(colorformat))
|
||||
supported = false;
|
||||
if (inst->capabilities->cap[CODED_FRAMES].value ==
|
||||
if (inst->capabilities[CODED_FRAMES].value ==
|
||||
CODED_FRAMES_INTERLACE &&
|
||||
!is_ubwc_colorformat(colorformat))
|
||||
supported = false;
|
||||
@@ -2548,7 +2538,7 @@ int msm_vdec_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
|
||||
u32 array[32] = {0};
|
||||
u32 i = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities || !f ||
|
||||
if (!inst || !inst->core || !f ||
|
||||
f->index >= ARRAY_SIZE(array)) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
@@ -2576,7 +2566,7 @@ int msm_vdec_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
|
||||
f->flags = V4L2_FMT_FLAG_COMPRESSED;
|
||||
strlcpy(f->description, "codec", sizeof(f->description));
|
||||
} else if (f->type == OUTPUT_MPLANE) {
|
||||
u32 formats = inst->capabilities->cap[PIX_FMTS].step_or_mask;
|
||||
u32 formats = inst->capabilities[PIX_FMTS].step_or_mask;
|
||||
u32 idx = 0;
|
||||
|
||||
for (i = 0; i <= 31; i++) {
|
||||
|
@@ -122,7 +122,7 @@ static int msm_venc_set_colorformat(struct msm_vidc_inst *inst,
|
||||
|
||||
pixelformat = inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat;
|
||||
colorformat = v4l2_colorformat_to_driver(inst, pixelformat, __func__);
|
||||
if (!(colorformat & inst->capabilities->cap[PIX_FMTS].step_or_mask)) {
|
||||
if (!(colorformat & inst->capabilities[PIX_FMTS].step_or_mask)) {
|
||||
i_vpr_e(inst, "%s: invalid pixelformat %s\n",
|
||||
__func__, v4l2_pixelfmt_name(inst, pixelformat));
|
||||
return -EINVAL;
|
||||
@@ -156,7 +156,7 @@ static int msm_venc_set_stride_scanline(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
color_format = inst->capabilities->cap[PIX_FMTS].value;
|
||||
color_format = inst->capabilities[PIX_FMTS].value;
|
||||
if (!is_linear_colorformat(color_format)) {
|
||||
i_vpr_h(inst,
|
||||
"%s: not a linear color fmt, property is not set\n",
|
||||
@@ -331,7 +331,7 @@ static int msm_venc_set_colorspace(struct msm_vidc_inst* inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[SIGNAL_COLOR_INFO].flags & CAP_FLAG_CLIENT_SET) {
|
||||
if (inst->capabilities[SIGNAL_COLOR_INFO].flags & CAP_FLAG_CLIENT_SET) {
|
||||
i_vpr_h(inst, "%s: client configured colorspace via control\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -397,7 +397,7 @@ static int msm_venc_set_csc(struct msm_vidc_inst* inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
csc = inst->capabilities->cap[CSC].value;
|
||||
csc = inst->capabilities[CSC].value;
|
||||
i_vpr_h(inst, "%s: csc: %u\n", __func__, csc);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
HFI_PROP_CSC,
|
||||
@@ -416,7 +416,6 @@ static int msm_venc_set_quality_mode(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core* core = inst->core;
|
||||
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
||||
u32 mode;
|
||||
|
||||
rc = call_session_op(core, decide_quality_mode, inst);
|
||||
@@ -426,7 +425,7 @@ static int msm_venc_set_quality_mode(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mode = capability->cap[QUALITY_MODE].value;
|
||||
mode = inst->capabilities[QUALITY_MODE].value;
|
||||
i_vpr_h(inst, "%s: quality_mode: %u\n", __func__, mode);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
HFI_PROP_QUALITY_MODE,
|
||||
@@ -445,11 +444,7 @@ static int msm_venc_set_ring_buffer_count(struct msm_vidc_inst *inst)
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
|
||||
if (!inst->capabilities) {
|
||||
i_vpr_e(inst, "%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
cap = &inst->capabilities->cap[ENC_RING_BUFFER_COUNT];
|
||||
cap = &inst->capabilities[ENC_RING_BUFFER_COUNT];
|
||||
|
||||
if (!cap->set)
|
||||
return 0;
|
||||
@@ -720,7 +715,6 @@ static int msm_venc_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
@@ -728,7 +722,6 @@ static int msm_venc_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
}
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
payload[0] = HFI_MODE_METADATA;
|
||||
|
||||
if (port == INPUT_PORT) {
|
||||
@@ -740,7 +733,7 @@ static int msm_venc_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -753,7 +746,7 @@ static int msm_venc_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -780,15 +773,13 @@ static int msm_venc_dynamic_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
payload[0] = HFI_MODE_DYNAMIC_METADATA;
|
||||
|
||||
if (port != INPUT_PORT) {
|
||||
@@ -804,7 +795,7 @@ static int msm_venc_dynamic_metadata_delivery(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -827,7 +818,6 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
@@ -835,7 +825,6 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
}
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
payload[0] = HFI_MODE_METADATA;
|
||||
|
||||
if (port == INPUT_PORT) {
|
||||
@@ -847,7 +836,7 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -860,7 +849,7 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
__func__, count, sizeof(payload) / sizeof(u32));
|
||||
return -EINVAL;
|
||||
}
|
||||
payload[count + 1] = capability->cap[i].hfi_id;
|
||||
payload[count + 1] = inst->capabilities[i].hfi_id;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -885,7 +874,7 @@ int msm_venc_streamoff_input(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -901,7 +890,7 @@ int msm_venc_streamon_input(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -969,7 +958,7 @@ int msm_venc_qbuf(struct msm_vidc_inst *inst, struct vb2_buffer *vb2)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1024,7 +1013,7 @@ int msm_venc_streamoff_output(struct msm_vidc_inst *inst)
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1036,7 +1025,7 @@ int msm_venc_streamoff_output(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
/* restore LAYER_COUNT max allowed value */
|
||||
inst->capabilities->cap[ENH_LAYER_COUNT].max =
|
||||
inst->capabilities[ENH_LAYER_COUNT].max =
|
||||
core->capabilities[MAX_ENH_LAYER_COUNT].value;
|
||||
|
||||
rc = msm_vidc_session_streamoff(inst, OUTPUT_PORT);
|
||||
@@ -1050,7 +1039,7 @@ int msm_venc_streamon_output(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1282,7 +1271,7 @@ static int msm_venc_s_fmt_input(struct msm_vidc_inst *inst, struct v4l2_format *
|
||||
struct msm_vidc_core *core;
|
||||
u32 pix_fmt, width, height, size, bytesperline;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1629,7 +1618,6 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
|
||||
struct v4l2_streamparm *s_parm)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst_capability *capability = NULL;
|
||||
struct v4l2_fract *timeperframe = NULL;
|
||||
u32 q16_rate, max_rate, default_rate;
|
||||
u64 us_per_frame = 0, input_rate = 0;
|
||||
@@ -1639,18 +1627,17 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (s_parm->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
||||
timeperframe = &s_parm->parm.output.timeperframe;
|
||||
max_rate = capability->cap[OPERATING_RATE].max >> 16;
|
||||
default_rate = capability->cap[OPERATING_RATE].value >> 16;
|
||||
max_rate = inst->capabilities[OPERATING_RATE].max >> 16;
|
||||
default_rate = inst->capabilities[OPERATING_RATE].value >> 16;
|
||||
s_parm->parm.output.capability = V4L2_CAP_TIMEPERFRAME;
|
||||
} else {
|
||||
timeperframe = &s_parm->parm.capture.timeperframe;
|
||||
is_frame_rate = true;
|
||||
max_rate = capability->cap[FRAME_RATE].max >> 16;
|
||||
default_rate = capability->cap[FRAME_RATE].value >> 16;
|
||||
max_rate = inst->capabilities[FRAME_RATE].max >> 16;
|
||||
default_rate = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
s_parm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
|
||||
}
|
||||
|
||||
@@ -1700,9 +1687,9 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
|
||||
}
|
||||
|
||||
if (is_frame_rate)
|
||||
capability->cap[FRAME_RATE].flags |= CAP_FLAG_CLIENT_SET;
|
||||
inst->capabilities[FRAME_RATE].flags |= CAP_FLAG_CLIENT_SET;
|
||||
else
|
||||
capability->cap[OPERATING_RATE].flags |= CAP_FLAG_CLIENT_SET;
|
||||
inst->capabilities[OPERATING_RATE].flags |= CAP_FLAG_CLIENT_SET;
|
||||
/*
|
||||
* In static case, frame rate is set via
|
||||
* inst database set function mentioned in
|
||||
@@ -1741,26 +1728,24 @@ exit:
|
||||
int msm_venc_g_param(struct msm_vidc_inst *inst,
|
||||
struct v4l2_streamparm *s_parm)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability = NULL;
|
||||
struct v4l2_fract *timeperframe = NULL;
|
||||
|
||||
if (!inst || !s_parm) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (s_parm->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
||||
timeperframe = &s_parm->parm.output.timeperframe;
|
||||
timeperframe->numerator = 1;
|
||||
timeperframe->denominator =
|
||||
capability->cap[OPERATING_RATE].value >> 16;
|
||||
inst->capabilities[OPERATING_RATE].value >> 16;
|
||||
s_parm->parm.output.capability = V4L2_CAP_TIMEPERFRAME;
|
||||
} else {
|
||||
timeperframe = &s_parm->parm.capture.timeperframe;
|
||||
timeperframe->numerator = 1;
|
||||
timeperframe->denominator =
|
||||
capability->cap[FRAME_RATE].value >> 16;
|
||||
inst->capabilities[FRAME_RATE].value >> 16;
|
||||
s_parm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
|
||||
}
|
||||
|
||||
@@ -1805,7 +1790,7 @@ int msm_venc_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
|
||||
u32 array[32] = {0};
|
||||
u32 i = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities || !f ||
|
||||
if (!inst || !inst->core || !f ||
|
||||
f->index >= ARRAY_SIZE(array)) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
@@ -1836,7 +1821,7 @@ int msm_venc_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
|
||||
f->flags = V4L2_FMT_FLAG_COMPRESSED;
|
||||
strlcpy(f->description, "codec", sizeof(f->description));
|
||||
} else if (f->type == INPUT_MPLANE) {
|
||||
u32 formats = inst->capabilities->cap[PIX_FMTS].step_or_mask;
|
||||
u32 formats = inst->capabilities[PIX_FMTS].step_or_mask;
|
||||
u32 idx = 0;
|
||||
|
||||
for (i = 0; i <= 31; i++) {
|
||||
|
@@ -698,7 +698,6 @@ EXPORT_SYMBOL(msm_vidc_stop_cmd);
|
||||
int msm_vidc_enum_framesizes(void *instance, struct v4l2_frmsizeenum *fsize)
|
||||
{
|
||||
struct msm_vidc_inst *inst = instance;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
enum msm_vidc_colorformat_type colorfmt;
|
||||
enum msm_vidc_codec_type codec;
|
||||
u32 meta_fmt;
|
||||
@@ -708,11 +707,6 @@ int msm_vidc_enum_framesizes(void *instance, struct v4l2_frmsizeenum *fsize)
|
||||
__func__, inst, fsize);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!inst->capabilities) {
|
||||
i_vpr_e(inst, "%s: capabilities not available\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
/* only index 0 allowed as per v4l2 spec */
|
||||
if (fsize->index)
|
||||
@@ -734,14 +728,14 @@ int msm_vidc_enum_framesizes(void *instance, struct v4l2_frmsizeenum *fsize)
|
||||
}
|
||||
|
||||
fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
|
||||
fsize->stepwise.min_width = capability->cap[FRAME_WIDTH].min;
|
||||
fsize->stepwise.max_width = capability->cap[FRAME_WIDTH].max;
|
||||
fsize->stepwise.min_width = inst->capabilities[FRAME_WIDTH].min;
|
||||
fsize->stepwise.max_width = inst->capabilities[FRAME_WIDTH].max;
|
||||
fsize->stepwise.step_width =
|
||||
capability->cap[FRAME_WIDTH].step_or_mask;
|
||||
fsize->stepwise.min_height = capability->cap[FRAME_HEIGHT].min;
|
||||
fsize->stepwise.max_height = capability->cap[FRAME_HEIGHT].max;
|
||||
inst->capabilities[FRAME_WIDTH].step_or_mask;
|
||||
fsize->stepwise.min_height = inst->capabilities[FRAME_HEIGHT].min;
|
||||
fsize->stepwise.max_height = inst->capabilities[FRAME_HEIGHT].max;
|
||||
fsize->stepwise.step_height =
|
||||
capability->cap[FRAME_HEIGHT].step_or_mask;
|
||||
inst->capabilities[FRAME_HEIGHT].step_or_mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -751,7 +745,6 @@ int msm_vidc_enum_frameintervals(void *instance, struct v4l2_frmivalenum *fival)
|
||||
{
|
||||
struct msm_vidc_inst *inst = instance;
|
||||
struct msm_vidc_core *core;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
enum msm_vidc_colorformat_type colorfmt;
|
||||
u32 fps, mbpf;
|
||||
u32 meta_fmt;
|
||||
@@ -769,11 +762,6 @@ int msm_vidc_enum_frameintervals(void *instance, struct v4l2_frmivalenum *fival)
|
||||
|
||||
core = inst->core;
|
||||
|
||||
if (!inst->capabilities || !core->capabilities) {
|
||||
i_vpr_e(inst, "%s: capabilities not available\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
/* only index 0 allowed as per v4l2 spec */
|
||||
if (fival->index)
|
||||
@@ -791,10 +779,10 @@ int msm_vidc_enum_frameintervals(void *instance, struct v4l2_frmivalenum *fival)
|
||||
}
|
||||
|
||||
/* validate resolution */
|
||||
if (fival->width > capability->cap[FRAME_WIDTH].max ||
|
||||
fival->width < capability->cap[FRAME_WIDTH].min ||
|
||||
fival->height > capability->cap[FRAME_HEIGHT].max ||
|
||||
fival->height < capability->cap[FRAME_HEIGHT].min) {
|
||||
if (fival->width > inst->capabilities[FRAME_WIDTH].max ||
|
||||
fival->width < inst->capabilities[FRAME_WIDTH].min ||
|
||||
fival->height > inst->capabilities[FRAME_HEIGHT].max ||
|
||||
fival->height < inst->capabilities[FRAME_HEIGHT].min) {
|
||||
i_vpr_e(inst, "%s: unsupported resolution %u x %u\n", __func__,
|
||||
fival->width, fival->height);
|
||||
return -EINVAL;
|
||||
@@ -807,11 +795,11 @@ int msm_vidc_enum_frameintervals(void *instance, struct v4l2_frmivalenum *fival)
|
||||
fival->type = V4L2_FRMIVAL_TYPE_STEPWISE;
|
||||
fival->stepwise.min.numerator = 1;
|
||||
fival->stepwise.min.denominator =
|
||||
min_t(u32, fps, capability->cap[FRAME_RATE].max);
|
||||
min_t(u32, fps, inst->capabilities[FRAME_RATE].max);
|
||||
fival->stepwise.max.numerator = 1;
|
||||
fival->stepwise.max.denominator = 1;
|
||||
fival->stepwise.step.numerator = 1;
|
||||
fival->stepwise.step.denominator = capability->cap[FRAME_RATE].max;
|
||||
fival->stepwise.step.denominator = inst->capabilities[FRAME_RATE].max;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -907,11 +895,6 @@ void *msm_vidc_open(void *vidc_core, u32 session_type)
|
||||
if (rc)
|
||||
return NULL;
|
||||
|
||||
rc = msm_vidc_vmem_alloc(sizeof(struct msm_vidc_inst_capability),
|
||||
(void **)&inst->capabilities, "inst capability");
|
||||
if (rc)
|
||||
goto fail_alloc_inst_caps;
|
||||
|
||||
inst->core = core;
|
||||
inst->domain = session_type;
|
||||
inst->session_id = hash32_ptr(inst);
|
||||
@@ -1050,8 +1033,6 @@ fail_add_session:
|
||||
mutex_destroy(&inst->client_lock);
|
||||
mutex_destroy(&inst->request_lock);
|
||||
mutex_destroy(&inst->lock);
|
||||
msm_vidc_vmem_free((void **)&inst->capabilities);
|
||||
fail_alloc_inst_caps:
|
||||
msm_vidc_vmem_free((void **)&inst);
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ u32 msm_vidc_input_min_count(struct msm_vidc_inst* inst)
|
||||
u32 input_min_count = 0;
|
||||
u32 hb_enh_layer = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -29,9 +29,9 @@ u32 msm_vidc_input_min_count(struct msm_vidc_inst* inst)
|
||||
input_min_count = MIN_ENC_INPUT_BUFFERS;
|
||||
if (is_hierb_type_requested(inst)) {
|
||||
hb_enh_layer =
|
||||
inst->capabilities->cap[ENH_LAYER_COUNT].value;
|
||||
inst->capabilities[ENH_LAYER_COUNT].value;
|
||||
if (inst->codec == MSM_VIDC_H264 &&
|
||||
!inst->capabilities->cap[LAYER_ENABLE].value) {
|
||||
!inst->capabilities[LAYER_ENABLE].value) {
|
||||
hb_enh_layer = 0;
|
||||
}
|
||||
if (hb_enh_layer)
|
||||
@@ -215,13 +215,13 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
|
||||
u32 bitstream_size_overwrite = 0;
|
||||
enum msm_vidc_codec_type codec;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bitstream_size_overwrite =
|
||||
inst->capabilities->cap[BITSTREAM_SIZE_OVERWRITE].value;
|
||||
inst->capabilities[BITSTREAM_SIZE_OVERWRITE].value;
|
||||
if (bitstream_size_overwrite) {
|
||||
frame_size = bitstream_size_overwrite;
|
||||
i_vpr_h(inst, "client configured bitstream buffer size %d\n",
|
||||
@@ -241,7 +241,7 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
|
||||
num_mbs = msm_vidc_get_mbs_per_frame(inst);
|
||||
if (num_mbs > NUM_MBS_4k) {
|
||||
div_factor = 4;
|
||||
base_res_mbs = inst->capabilities->cap[MBPF].value;
|
||||
base_res_mbs = inst->capabilities[MBPF].value;
|
||||
} else {
|
||||
base_res_mbs = NUM_MBS_4k;
|
||||
if (codec == MSM_VIDC_VP9)
|
||||
@@ -294,7 +294,7 @@ u32 msm_vidc_decoder_output_meta_size(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 size = MSM_VIDC_METADATA_SIZE;
|
||||
|
||||
if (inst->capabilities->cap[META_DOLBY_RPU].value)
|
||||
if (inst->capabilities[META_DOLBY_RPU].value)
|
||||
size += MSM_VIDC_METADATA_DOLBY_RPU_SIZE;
|
||||
|
||||
return ALIGN(size, SZ_4K);
|
||||
@@ -329,7 +329,7 @@ u32 msm_vidc_enc_delivery_mode_based_output_buf_size(struct msm_vidc_inst *inst,
|
||||
u32 total_mb_count;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return frame_size;
|
||||
}
|
||||
@@ -340,7 +340,7 @@ u32 msm_vidc_enc_delivery_mode_based_output_buf_size(struct msm_vidc_inst *inst,
|
||||
f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_H264)
|
||||
return frame_size;
|
||||
|
||||
if (inst->capabilities->cap[SLICE_MODE].value != V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB)
|
||||
if (inst->capabilities[SLICE_MODE].value != V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB)
|
||||
return frame_size;
|
||||
|
||||
if (!is_enc_slice_delivery_mode(inst))
|
||||
@@ -353,7 +353,7 @@ u32 msm_vidc_enc_delivery_mode_based_output_buf_size(struct msm_vidc_inst *inst,
|
||||
height_in_lcus = (height + lcu_size - 1) / lcu_size;
|
||||
total_mb_count = width_in_lcus * height_in_lcus;
|
||||
|
||||
slice_size = ((frame_size * inst->capabilities->cap[SLICE_MAX_MB].value) \
|
||||
slice_size = ((frame_size * inst->capabilities[SLICE_MAX_MB].value)
|
||||
+ total_mb_count - 1) / total_mb_count;
|
||||
|
||||
slice_size = ALIGN(slice_size, SZ_4K);
|
||||
@@ -368,7 +368,7 @@ u32 msm_vidc_encoder_output_size(struct msm_vidc_inst *inst)
|
||||
struct v4l2_format *f;
|
||||
enum msm_vidc_codec_type codec;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -391,7 +391,7 @@ u32 msm_vidc_encoder_output_size(struct msm_vidc_inst *inst)
|
||||
|
||||
/* Image session: 2 x yuv size */
|
||||
if (is_image_session(inst) ||
|
||||
inst->capabilities->cap[BITRATE_MODE].value == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ)
|
||||
inst->capabilities[BITRATE_MODE].value == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ)
|
||||
goto skip_calc;
|
||||
|
||||
if (mbs_per_frame <= NUM_MBS_360P)
|
||||
@@ -442,14 +442,14 @@ u32 msm_vidc_encoder_input_meta_size(struct msm_vidc_inst *inst)
|
||||
struct v4l2_format *f;
|
||||
u32 width, height;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
size = MSM_VIDC_METADATA_SIZE;
|
||||
|
||||
if (inst->capabilities->cap[META_ROI_INFO].value) {
|
||||
if (inst->capabilities[META_ROI_INFO].value) {
|
||||
lcu_size = 16;
|
||||
|
||||
f = &inst->fmts[OUTPUT_PORT];
|
||||
@@ -467,7 +467,7 @@ u32 msm_vidc_encoder_input_meta_size(struct msm_vidc_inst *inst)
|
||||
size = ALIGN(size, SZ_4K);
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[META_DOLBY_RPU].value) {
|
||||
if (inst->capabilities[META_DOLBY_RPU].value) {
|
||||
size += MSM_VIDC_METADATA_DOLBY_RPU_SIZE;
|
||||
size = ALIGN(size, SZ_4K);
|
||||
}
|
||||
|
@@ -155,12 +155,12 @@ bool is_valid_cap_id(enum msm_vidc_inst_capability_type cap_id)
|
||||
bool is_valid_cap(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_inst_capability_type cap_id)
|
||||
{
|
||||
if (!inst || !inst->capabilities)
|
||||
if (!inst)
|
||||
return false;
|
||||
if (cap_id <= INST_CAP_NONE || cap_id >= INST_CAP_MAX)
|
||||
return false;
|
||||
|
||||
return !!inst->capabilities->cap[cap_id].cap_id;
|
||||
return !!inst->capabilities[cap_id].cap_id;
|
||||
}
|
||||
|
||||
static inline bool is_all_childrens_visited(
|
||||
@@ -244,7 +244,7 @@ static int msm_vidc_add_children(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
int i, rc = 0;
|
||||
|
||||
cap = &inst->capabilities->cap[cap_id];
|
||||
cap = &inst->capabilities[cap_id];
|
||||
|
||||
for (i = 0; i < MAX_CAP_CHILDREN; i++) {
|
||||
if (!cap->children[i])
|
||||
@@ -273,7 +273,7 @@ static int msm_vidc_adjust_cap(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
|
||||
/* validate cap */
|
||||
cap = &inst->capabilities->cap[cap_id];
|
||||
cap = &inst->capabilities[cap_id];
|
||||
if (!is_valid_cap(inst, cap->cap_id))
|
||||
return 0;
|
||||
|
||||
@@ -306,7 +306,7 @@ static int msm_vidc_set_cap(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
|
||||
/* validate cap */
|
||||
cap = &inst->capabilities->cap[cap_id];
|
||||
cap = &inst->capabilities[cap_id];
|
||||
if (!is_valid_cap(inst, cap->cap_id))
|
||||
return 0;
|
||||
|
||||
@@ -328,15 +328,15 @@ static int msm_vidc_adjust_dynamic_property(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_inst_capability_type cap_id, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_cap_entry *entry = NULL, *temp = NULL;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
s32 prev_value;
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->capabilities || !ctrl) {
|
||||
if (!inst || !ctrl) {
|
||||
d_vpr_e("%s: invalid param\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
/* sanitize cap_id */
|
||||
if (!is_valid_cap_id(cap_id)) {
|
||||
@@ -344,7 +344,7 @@ static int msm_vidc_adjust_dynamic_property(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(capability->cap[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
if (!(cap[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
i_vpr_h(inst,
|
||||
"%s: dynamic setting of cap[%d] %s is not allowed\n",
|
||||
__func__, cap_id, cap_name(cap_id));
|
||||
@@ -352,12 +352,12 @@ static int msm_vidc_adjust_dynamic_property(struct msm_vidc_inst *inst,
|
||||
}
|
||||
i_vpr_h(inst, "%s: cap[%d] %s\n", __func__, cap_id, cap_name(cap_id));
|
||||
|
||||
prev_value = capability->cap[cap_id].value;
|
||||
prev_value = cap[cap_id].value;
|
||||
rc = msm_vidc_adjust_cap(inst, cap_id, ctrl, __func__);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if (capability->cap[cap_id].value == prev_value && cap_id == GOP_SIZE) {
|
||||
if (cap[cap_id].value == prev_value && cap_id == GOP_SIZE) {
|
||||
/*
|
||||
* Ignore setting same GOP size value to firmware to avoid
|
||||
* unnecessary generation of IDR frame.
|
||||
@@ -371,7 +371,7 @@ static int msm_vidc_adjust_dynamic_property(struct msm_vidc_inst *inst,
|
||||
goto error;
|
||||
|
||||
/* add children only if cap value modified */
|
||||
if (capability->cap[cap_id].value == prev_value)
|
||||
if (cap[cap_id].value == prev_value)
|
||||
return 0;
|
||||
|
||||
rc = msm_vidc_add_children(inst, cap_id);
|
||||
@@ -384,20 +384,20 @@ static int msm_vidc_adjust_dynamic_property(struct msm_vidc_inst *inst,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!capability->cap[entry->cap_id].adjust) {
|
||||
if (!cap[entry->cap_id].adjust) {
|
||||
i_vpr_e(inst, "%s: child cap must have ajdust function %s\n",
|
||||
__func__, cap_name(entry->cap_id));
|
||||
rc = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
prev_value = capability->cap[entry->cap_id].value;
|
||||
prev_value = cap[entry->cap_id].value;
|
||||
rc = msm_vidc_adjust_cap(inst, entry->cap_id, NULL, __func__);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
/* add children if cap value modified */
|
||||
if (capability->cap[entry->cap_id].value != prev_value) {
|
||||
if (cap[entry->cap_id].value != prev_value) {
|
||||
/* add cap_id to firmware list always */
|
||||
rc = msm_vidc_add_capid_to_fw_list(inst, entry->cap_id);
|
||||
if (rc)
|
||||
@@ -484,18 +484,18 @@ int msm_vidc_ctrl_deinit(struct msm_vidc_inst *inst)
|
||||
int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
struct msm_vidc_core *core;
|
||||
int idx = 0;
|
||||
struct v4l2_ctrl_config ctrl_cfg = {0};
|
||||
int num_ctrls = 0, ctrl_idx = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
if (!core->v4l2_ctrl_ops) {
|
||||
i_vpr_e(inst, "%s: no control ops\n", __func__);
|
||||
@@ -503,7 +503,7 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
for (idx = 0; idx < INST_CAP_MAX; idx++) {
|
||||
if (capability->cap[idx].v4l2_id)
|
||||
if (cap[idx].v4l2_id)
|
||||
num_ctrls++;
|
||||
}
|
||||
if (!num_ctrls) {
|
||||
@@ -526,13 +526,13 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
|
||||
for (idx = 0; idx < INST_CAP_MAX; idx++) {
|
||||
struct v4l2_ctrl *ctrl;
|
||||
|
||||
if (!capability->cap[idx].v4l2_id)
|
||||
if (!cap[idx].v4l2_id)
|
||||
continue;
|
||||
|
||||
if (ctrl_idx >= num_ctrls) {
|
||||
i_vpr_e(inst,
|
||||
"%s: invalid ctrl %#x, max allowed %d\n",
|
||||
__func__, capability->cap[idx].v4l2_id,
|
||||
__func__, cap[idx].v4l2_id,
|
||||
num_ctrls);
|
||||
rc = -EINVAL;
|
||||
goto error;
|
||||
@@ -540,27 +540,27 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
|
||||
i_vpr_l(inst,
|
||||
"%s: cap[%d] %24s, value %d min %d max %d step_or_mask %#x flags %#x v4l2_id %#x hfi_id %#x\n",
|
||||
__func__, idx, cap_name(idx),
|
||||
capability->cap[idx].value,
|
||||
capability->cap[idx].min,
|
||||
capability->cap[idx].max,
|
||||
capability->cap[idx].step_or_mask,
|
||||
capability->cap[idx].flags,
|
||||
capability->cap[idx].v4l2_id,
|
||||
capability->cap[idx].hfi_id);
|
||||
cap[idx].value,
|
||||
cap[idx].min,
|
||||
cap[idx].max,
|
||||
cap[idx].step_or_mask,
|
||||
cap[idx].flags,
|
||||
cap[idx].v4l2_id,
|
||||
cap[idx].hfi_id);
|
||||
|
||||
memset(&ctrl_cfg, 0, sizeof(struct v4l2_ctrl_config));
|
||||
|
||||
if (is_priv_ctrl(capability->cap[idx].v4l2_id)) {
|
||||
if (is_priv_ctrl(cap[idx].v4l2_id)) {
|
||||
/* add private control */
|
||||
ctrl_cfg.def = capability->cap[idx].value;
|
||||
ctrl_cfg.def = cap[idx].value;
|
||||
ctrl_cfg.flags = 0;
|
||||
ctrl_cfg.id = capability->cap[idx].v4l2_id;
|
||||
ctrl_cfg.max = capability->cap[idx].max;
|
||||
ctrl_cfg.min = capability->cap[idx].min;
|
||||
ctrl_cfg.id = cap[idx].v4l2_id;
|
||||
ctrl_cfg.max = cap[idx].max;
|
||||
ctrl_cfg.min = cap[idx].min;
|
||||
ctrl_cfg.ops = core->v4l2_ctrl_ops;
|
||||
if (capability->cap[idx].flags & CAP_FLAG_MENU)
|
||||
if (cap[idx].flags & CAP_FLAG_MENU)
|
||||
ctrl_cfg.type = V4L2_CTRL_TYPE_MENU;
|
||||
else if (capability->cap[idx].flags & CAP_FLAG_BITMASK)
|
||||
else if (cap[idx].flags & CAP_FLAG_BITMASK)
|
||||
ctrl_cfg.type = V4L2_CTRL_TYPE_BITMASK;
|
||||
else
|
||||
ctrl_cfg.type = V4L2_CTRL_TYPE_INTEGER;
|
||||
@@ -576,14 +576,14 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
|
||||
}
|
||||
if (ctrl_cfg.type == V4L2_CTRL_TYPE_MENU) {
|
||||
ctrl_cfg.menu_skip_mask =
|
||||
~(capability->cap[idx].step_or_mask);
|
||||
~(cap[idx].step_or_mask);
|
||||
ctrl_cfg.qmenu = msm_vidc_get_qmenu_type(inst,
|
||||
capability->cap[idx].cap_id);
|
||||
cap[idx].cap_id);
|
||||
} else {
|
||||
ctrl_cfg.step =
|
||||
capability->cap[idx].step_or_mask;
|
||||
cap[idx].step_or_mask;
|
||||
}
|
||||
ctrl_cfg.name = cap_name(capability->cap[idx].cap_id);
|
||||
ctrl_cfg.name = cap_name(cap[idx].cap_id);
|
||||
if (!ctrl_cfg.name) {
|
||||
i_vpr_e(inst, "%s: %#x ctrl name is null\n",
|
||||
__func__, ctrl_cfg.id);
|
||||
@@ -593,27 +593,27 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
|
||||
ctrl = v4l2_ctrl_new_custom(&inst->ctrl_handler,
|
||||
&ctrl_cfg, NULL);
|
||||
} else {
|
||||
if (capability->cap[idx].flags & CAP_FLAG_MENU) {
|
||||
if (cap[idx].flags & CAP_FLAG_MENU) {
|
||||
ctrl = v4l2_ctrl_new_std_menu(
|
||||
&inst->ctrl_handler,
|
||||
core->v4l2_ctrl_ops,
|
||||
capability->cap[idx].v4l2_id,
|
||||
capability->cap[idx].max,
|
||||
~(capability->cap[idx].step_or_mask),
|
||||
capability->cap[idx].value);
|
||||
cap[idx].v4l2_id,
|
||||
cap[idx].max,
|
||||
~(cap[idx].step_or_mask),
|
||||
cap[idx].value);
|
||||
} else {
|
||||
ctrl = v4l2_ctrl_new_std(&inst->ctrl_handler,
|
||||
core->v4l2_ctrl_ops,
|
||||
capability->cap[idx].v4l2_id,
|
||||
capability->cap[idx].min,
|
||||
capability->cap[idx].max,
|
||||
capability->cap[idx].step_or_mask,
|
||||
capability->cap[idx].value);
|
||||
cap[idx].v4l2_id,
|
||||
cap[idx].min,
|
||||
cap[idx].max,
|
||||
cap[idx].step_or_mask,
|
||||
cap[idx].value);
|
||||
}
|
||||
}
|
||||
if (!ctrl) {
|
||||
i_vpr_e(inst, "%s: invalid ctrl %#x cap %24s\n", __func__,
|
||||
capability->cap[idx].v4l2_id, cap_name(idx));
|
||||
cap[idx].v4l2_id, cap_name(idx));
|
||||
rc = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
@@ -622,12 +622,12 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
|
||||
if (rc) {
|
||||
i_vpr_e(inst,
|
||||
"error adding ctrl (%#x) to ctrl handle, %d\n",
|
||||
capability->cap[idx].v4l2_id,
|
||||
cap[idx].v4l2_id,
|
||||
inst->ctrl_handler.error);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (capability->cap[idx].flags & CAP_FLAG_VOLATILE)
|
||||
if (cap[idx].flags & CAP_FLAG_VOLATILE)
|
||||
ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
|
||||
|
||||
ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE;
|
||||
@@ -706,11 +706,9 @@ static int msm_vidc_allow_secure_session(struct msm_vidc_inst *inst)
|
||||
|
||||
core_lock(core, __func__);
|
||||
list_for_each_entry(i, &core->instances, list) {
|
||||
if (i->capabilities) {
|
||||
if (i->capabilities->cap[SECURE_MODE].value)
|
||||
if (i->capabilities[SECURE_MODE].value)
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count > core->capabilities[MAX_SECURE_SESSION_COUNT].value) {
|
||||
i_vpr_e(inst,
|
||||
@@ -856,15 +854,15 @@ static int msm_vidc_update_static_property(struct msm_vidc_inst *inst,
|
||||
int msm_vidc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
enum msm_vidc_inst_capability_type cap_id;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
int rc = 0;
|
||||
u32 port;
|
||||
|
||||
if (!inst || !inst->capabilities || !ctrl) {
|
||||
if (!inst || !ctrl) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
i_vpr_h(inst, FMT_STRING_SET_CTRL,
|
||||
__func__, state_name(inst->state), ctrl->name, ctrl->id, ctrl->val);
|
||||
@@ -876,7 +874,7 @@ int msm_vidc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
||||
}
|
||||
|
||||
/* mark client set flag */
|
||||
capability->cap[cap_id].flags |= CAP_FLAG_CLIENT_SET;
|
||||
cap[cap_id].flags |= CAP_FLAG_CLIENT_SET;
|
||||
|
||||
port = is_encode_session(inst) ? OUTPUT_PORT : INPUT_PORT;
|
||||
if (!inst->bufq[port].vb2q->streaming) {
|
||||
@@ -931,19 +929,18 @@ unlock:
|
||||
int msm_vidc_prepare_dependency_list(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct list_head leaf_list, opt_list;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap, *lcap;
|
||||
struct msm_vidc_inst_cap *cap, *lcap, *temp_cap;
|
||||
struct msm_vidc_inst_cap_entry *entry = NULL, *temp = NULL;
|
||||
bool leaf_visited[INST_CAP_MAX];
|
||||
bool opt_visited[INST_CAP_MAX];
|
||||
int tmp_count_total, tmp_count, num_nodes = 0;
|
||||
int i, rc = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
if (!list_empty(&inst->caps_list)) {
|
||||
i_vpr_h(inst, "%s: dependency list already prepared\n", __func__);
|
||||
@@ -958,7 +955,7 @@ int msm_vidc_prepare_dependency_list(struct msm_vidc_inst *inst)
|
||||
|
||||
/* populate leaf nodes first */
|
||||
for (i = 1; i < INST_CAP_MAX; i++) {
|
||||
lcap = &capability->cap[i];
|
||||
lcap = &cap[i];
|
||||
if (!is_valid_cap(inst, lcap->cap_id))
|
||||
continue;
|
||||
|
||||
@@ -996,13 +993,13 @@ int msm_vidc_prepare_dependency_list(struct msm_vidc_inst *inst)
|
||||
list_del_init(&entry->list);
|
||||
opt_visited[entry->cap_id] = false;
|
||||
tmp_count--;
|
||||
cap = &capability->cap[entry->cap_id];
|
||||
temp_cap = &cap[entry->cap_id];
|
||||
|
||||
/**
|
||||
* if all child are visited then add this entry to
|
||||
* leaf list else add it to the end of optional list.
|
||||
*/
|
||||
if (is_all_childrens_visited(cap, leaf_visited)) {
|
||||
if (is_all_childrens_visited(temp_cap, leaf_visited)) {
|
||||
list_add(&entry->list, &leaf_list);
|
||||
leaf_visited[entry->cap_id] = true;
|
||||
tmp_count_total--;
|
||||
@@ -1054,7 +1051,7 @@ int msm_vidc_adjust_v4l2_properties(struct msm_vidc_inst *inst)
|
||||
struct msm_vidc_inst_cap_entry *entry = NULL, *temp = NULL;
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1078,7 +1075,7 @@ int msm_vidc_set_v4l2_properties(struct msm_vidc_inst *inst)
|
||||
struct msm_vidc_inst_cap_entry *entry = NULL, *temp = NULL;
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@@ -503,8 +503,7 @@ static ssize_t inst_info_read(struct file *file, char __user *buf,
|
||||
ssize_t len = 0;
|
||||
struct v4l2_format *f;
|
||||
|
||||
if (!idata || !idata->core || !idata->inst ||
|
||||
!idata->inst->capabilities) {
|
||||
if (!idata || !idata->core || !idata->inst) {
|
||||
d_vpr_e("%s: invalid params %pK\n", __func__, idata);
|
||||
return 0;
|
||||
}
|
||||
@@ -534,7 +533,7 @@ static ssize_t inst_info_read(struct file *file, char __user *buf,
|
||||
cur += write_str(cur, end - cur, "height: %d\n", f->fmt.pix_mp.height);
|
||||
cur += write_str(cur, end - cur, "width: %d\n", f->fmt.pix_mp.width);
|
||||
cur += write_str(cur, end - cur, "fps: %d\n",
|
||||
inst->capabilities->cap[FRAME_RATE].value >> 16);
|
||||
inst->capabilities[FRAME_RATE].value >> 16);
|
||||
cur += write_str(cur, end - cur, "state: %d\n", inst->state);
|
||||
cur += write_str(cur, end - cur, "secure: %d\n",
|
||||
is_secure_session(inst));
|
||||
|
@@ -952,7 +952,7 @@ bool msm_vidc_allow_metadata_subscription(struct msm_vidc_inst *inst, u32 cap_id
|
||||
{
|
||||
bool is_allowed = true;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -973,7 +973,7 @@ bool msm_vidc_allow_metadata_subscription(struct msm_vidc_inst *inst, u32 cap_id
|
||||
}
|
||||
break;
|
||||
case META_DPB_TAG_LIST:
|
||||
if (!is_ubwc_colorformat(inst->capabilities->cap[PIX_FMTS].value)) {
|
||||
if (!is_ubwc_colorformat(inst->capabilities[PIX_FMTS].value)) {
|
||||
i_vpr_h(inst,
|
||||
"%s: cap: %24s not allowed for split mode\n",
|
||||
__func__, cap_name(cap_id));
|
||||
@@ -998,7 +998,7 @@ bool msm_vidc_allow_property(struct msm_vidc_inst *inst, u32 hfi_id)
|
||||
{
|
||||
bool is_allowed = true;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return false;
|
||||
}
|
||||
@@ -1010,7 +1010,7 @@ bool msm_vidc_allow_property(struct msm_vidc_inst *inst, u32 hfi_id)
|
||||
is_allowed = true;
|
||||
break;
|
||||
case HFI_PROP_DPB_LIST:
|
||||
if (!is_ubwc_colorformat(inst->capabilities->cap[PIX_FMTS].value)) {
|
||||
if (!is_ubwc_colorformat(inst->capabilities[PIX_FMTS].value)) {
|
||||
i_vpr_h(inst,
|
||||
"%s: cap: %24s not allowed for split mode\n",
|
||||
__func__, cap_name(DPB_LIST));
|
||||
@@ -1038,7 +1038,7 @@ int msm_vidc_update_property_cap(struct msm_vidc_inst *inst, u32 hfi_id,
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1518,7 +1518,7 @@ int msm_vidc_process_drain_last_flag(struct msm_vidc_inst *inst)
|
||||
int rc = 0;
|
||||
struct v4l2_event event = {0};
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ int msm_vidc_process_drain_last_flag(struct msm_vidc_inst *inst)
|
||||
return rc;
|
||||
|
||||
if (is_decode_session(inst) &&
|
||||
!inst->capabilities->cap[LAST_FLAG_EVENT_ENABLE].value) {
|
||||
!inst->capabilities[LAST_FLAG_EVENT_ENABLE].value) {
|
||||
i_vpr_h(inst, "%s: last flag event not enabled\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -1544,7 +1544,7 @@ int msm_vidc_process_psc_last_flag(struct msm_vidc_inst *inst)
|
||||
int rc = 0;
|
||||
struct v4l2_event event = {0};
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1554,7 +1554,7 @@ int msm_vidc_process_psc_last_flag(struct msm_vidc_inst *inst)
|
||||
return rc;
|
||||
|
||||
if (is_decode_session(inst) &&
|
||||
!inst->capabilities->cap[LAST_FLAG_EVENT_ENABLE].value) {
|
||||
!inst->capabilities[LAST_FLAG_EVENT_ENABLE].value) {
|
||||
i_vpr_h(inst, "%s: last flag event not enabled\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -1638,7 +1638,7 @@ int msm_vidc_get_fence_fd(struct msm_vidc_inst *inst, int *fence_fd)
|
||||
|
||||
*fence_fd = INVALID_FD;
|
||||
|
||||
if (!inst || !inst->capabilities || !inst->core) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1646,7 +1646,7 @@ int msm_vidc_get_fence_fd(struct msm_vidc_inst *inst, int *fence_fd)
|
||||
|
||||
list_for_each_entry_safe(fence, dummy_fence, &inst->fence_list, list) {
|
||||
if (fence->fence_id ==
|
||||
(u64)inst->capabilities->cap[FENCE_ID].value) {
|
||||
(u64)inst->capabilities[FENCE_ID].value) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -1654,7 +1654,7 @@ int msm_vidc_get_fence_fd(struct msm_vidc_inst *inst, int *fence_fd)
|
||||
|
||||
if (!found) {
|
||||
i_vpr_h(inst, "%s: could not find matching fence for fence id: %d\n",
|
||||
__func__, inst->capabilities->cap[FENCE_ID].value);
|
||||
__func__, inst->capabilities[FENCE_ID].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -1699,7 +1699,7 @@ int msm_vidc_get_control(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
|
||||
i_vpr_h(inst, "g_min: input buffers %d\n", ctrl->val);
|
||||
break;
|
||||
case FILM_GRAIN:
|
||||
ctrl->val = inst->capabilities->cap[FILM_GRAIN].value;
|
||||
ctrl->val = inst->capabilities[FILM_GRAIN].value;
|
||||
i_vpr_h(inst, "%s: film grain present: %d\n",
|
||||
__func__, ctrl->val);
|
||||
break;
|
||||
@@ -1740,7 +1740,7 @@ int msm_vidc_get_fps(struct msm_vidc_inst *inst)
|
||||
int fps;
|
||||
u32 frame_rate, operating_rate;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1887,7 +1887,7 @@ int msm_vidc_set_auto_framerate(struct msm_vidc_inst *inst, u64 timestamp)
|
||||
u64 time_us = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1895,7 +1895,7 @@ int msm_vidc_set_auto_framerate(struct msm_vidc_inst *inst, u64 timestamp)
|
||||
core = inst->core;
|
||||
if (!core->capabilities[ENC_AUTO_FRAMERATE].value ||
|
||||
is_image_session(inst) || msm_vidc_is_super_buffer(inst) ||
|
||||
!inst->capabilities->cap[TIME_DELTA_BASED_RC].value)
|
||||
!inst->capabilities[TIME_DELTA_BASED_RC].value)
|
||||
goto exit;
|
||||
|
||||
rc = msm_vidc_update_timestamp_rate(inst, timestamp);
|
||||
@@ -1908,8 +1908,8 @@ int msm_vidc_set_auto_framerate(struct msm_vidc_inst *inst, u64 timestamp)
|
||||
prev_fr = curr_fr;
|
||||
curr_fr = time_us ? DIV64_U64_ROUND_CLOSEST(USEC_PER_SEC, time_us) << 16 :
|
||||
inst->auto_framerate;
|
||||
if (curr_fr > inst->capabilities->cap[FRAME_RATE].max)
|
||||
curr_fr = inst->capabilities->cap[FRAME_RATE].max;
|
||||
if (curr_fr > inst->capabilities[FRAME_RATE].max)
|
||||
curr_fr = inst->capabilities[FRAME_RATE].max;
|
||||
}
|
||||
prev = ts;
|
||||
counter++;
|
||||
@@ -1948,7 +1948,7 @@ int msm_vidc_update_input_rate(struct msm_vidc_inst *inst, u64 time_us)
|
||||
u64 counter = 0;
|
||||
u64 input_timer_sum_us = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1970,7 +1970,7 @@ int msm_vidc_update_input_rate(struct msm_vidc_inst *inst, u64 time_us)
|
||||
}
|
||||
|
||||
if (input_timer_sum_us && counter >= INPUT_TIMER_LIST_SIZE)
|
||||
inst->capabilities->cap[INPUT_RATE].value =
|
||||
inst->capabilities[INPUT_RATE].value =
|
||||
(s32)(DIV64_U64_ROUND_CLOSEST(counter * 1000000,
|
||||
input_timer_sum_us) << 16);
|
||||
|
||||
@@ -2006,42 +2006,42 @@ int msm_vidc_flush_input_timer(struct msm_vidc_inst *inst)
|
||||
|
||||
int msm_vidc_get_input_rate(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return inst->capabilities->cap[INPUT_RATE].value >> 16;
|
||||
return inst->capabilities[INPUT_RATE].value >> 16;
|
||||
}
|
||||
|
||||
int msm_vidc_get_timestamp_rate(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return inst->capabilities->cap[TIMESTAMP_RATE].value >> 16;
|
||||
return inst->capabilities[TIMESTAMP_RATE].value >> 16;
|
||||
}
|
||||
|
||||
int msm_vidc_get_frame_rate(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
return inst->capabilities[FRAME_RATE].value >> 16;
|
||||
}
|
||||
|
||||
int msm_vidc_get_operating_rate(struct msm_vidc_inst *inst)
|
||||
{
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return inst->capabilities->cap[OPERATING_RATE].value >> 16;
|
||||
return inst->capabilities[OPERATING_RATE].value >> 16;
|
||||
}
|
||||
|
||||
static int msm_vidc_insert_sort(struct list_head *head,
|
||||
@@ -2108,7 +2108,7 @@ int msm_vidc_flush_ts(struct msm_vidc_inst *inst)
|
||||
struct msm_vidc_timestamp *temp, *ts = NULL;
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->core ) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2477,16 +2477,12 @@ struct msm_vidc_buffer *get_meta_buffer(struct msm_vidc_inst *inst,
|
||||
|
||||
bool msm_vidc_is_super_buffer(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability = NULL;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
capability = inst->capabilities;
|
||||
|
||||
return !!capability->cap[SUPER_FRAME].value;
|
||||
return !!inst->capabilities[SUPER_FRAME].value;
|
||||
}
|
||||
|
||||
static bool is_single_session(struct msm_vidc_inst *inst)
|
||||
@@ -2514,7 +2510,7 @@ void msm_vidc_allow_dcvs(struct msm_vidc_inst *inst)
|
||||
struct msm_vidc_core *core;
|
||||
u32 fps;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: Invalid args: %pK\n", __func__, inst);
|
||||
return;
|
||||
}
|
||||
@@ -2570,7 +2566,7 @@ void msm_vidc_allow_dcvs(struct msm_vidc_inst *inst)
|
||||
|
||||
fps = msm_vidc_get_fps(inst);
|
||||
if (is_decode_session(inst) &&
|
||||
fps >= inst->capabilities->cap[FRAME_RATE].max) {
|
||||
fps >= inst->capabilities[FRAME_RATE].max) {
|
||||
allow = false;
|
||||
i_vpr_h(inst, "%s: unsupported fps %d\n", __func__, fps);
|
||||
goto exit;
|
||||
@@ -2585,17 +2581,17 @@ exit:
|
||||
|
||||
bool msm_vidc_allow_decode_batch(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
struct msm_vidc_core *core;
|
||||
bool allow = false;
|
||||
u32 value = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return false;
|
||||
}
|
||||
core = inst->core;
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
allow = inst->decode_batch.enable;
|
||||
if (!allow) {
|
||||
@@ -2646,18 +2642,18 @@ bool msm_vidc_allow_decode_batch(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
value = msm_vidc_get_fps(inst);
|
||||
allow = value < capability->cap[BATCH_FPS].value;
|
||||
allow = value < cap[BATCH_FPS].value;
|
||||
if (!allow) {
|
||||
i_vpr_h(inst, "%s: unsupported fps %u, max %u\n", __func__,
|
||||
value, capability->cap[BATCH_FPS].value);
|
||||
value, cap[BATCH_FPS].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
value = msm_vidc_get_mbs_per_frame(inst);
|
||||
allow = value < capability->cap[BATCH_MBPF].value;
|
||||
allow = value < cap[BATCH_MBPF].value;
|
||||
if (!allow) {
|
||||
i_vpr_h(inst, "%s: unsupported mbpf %u, max %u\n", __func__,
|
||||
value, capability->cap[BATCH_MBPF].value);
|
||||
value, cap[BATCH_MBPF].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -2693,7 +2689,7 @@ static void msm_vidc_update_input_cr(struct msm_vidc_inst *inst, u32 idx, u32 cr
|
||||
void msm_vidc_update_stats(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *buf, enum msm_vidc_debugfs_event etype)
|
||||
{
|
||||
if (!inst || !buf || !inst->capabilities) {
|
||||
if (!inst || !buf) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return;
|
||||
}
|
||||
@@ -2710,7 +2706,7 @@ void msm_vidc_print_stats(struct msm_vidc_inst *inst)
|
||||
u32 frame_rate, operating_rate, achieved_fps, priority, etb, ebd, ftb, fbd, dt_ms;
|
||||
u64 bitrate_kbps = 0, time_ms = ktime_get_ns() / 1000 / 1000;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return;
|
||||
}
|
||||
@@ -2719,9 +2715,9 @@ void msm_vidc_print_stats(struct msm_vidc_inst *inst)
|
||||
ebd = inst->debug_count.ebd - inst->stats.count.ebd;
|
||||
ftb = inst->debug_count.ftb - inst->stats.count.ftb;
|
||||
fbd = inst->debug_count.fbd - inst->stats.count.fbd;
|
||||
frame_rate = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
operating_rate = inst->capabilities->cap[OPERATING_RATE].value >> 16;
|
||||
priority = inst->capabilities->cap[PRIORITY].value;
|
||||
frame_rate = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
operating_rate = inst->capabilities[OPERATING_RATE].value >> 16;
|
||||
priority = inst->capabilities[PRIORITY].value;
|
||||
|
||||
dt_ms = time_ms - inst->stats.time_ms;
|
||||
achieved_fps = (fbd * 1000) / dt_ms;
|
||||
@@ -2862,19 +2858,19 @@ static int msm_vidc_queue_buffer(struct msm_vidc_inst *inst, struct msm_vidc_buf
|
||||
int rc = 0;
|
||||
u32 cr = 0;
|
||||
|
||||
if (!inst || !buf || !inst->capabilities) {
|
||||
if (!inst || !buf) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (is_encode_session(inst) && is_input_buffer(buf->type)) {
|
||||
cr = inst->capabilities->cap[ENC_IP_CR].value;
|
||||
cr = inst->capabilities[ENC_IP_CR].value;
|
||||
msm_vidc_update_input_cr(inst, buf->index, cr);
|
||||
msm_vidc_update_cap_value(inst, ENC_IP_CR, 0, __func__);
|
||||
}
|
||||
|
||||
if (is_decode_session(inst) && is_input_buffer(buf->type) &&
|
||||
inst->capabilities->cap[CODEC_CONFIG].value) {
|
||||
inst->capabilities[CODEC_CONFIG].value) {
|
||||
buf->flags |= MSM_VIDC_BUF_FLAG_CODECCONFIG;
|
||||
msm_vidc_update_cap_value(inst, CODEC_CONFIG, 0, __func__);
|
||||
}
|
||||
@@ -3012,7 +3008,7 @@ int msm_vidc_queue_buffer_single(struct msm_vidc_inst *inst, struct vb2_buffer *
|
||||
struct msm_vidc_fence *fence = NULL;
|
||||
struct msm_vidc_core *core = NULL;
|
||||
|
||||
if (!inst || !vb2 || !inst->capabilities || !inst->core) {
|
||||
if (!inst || !vb2 || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3374,7 +3370,7 @@ int msm_vidc_vb2_buffer_done(struct msm_vidc_inst *inst,
|
||||
struct vb2_v4l2_buffer *vbuf;
|
||||
bool found;
|
||||
|
||||
if (!inst || !inst->capabilities || !buf) {
|
||||
if (!inst || !buf) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3822,7 +3818,7 @@ int msm_vidc_session_set_default_header(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
default_header = inst->capabilities->cap[DEFAULT_HEADER].value;
|
||||
default_header = inst->capabilities[DEFAULT_HEADER].value;
|
||||
i_vpr_h(inst, "%s: default header: %d", __func__, default_header);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
HFI_PROP_DEC_DEFAULT_HEADER,
|
||||
@@ -3990,7 +3986,7 @@ int msm_vidc_get_inst_capability(struct msm_vidc_inst *inst)
|
||||
int i;
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -4002,8 +3998,8 @@ int msm_vidc_get_inst_capability(struct msm_vidc_inst *inst)
|
||||
i_vpr_h(inst,
|
||||
"%s: copied capabilities with %#x codec, %#x domain\n",
|
||||
__func__, inst->codec, inst->domain);
|
||||
memcpy(inst->capabilities, &core->inst_caps[i],
|
||||
sizeof(struct msm_vidc_inst_capability));
|
||||
memcpy(&inst->capabilities[0], &core->inst_caps[i].cap[0],
|
||||
(INST_CAP_MAX + 1) * sizeof(struct msm_vidc_inst_cap));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4540,7 +4536,7 @@ int msm_vidc_print_inst_info(struct msm_vidc_inst *inst)
|
||||
long ref_count = -1;
|
||||
int i = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
i_vpr_e(inst, "%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -4550,9 +4546,9 @@ int msm_vidc_print_inst_info(struct msm_vidc_inst *inst)
|
||||
port = is_decode ? INPUT_PORT : OUTPUT_PORT;
|
||||
width = inst->fmts[port].fmt.pix_mp.width;
|
||||
height = inst->fmts[port].fmt.pix_mp.height;
|
||||
bit_depth = inst->capabilities->cap[BIT_DEPTH].value & 0xFFFF;
|
||||
bit_rate = inst->capabilities->cap[BIT_RATE].value;
|
||||
frame_rate = inst->capabilities->cap[FRAME_RATE].value >> 16;
|
||||
bit_depth = inst->capabilities[BIT_DEPTH].value & 0xFFFF;
|
||||
bit_rate = inst->capabilities[BIT_RATE].value;
|
||||
frame_rate = inst->capabilities[FRAME_RATE].value >> 16;
|
||||
|
||||
i_vpr_e(inst, "%s %s session, HxW: %d x %d, fps: %d, bitrate: %d, bit-depth: %d\n",
|
||||
is_secure ? "Secure" : "Non-Secure",
|
||||
@@ -5144,7 +5140,6 @@ static void msm_vidc_close_helper(struct kref *kref)
|
||||
mutex_destroy(&inst->client_lock);
|
||||
mutex_destroy(&inst->request_lock);
|
||||
mutex_destroy(&inst->lock);
|
||||
msm_vidc_vmem_free((void **)&inst->capabilities);
|
||||
msm_vidc_vmem_free((void **)&inst);
|
||||
/* try suspending video hardware */
|
||||
msm_vidc_try_suspend(core);
|
||||
@@ -5438,8 +5433,8 @@ int msm_vidc_update_debug_str(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities)
|
||||
client_id = inst->capabilities->cap[CLIENT_ID].value;
|
||||
|
||||
client_id = inst->capabilities[CLIENT_ID].value;
|
||||
|
||||
sid = inst->session_id;
|
||||
codec = get_codec_str(inst->codec);
|
||||
@@ -5461,7 +5456,7 @@ static int msm_vidc_print_insts_info(struct msm_vidc_core *core)
|
||||
{
|
||||
struct msm_vidc_inst *inst;
|
||||
u32 height, width, fps, orate;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
struct v4l2_format *out_f;
|
||||
struct v4l2_format *inp_f;
|
||||
char prop[64];
|
||||
@@ -5473,13 +5468,13 @@ static int msm_vidc_print_insts_info(struct msm_vidc_core *core)
|
||||
list_for_each_entry(inst, &core->instances, list) {
|
||||
out_f = &inst->fmts[OUTPUT_PORT];
|
||||
inp_f = &inst->fmts[INPUT_PORT];
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
memset(&prop, 0, sizeof(prop));
|
||||
|
||||
width = max(out_f->fmt.pix_mp.width, inp_f->fmt.pix_mp.width);
|
||||
height = max(out_f->fmt.pix_mp.height, inp_f->fmt.pix_mp.height);
|
||||
fps = capability->cap[FRAME_RATE].value >> 16;
|
||||
orate = capability->cap[OPERATING_RATE].value >> 16;
|
||||
fps = cap[FRAME_RATE].value >> 16;
|
||||
orate = cap[OPERATING_RATE].value >> 16;
|
||||
|
||||
if (is_realtime_session(inst))
|
||||
strlcat(prop, "RT ", sizeof(prop));
|
||||
@@ -5520,7 +5515,7 @@ int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst)
|
||||
struct msm_vidc_core *core;
|
||||
struct msm_vidc_inst *instance;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -5675,20 +5670,20 @@ int msm_vidc_check_core_mbpf(struct msm_vidc_inst *inst)
|
||||
static int msm_vidc_check_inst_mbpf(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 mbpf = 0, max_mbpf = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
if (is_secure_session(inst))
|
||||
max_mbpf = capability->cap[SECURE_MBPF].max;
|
||||
else if (is_encode_session(inst) && capability->cap[LOSSLESS].value)
|
||||
max_mbpf = capability->cap[LOSSLESS_MBPF].max;
|
||||
max_mbpf = cap[SECURE_MBPF].max;
|
||||
else if (is_encode_session(inst) && cap[LOSSLESS].value)
|
||||
max_mbpf = cap[LOSSLESS_MBPF].max;
|
||||
else
|
||||
max_mbpf = capability->cap[MBPF].max;
|
||||
max_mbpf = cap[MBPF].max;
|
||||
|
||||
/* check current session mbpf */
|
||||
mbpf = msm_vidc_get_mbs_per_frame(inst);
|
||||
@@ -5705,63 +5700,63 @@ u32 msm_vidc_get_max_bitrate(struct msm_vidc_inst* inst)
|
||||
{
|
||||
u32 max_bitrate = 0x7fffffff;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[LOWLATENCY_MODE].value)
|
||||
if (inst->capabilities[LOWLATENCY_MODE].value)
|
||||
max_bitrate = min(max_bitrate,
|
||||
(u32)inst->capabilities->cap[LOWLATENCY_MAX_BITRATE].max);
|
||||
(u32)inst->capabilities[LOWLATENCY_MAX_BITRATE].max);
|
||||
|
||||
if (inst->capabilities->cap[ALL_INTRA].value)
|
||||
if (inst->capabilities[ALL_INTRA].value)
|
||||
max_bitrate = min(max_bitrate,
|
||||
(u32)inst->capabilities->cap[ALLINTRA_MAX_BITRATE].max);
|
||||
(u32)inst->capabilities[ALLINTRA_MAX_BITRATE].max);
|
||||
|
||||
if (inst->codec == MSM_VIDC_HEVC) {
|
||||
max_bitrate = min(max_bitrate,
|
||||
(u32)inst->capabilities->cap[CABAC_MAX_BITRATE].max);
|
||||
(u32)inst->capabilities[CABAC_MAX_BITRATE].max);
|
||||
} else if (inst->codec == MSM_VIDC_H264) {
|
||||
if (inst->capabilities->cap[ENTROPY_MODE].value ==
|
||||
if (inst->capabilities[ENTROPY_MODE].value ==
|
||||
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC)
|
||||
max_bitrate = min(max_bitrate,
|
||||
(u32)inst->capabilities->cap[CAVLC_MAX_BITRATE].max);
|
||||
(u32)inst->capabilities[CAVLC_MAX_BITRATE].max);
|
||||
else
|
||||
max_bitrate = min(max_bitrate,
|
||||
(u32)inst->capabilities->cap[CABAC_MAX_BITRATE].max);
|
||||
(u32)inst->capabilities[CABAC_MAX_BITRATE].max);
|
||||
}
|
||||
if (max_bitrate == 0x7fffffff || !max_bitrate)
|
||||
max_bitrate = min(max_bitrate, (u32)inst->capabilities->cap[BIT_RATE].max);
|
||||
max_bitrate = min(max_bitrate, (u32)inst->capabilities[BIT_RATE].max);
|
||||
|
||||
return max_bitrate;
|
||||
}
|
||||
|
||||
static bool msm_vidc_allow_image_encode_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
struct v4l2_format *fmt;
|
||||
u32 min_width, min_height, max_width, max_height, pix_fmt, profile;
|
||||
bool allow = false;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return false;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
if (!is_image_encode_session(inst)) {
|
||||
i_vpr_e(inst, "%s: not an image encode session\n", __func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
pix_fmt = capability->cap[PIX_FMTS].value;
|
||||
profile = capability->cap[PROFILE].value;
|
||||
pix_fmt = cap[PIX_FMTS].value;
|
||||
profile = cap[PROFILE].value;
|
||||
|
||||
/* is input with & height is in allowed range */
|
||||
min_width = capability->cap[FRAME_WIDTH].min;
|
||||
max_width = capability->cap[FRAME_WIDTH].max;
|
||||
min_height = capability->cap[FRAME_HEIGHT].min;
|
||||
max_height = capability->cap[FRAME_HEIGHT].max;
|
||||
min_width = cap[FRAME_WIDTH].min;
|
||||
max_width = cap[FRAME_WIDTH].max;
|
||||
min_height = cap[FRAME_HEIGHT].min;
|
||||
max_height = cap[FRAME_HEIGHT].max;
|
||||
fmt = &inst->fmts[INPUT_PORT];
|
||||
if (!in_range(fmt->fmt.pix_mp.width, min_width, max_width) ||
|
||||
!in_range(fmt->fmt.pix_mp.height, min_height, max_height)) {
|
||||
@@ -5790,35 +5785,35 @@ static bool msm_vidc_allow_image_encode_session(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
/* is bitrate mode CQ */
|
||||
allow = capability->cap[BITRATE_MODE].value == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ;
|
||||
allow = cap[BITRATE_MODE].value == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ;
|
||||
if (!allow) {
|
||||
i_vpr_e(inst, "%s: bitrate mode is not CQ: %#x\n", __func__,
|
||||
capability->cap[BITRATE_MODE].value);
|
||||
cap[BITRATE_MODE].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* is all intra */
|
||||
allow = !capability->cap[GOP_SIZE].value;
|
||||
allow &= !capability->cap[B_FRAME].value;
|
||||
allow = !cap[GOP_SIZE].value;
|
||||
allow &= !cap[B_FRAME].value;
|
||||
if (!allow) {
|
||||
i_vpr_e(inst, "%s: not all intra: gop: %u, bframe: %u\n", __func__,
|
||||
capability->cap[GOP_SIZE].value, capability->cap[B_FRAME].value);
|
||||
cap[GOP_SIZE].value, cap[B_FRAME].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* is time delta based rc disabled */
|
||||
allow = !capability->cap[TIME_DELTA_BASED_RC].value;
|
||||
allow = !cap[TIME_DELTA_BASED_RC].value;
|
||||
if (!allow) {
|
||||
i_vpr_e(inst, "%s: time delta based rc not disabled: %#x\n", __func__,
|
||||
capability->cap[TIME_DELTA_BASED_RC].value);
|
||||
cap[TIME_DELTA_BASED_RC].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* is frame skip mode disabled */
|
||||
allow = !capability->cap[FRAME_SKIP_MODE].value;
|
||||
allow = !cap[FRAME_SKIP_MODE].value;
|
||||
if (!allow) {
|
||||
i_vpr_e(inst, "%s: frame skip mode not disabled: %#x\n", __func__,
|
||||
capability->cap[FRAME_SKIP_MODE].value);
|
||||
cap[FRAME_SKIP_MODE].value);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -5831,16 +5826,16 @@ exit:
|
||||
|
||||
static int msm_vidc_check_resolution_supported(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
u32 width = 0, height = 0, min_width, min_height,
|
||||
max_width, max_height;
|
||||
bool is_interlaced = false;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
cap = &inst->capabilities[0];
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
width = inst->fmts[INPUT_PORT].fmt.pix_mp.width;
|
||||
@@ -5851,20 +5846,20 @@ static int msm_vidc_check_resolution_supported(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
if (is_secure_session(inst)) {
|
||||
min_width = capability->cap[SECURE_FRAME_WIDTH].min;
|
||||
max_width = capability->cap[SECURE_FRAME_WIDTH].max;
|
||||
min_height = capability->cap[SECURE_FRAME_HEIGHT].min;
|
||||
max_height = capability->cap[SECURE_FRAME_HEIGHT].max;
|
||||
} else if (is_encode_session(inst) && capability->cap[LOSSLESS].value) {
|
||||
min_width = capability->cap[LOSSLESS_FRAME_WIDTH].min;
|
||||
max_width = capability->cap[LOSSLESS_FRAME_WIDTH].max;
|
||||
min_height = capability->cap[LOSSLESS_FRAME_HEIGHT].min;
|
||||
max_height = capability->cap[LOSSLESS_FRAME_HEIGHT].max;
|
||||
min_width = cap[SECURE_FRAME_WIDTH].min;
|
||||
max_width = cap[SECURE_FRAME_WIDTH].max;
|
||||
min_height = cap[SECURE_FRAME_HEIGHT].min;
|
||||
max_height = cap[SECURE_FRAME_HEIGHT].max;
|
||||
} else if (is_encode_session(inst) && cap[LOSSLESS].value) {
|
||||
min_width = cap[LOSSLESS_FRAME_WIDTH].min;
|
||||
max_width = cap[LOSSLESS_FRAME_WIDTH].max;
|
||||
min_height = cap[LOSSLESS_FRAME_HEIGHT].min;
|
||||
max_height = cap[LOSSLESS_FRAME_HEIGHT].max;
|
||||
} else {
|
||||
min_width = capability->cap[FRAME_WIDTH].min;
|
||||
max_width = capability->cap[FRAME_WIDTH].max;
|
||||
min_height = capability->cap[FRAME_HEIGHT].min;
|
||||
max_height = capability->cap[FRAME_HEIGHT].max;
|
||||
min_width = cap[FRAME_WIDTH].min;
|
||||
max_width = cap[FRAME_WIDTH].max;
|
||||
min_height = cap[FRAME_HEIGHT].min;
|
||||
max_height = cap[FRAME_HEIGHT].max;
|
||||
}
|
||||
|
||||
/* check if input width and height is in supported range */
|
||||
@@ -5880,7 +5875,7 @@ static int msm_vidc_check_resolution_supported(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
/* check interlace supported resolution */
|
||||
is_interlaced = capability->cap[CODED_FRAMES].value == CODED_FRAMES_INTERLACE;
|
||||
is_interlaced = cap[CODED_FRAMES].value == CODED_FRAMES_INTERLACE;
|
||||
if (is_interlaced && (width > INTERLACE_WIDTH_MAX || height > INTERLACE_HEIGHT_MAX ||
|
||||
NUM_MBS_PER_FRAME(width, height) > INTERLACE_MB_PER_FRAME_MAX)) {
|
||||
i_vpr_e(inst, "%s: unsupported interlace wxh [%u x %u], max [%u x %u]\n",
|
||||
@@ -6032,7 +6027,7 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 iwidth, owidth, iheight, oheight, ds_factor;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -6051,7 +6046,7 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst)
|
||||
iheight = inst->crop.height;
|
||||
owidth = inst->compose.width;
|
||||
oheight = inst->compose.height;
|
||||
ds_factor = inst->capabilities->cap[SCALE_FACTOR].value;
|
||||
ds_factor = inst->capabilities[SCALE_FACTOR].value;
|
||||
|
||||
/* upscaling: encoder doesnot support upscaling */
|
||||
if (owidth > iwidth || oheight > iheight) {
|
||||
@@ -6087,7 +6082,7 @@ int msm_vidc_get_properties(struct msm_vidc_inst *inst)
|
||||
{HFI_PROP_QUALITY_MODE, HFI_PORT_BITSTREAM}
|
||||
};
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@@ -117,7 +117,7 @@ int msm_vidc_get_inst_load(struct msm_vidc_inst *inst)
|
||||
u32 mbpf, fps;
|
||||
u32 frame_rate, operating_rate, input_rate, timestamp_rate;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -251,7 +251,7 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
|
||||
struct v4l2_format *inp_f;
|
||||
u32 operating_rate, frame_rate;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params: %pK\n", __func__, inst);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -281,15 +281,15 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
|
||||
inst->codec == MSM_VIDC_VP9) ? 32 : 16;
|
||||
if (inst->codec == MSM_VIDC_AV1)
|
||||
vote_data->lcu_size =
|
||||
inst->capabilities->cap[SUPER_BLOCK].value ? 128 : 64;
|
||||
inst->capabilities[SUPER_BLOCK].value ? 128 : 64;
|
||||
vote_data->fps = inst->max_rate;
|
||||
|
||||
if (inst->domain == MSM_VIDC_ENCODER) {
|
||||
vote_data->domain = MSM_VIDC_ENCODER;
|
||||
vote_data->bitrate = inst->capabilities->cap[BIT_RATE].value;
|
||||
vote_data->rotation = inst->capabilities->cap[ROTATION].value;
|
||||
vote_data->bitrate = inst->capabilities[BIT_RATE].value;
|
||||
vote_data->rotation = inst->capabilities[ROTATION].value;
|
||||
vote_data->b_frames_enabled =
|
||||
inst->capabilities->cap[B_FRAME].value > 0;
|
||||
inst->capabilities[B_FRAME].value > 0;
|
||||
|
||||
/* scale bitrate if operating rate is larger than frame rate */
|
||||
frame_rate = msm_vidc_get_frame_rate(inst);
|
||||
@@ -301,7 +301,7 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
|
||||
vote_data->color_formats[0] = v4l2_colorformat_to_driver(inst,
|
||||
inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat, __func__);
|
||||
vote_data->vpss_preprocessing_enabled =
|
||||
inst->capabilities->cap[REQUEST_PREPROCESS].value;
|
||||
inst->capabilities[REQUEST_PREPROCESS].value;
|
||||
} else if (inst->domain == MSM_VIDC_DECODER) {
|
||||
u32 color_format;
|
||||
|
||||
@@ -322,7 +322,7 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
|
||||
}
|
||||
vote_data->color_formats[1] = color_format;
|
||||
} else if (inst->codec == MSM_VIDC_AV1 &&
|
||||
inst->capabilities->cap[FILM_GRAIN].value) {
|
||||
inst->capabilities[FILM_GRAIN].value) {
|
||||
/*
|
||||
* UBWC formats with AV1 film grain requires dpb-opb
|
||||
* split mode
|
||||
@@ -335,7 +335,7 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
|
||||
vote_data->color_formats[0] = color_format;
|
||||
}
|
||||
}
|
||||
vote_data->work_mode = inst->capabilities->cap[STAGE].value;
|
||||
vote_data->work_mode = inst->capabilities[STAGE].value;
|
||||
if (core->resource->subcache_set.set_to_fw)
|
||||
vote_data->use_sys_cache = true;
|
||||
vote_data->num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
|
||||
|
@@ -827,7 +827,7 @@ static int msm_vidc_input_streaming_state(struct msm_vidc_inst *inst,
|
||||
/* disallow */
|
||||
if (is_decode_session(inst)) {
|
||||
/* check dynamic allowed if master port is streaming */
|
||||
if (!(inst->capabilities->cap[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
if (!(inst->capabilities[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
i_vpr_e(inst, "%s: cap_id %#x not allowed in state %s\n",
|
||||
__func__, cap_id, state_name(inst->state));
|
||||
return -EINVAL;
|
||||
@@ -1029,7 +1029,7 @@ static int msm_vidc_output_streaming_state(struct msm_vidc_inst *inst,
|
||||
/* disallow */
|
||||
if (is_encode_session(inst)) {
|
||||
/* check dynamic allowed if master port is streaming */
|
||||
if (!(inst->capabilities->cap[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
if (!(inst->capabilities[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
i_vpr_e(inst, "%s: cap_id %#x not allowed in state %s\n",
|
||||
__func__, cap_id, state_name(inst->state));
|
||||
return -EINVAL;
|
||||
@@ -1183,7 +1183,7 @@ static int msm_vidc_streaming_state(struct msm_vidc_inst *inst,
|
||||
}
|
||||
|
||||
/* disallow */
|
||||
if (!(inst->capabilities->cap[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
if (!(inst->capabilities[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
|
||||
i_vpr_e(inst, "%s: cap_id %#x not allowed in state %s\n",
|
||||
__func__, cap_id, state_name(inst->state));
|
||||
return -EINVAL;
|
||||
|
@@ -334,8 +334,8 @@ int msm_vb2_queue_setup(struct vb2_queue *q,
|
||||
sizes[0] = inst->fmts[port].fmt.meta.buffersize;
|
||||
} else if (port == INPUT_META_PORT) {
|
||||
inst->fmts[port].fmt.meta.buffersize = buffers->size;
|
||||
if (inst->capabilities->cap[SUPER_FRAME].value)
|
||||
sizes[0] = inst->capabilities->cap[SUPER_FRAME].value *
|
||||
if (inst->capabilities[SUPER_FRAME].value)
|
||||
sizes[0] = inst->capabilities[SUPER_FRAME].value *
|
||||
inst->fmts[port].fmt.meta.buffersize;
|
||||
else
|
||||
sizes[0] = inst->fmts[port].fmt.meta.buffersize;
|
||||
@@ -374,7 +374,7 @@ int msm_vb2_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
}
|
||||
inst = q->drv_priv;
|
||||
inst = get_inst_ref(g_core, inst);
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@@ -1319,7 +1319,7 @@ int venus_hfi_session_set_secure_mode(struct msm_vidc_inst *inst)
|
||||
if (rc)
|
||||
goto unlock;
|
||||
|
||||
secure_mode = inst->capabilities->cap[SECURE_MODE].value;
|
||||
secure_mode = inst->capabilities[SECURE_MODE].value;
|
||||
rc = hfi_create_packet(inst->packet, inst->packet_size,
|
||||
HFI_PROP_SECURE,
|
||||
HFI_HOST_FLAGS_NONE,
|
||||
@@ -1738,16 +1738,14 @@ int venus_hfi_queue_super_buffer(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_core *core;
|
||||
struct hfi_buffer hfi_buffer;
|
||||
struct hfi_buffer hfi_meta_buffer;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
u32 frame_size, meta_size, batch_size, cnt = 0;
|
||||
u64 ts_delta_us;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities || !inst->packet) {
|
||||
if (!inst || !inst->core || !inst->packet) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
capability = inst->capabilities;
|
||||
core_lock(core, __func__);
|
||||
|
||||
if (!__valdiate_session(core, inst, __func__)) {
|
||||
@@ -1767,10 +1765,10 @@ int venus_hfi_queue_super_buffer(struct msm_vidc_inst *inst,
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
batch_size = capability->cap[SUPER_FRAME].value;
|
||||
batch_size = inst->capabilities[SUPER_FRAME].value;
|
||||
frame_size = call_session_op(core, buffer_size, inst, MSM_VIDC_BUF_INPUT);
|
||||
meta_size = call_session_op(core, buffer_size, inst, MSM_VIDC_BUF_INPUT_META);
|
||||
ts_delta_us = 1000000 / (capability->cap[FRAME_RATE].value >> 16);
|
||||
ts_delta_us = 1000000 / (inst->capabilities[FRAME_RATE].value >> 16);
|
||||
|
||||
/* Sanitize super yuv buffer */
|
||||
if (frame_size * batch_size != buffer->buffer_size) {
|
||||
@@ -1905,7 +1903,7 @@ int venus_hfi_queue_buffer(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_core *core;
|
||||
struct hfi_buffer hfi_buffer, hfi_meta_buffer;
|
||||
|
||||
if (!inst || !inst->core || !inst->packet || !inst->capabilities) {
|
||||
if (!inst || !inst->core || !inst->packet) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2113,7 +2111,7 @@ int venus_hfi_set_ir_period(struct msm_vidc_inst *inst, u32 ir_type,
|
||||
|
||||
core_lock(core, __func__);
|
||||
|
||||
ir_period = inst->capabilities->cap[cap_id].value;
|
||||
ir_period = inst->capabilities[cap_id].value;
|
||||
|
||||
rc = hfi_create_header(inst->packet, inst->packet_size,
|
||||
inst->session_id, core->header_id++);
|
||||
@@ -2151,7 +2149,7 @@ int venus_hfi_set_ir_period(struct msm_vidc_inst *inst, u32 ir_type,
|
||||
|
||||
rc = __cmdq_write(inst->core, inst->packet);
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: failed to set cap[%d] %s to fw\n",
|
||||
i_vpr_e(inst, "%s: failed to set inst->capabilities[%d] %s to fw\n",
|
||||
__func__, cap_id, cap_name(cap_id));
|
||||
goto exit;
|
||||
}
|
||||
|
@@ -629,13 +629,13 @@ static int get_driver_buffer_flags(struct msm_vidc_inst *inst, u32 hfi_flags)
|
||||
driver_flags |= MSM_VIDC_BUF_FLAG_ERROR;
|
||||
|
||||
if (inst->hfi_frame_info.no_output) {
|
||||
if (inst->capabilities->cap[META_BUF_TAG].value &&
|
||||
if (inst->capabilities[META_BUF_TAG].value &&
|
||||
!(hfi_flags & HFI_BUF_FW_FLAG_CODEC_CONFIG))
|
||||
driver_flags |= MSM_VIDC_BUF_FLAG_ERROR;
|
||||
}
|
||||
|
||||
if (inst->hfi_frame_info.subframe_input)
|
||||
if (inst->capabilities->cap[META_BUF_TAG].value)
|
||||
if (inst->capabilities[META_BUF_TAG].value)
|
||||
driver_flags |= MSM_VIDC_BUF_FLAG_ERROR;
|
||||
|
||||
if (hfi_flags & HFI_BUF_FW_FLAG_CODEC_CONFIG)
|
||||
@@ -650,7 +650,7 @@ static int get_driver_buffer_flags(struct msm_vidc_inst *inst, u32 hfi_flags)
|
||||
if ((is_encode_session(inst) &&
|
||||
(hfi_flags & HFI_BUF_FW_FLAG_LAST)) ||
|
||||
(is_decode_session(inst) &&
|
||||
!inst->capabilities->cap[LAST_FLAG_EVENT_ENABLE].value &&
|
||||
!inst->capabilities[LAST_FLAG_EVENT_ENABLE].value &&
|
||||
((hfi_flags & HFI_BUF_FW_FLAG_LAST) ||
|
||||
(hfi_flags & HFI_BUF_FW_FLAG_PSC_LAST))))
|
||||
driver_flags |= MSM_VIDC_BUF_FLAG_LAST;
|
||||
@@ -791,7 +791,7 @@ static int handle_input_buffer(struct msm_vidc_inst *inst,
|
||||
u32 frame_size, batch_size;
|
||||
bool found;
|
||||
|
||||
if (!inst || !buffer || !inst->capabilities || !inst->core) {
|
||||
if (!inst || !buffer || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -817,7 +817,7 @@ static int handle_input_buffer(struct msm_vidc_inst *inst,
|
||||
/* attach dequeued flag for, only last frame in the batch */
|
||||
if (msm_vidc_is_super_buffer(inst)) {
|
||||
frame_size = call_session_op(core, buffer_size, inst, MSM_VIDC_BUF_INPUT);
|
||||
batch_size = inst->capabilities->cap[SUPER_FRAME].value;
|
||||
batch_size = inst->capabilities[SUPER_FRAME].value;
|
||||
if (!frame_size || !batch_size) {
|
||||
i_vpr_e(inst, "%s: invalid size: frame %u, batch %u\n",
|
||||
__func__, frame_size, batch_size);
|
||||
@@ -872,7 +872,7 @@ static int msm_vidc_handle_fence_signal(struct msm_vidc_inst *inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[OUTBUF_FENCE_TYPE].value ==
|
||||
if (inst->capabilities[OUTBUF_FENCE_TYPE].value ==
|
||||
MSM_VIDC_FENCE_NONE)
|
||||
return 0;
|
||||
|
||||
@@ -891,11 +891,11 @@ static int msm_vidc_handle_fence_signal(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[OUTBUF_FENCE_TYPE].value ==
|
||||
if (inst->capabilities[OUTBUF_FENCE_TYPE].value ==
|
||||
MSM_VIDC_SYNX_V2_FENCE) {
|
||||
if (inst->hfi_frame_info.fence_error)
|
||||
signal_error = true;
|
||||
} else if (inst->capabilities->cap[OUTBUF_FENCE_TYPE].value ==
|
||||
} else if (inst->capabilities[OUTBUF_FENCE_TYPE].value ==
|
||||
MSM_VIDC_SW_FENCE) {
|
||||
if (!buf->data_size)
|
||||
signal_error = true;
|
||||
@@ -939,7 +939,7 @@ static int handle_output_buffer(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_core *core;
|
||||
bool found, fatal = false;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1046,7 +1046,7 @@ static int handle_output_buffer(struct msm_vidc_inst *inst,
|
||||
|
||||
if (is_decode_session(inst)) {
|
||||
/* RO flag is not expected for linear colorformat */
|
||||
if (is_linear_colorformat(inst->capabilities->cap[PIX_FMTS].value) &&
|
||||
if (is_linear_colorformat(inst->capabilities[PIX_FMTS].value) &&
|
||||
(buffer->flags & HFI_BUF_FW_FLAG_READONLY)) {
|
||||
buffer->flags &= ~HFI_BUF_FW_FLAG_READONLY;
|
||||
print_vidc_buffer(
|
||||
@@ -1108,7 +1108,7 @@ static int handle_input_metadata_buffer(struct msm_vidc_inst *inst,
|
||||
u32 frame_size, batch_size;
|
||||
bool found;
|
||||
|
||||
if (!inst || !buffer || !inst->capabilities || !inst->core) {
|
||||
if (!inst || !buffer || !inst->core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1133,7 +1133,7 @@ static int handle_input_metadata_buffer(struct msm_vidc_inst *inst,
|
||||
/* attach dequeued flag for, only last frame in the batch */
|
||||
if (msm_vidc_is_super_buffer(inst)) {
|
||||
frame_size = call_session_op(core, buffer_size, inst, MSM_VIDC_BUF_INPUT_META);
|
||||
batch_size = inst->capabilities->cap[SUPER_FRAME].value;
|
||||
batch_size = inst->capabilities[SUPER_FRAME].value;
|
||||
if (!frame_size || !batch_size) {
|
||||
i_vpr_e(inst, "%s: invalid size: frame %u, batch %u\n",
|
||||
__func__, frame_size, batch_size);
|
||||
@@ -1158,7 +1158,7 @@ static int handle_input_metadata_buffer(struct msm_vidc_inst *inst,
|
||||
if ((is_encode_session(inst) &&
|
||||
(buffer->flags & HFI_BUF_FW_FLAG_LAST)) ||
|
||||
(is_decode_session(inst) &&
|
||||
!inst->capabilities->cap[LAST_FLAG_EVENT_ENABLE].value &&
|
||||
!inst->capabilities[LAST_FLAG_EVENT_ENABLE].value &&
|
||||
((buffer->flags & HFI_BUF_FW_FLAG_LAST) ||
|
||||
(buffer->flags & HFI_BUF_FW_FLAG_PSC_LAST))))
|
||||
buf->flags |= MSM_VIDC_BUF_FLAG_LAST;
|
||||
@@ -1175,7 +1175,7 @@ static int handle_output_metadata_buffer(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *buf;
|
||||
bool found;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1210,7 +1210,7 @@ static int handle_output_metadata_buffer(struct msm_vidc_inst *inst,
|
||||
if ((is_encode_session(inst) &&
|
||||
(buffer->flags & HFI_BUF_FW_FLAG_LAST)) ||
|
||||
(is_decode_session(inst) &&
|
||||
!inst->capabilities->cap[LAST_FLAG_EVENT_ENABLE].value &&
|
||||
!inst->capabilities[LAST_FLAG_EVENT_ENABLE].value &&
|
||||
((buffer->flags & HFI_BUF_FW_FLAG_LAST) ||
|
||||
(buffer->flags & HFI_BUF_FW_FLAG_PSC_LAST))))
|
||||
buf->flags |= MSM_VIDC_BUF_FLAG_LAST;
|
||||
@@ -1760,7 +1760,7 @@ static int handle_property_with_payload(struct msm_vidc_inst *inst,
|
||||
break;
|
||||
case HFI_PROP_DPB_LIST:
|
||||
if (is_decode_session(inst) &&
|
||||
inst->capabilities->cap[DPB_LIST].value) {
|
||||
inst->capabilities[DPB_LIST].value) {
|
||||
rc = handle_dpb_list_property(inst, pkt);
|
||||
if (rc)
|
||||
break;
|
||||
@@ -1768,27 +1768,27 @@ static int handle_property_with_payload(struct msm_vidc_inst *inst,
|
||||
i_vpr_e(inst,
|
||||
"%s: invalid property %#x for %s port %d dpb cap value %d\n",
|
||||
__func__, pkt->type, is_decode_session(inst) ? "decode" : "encode",
|
||||
port, inst->capabilities->cap[DPB_LIST].value);
|
||||
port, inst->capabilities[DPB_LIST].value);
|
||||
}
|
||||
break;
|
||||
case HFI_PROP_QUALITY_MODE:
|
||||
if (inst->capabilities->cap[QUALITY_MODE].value != payload_ptr[0])
|
||||
if (inst->capabilities[QUALITY_MODE].value != payload_ptr[0])
|
||||
i_vpr_e(inst,
|
||||
"%s: fw quality mode(%d) not matching the capability value(%d)\n",
|
||||
__func__, payload_ptr[0],
|
||||
inst->capabilities->cap[QUALITY_MODE].value);
|
||||
inst->capabilities[QUALITY_MODE].value);
|
||||
break;
|
||||
case HFI_PROP_STAGE:
|
||||
if (inst->capabilities->cap[STAGE].value != payload_ptr[0])
|
||||
if (inst->capabilities[STAGE].value != payload_ptr[0])
|
||||
i_vpr_e(inst,
|
||||
"%s: fw stage mode(%d) not matching the capability value(%d)\n",
|
||||
__func__, payload_ptr[0], inst->capabilities->cap[STAGE].value);
|
||||
__func__, payload_ptr[0], inst->capabilities[STAGE].value);
|
||||
break;
|
||||
case HFI_PROP_PIPE:
|
||||
if (inst->capabilities->cap[PIPE].value != payload_ptr[0])
|
||||
if (inst->capabilities[PIPE].value != payload_ptr[0])
|
||||
i_vpr_e(inst,
|
||||
"%s: fw pipe mode(%d) not matching the capability value(%d)\n",
|
||||
__func__, payload_ptr[0], inst->capabilities->cap[PIPE].value);
|
||||
__func__, payload_ptr[0], inst->capabilities[PIPE].value);
|
||||
break;
|
||||
case HFI_PROP_FENCE:
|
||||
inst->hfi_frame_info.fence_id = payload_ptr[0];
|
||||
@@ -1831,7 +1831,7 @@ static int handle_session_property(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
u32 port;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user