video: driver: Convert debug messages

Add new print format using msm_vidc_inst.
    Convert existing sid print statements.

Change-Id: Iba6774c31ff92997b4f8598e6a705f58bfa1b03c
This commit is contained in:
Sebastian Dang
2021-02-01 20:39:39 -08:00
parent 73c17560ac
commit 5220f1f7f2
17 changed files with 497 additions and 442 deletions

View File

@@ -53,7 +53,7 @@ static u32 msm_vidc_decoder_bin_size_iris2(struct msm_vidc_inst *inst)
HFI_BUFFER_BIN_VP9D(size, width, height,
0, num_vpp_pipes);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -83,7 +83,7 @@ static u32 msm_vidc_decoder_comv_size_iris2(struct msm_vidc_inst* inst)
else if (inst->codec == MSM_VIDC_HEVC)
HFI_BUFFER_COMV_H265D(size, width, height, out_min_count);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -100,7 +100,7 @@ static u32 msm_vidc_decoder_non_comv_size_iris2(struct msm_vidc_inst* inst)
}
core = inst->core;
if (!core->capabilities) {
s_vpr_e(inst->sid, "%s: invalid core capabilities\n", __func__);
i_vpr_e(inst, "%s: invalid core capabilities\n", __func__);
return size;
}
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
@@ -114,7 +114,7 @@ static u32 msm_vidc_decoder_non_comv_size_iris2(struct msm_vidc_inst* inst)
else if (inst->codec == MSM_VIDC_HEVC)
HFI_BUFFER_NON_COMV_H265D(size, width, height, num_vpp_pipes);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -170,7 +170,7 @@ static u32 msm_vidc_decoder_line_size_iris2(struct msm_vidc_inst *inst)
HFI_BUFFER_LINE_VP9D(size, width, height, out_min_count,
is_opb, num_vpp_pipes);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -190,7 +190,7 @@ static u32 msm_vidc_decoder_persist_size_iris2(struct msm_vidc_inst *inst)
else if (inst->codec == MSM_VIDC_VP9)
HFI_BUFFER_PERSIST_VP9D(size);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -235,7 +235,7 @@ static u32 msm_vidc_decoder_dpb_size_iris2(struct msm_vidc_inst *inst)
height));
}
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -253,7 +253,7 @@ static u32 msm_vidc_encoder_bin_size_iris2(struct msm_vidc_inst *inst)
}
core = inst->core;
if (!core->capabilities) {
s_vpr_e(inst->sid, "%s: invalid core capabilities\n", __func__);
i_vpr_e(inst, "%s: invalid core capabilities\n", __func__);
return size;
}
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
@@ -267,7 +267,7 @@ static u32 msm_vidc_encoder_bin_size_iris2(struct msm_vidc_inst *inst)
else if (inst->codec == MSM_VIDC_HEVC)
HFI_BUFFER_BIN_H265E(size, width, height, stage, num_vpp_pipes);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -300,7 +300,7 @@ static u32 msm_vidc_encoder_comv_size_iris2(struct msm_vidc_inst* inst)
HFI_BUFFER_COMV_H265E(size, width, height, num_ref);
}
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -317,7 +317,7 @@ static u32 msm_vidc_encoder_non_comv_size_iris2(struct msm_vidc_inst* inst)
}
core = inst->core;
if (!core->capabilities) {
s_vpr_e(inst->sid, "%s: invalid core capabilities\n", __func__);
i_vpr_e(inst, "%s: invalid core capabilities\n", __func__);
return size;
}
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
@@ -330,7 +330,7 @@ static u32 msm_vidc_encoder_non_comv_size_iris2(struct msm_vidc_inst* inst)
else if (inst->codec == MSM_VIDC_HEVC)
HFI_BUFFER_NON_COMV_H265E(size, width, height, num_vpp_pipes);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -348,7 +348,7 @@ static u32 msm_vidc_encoder_line_size_iris2(struct msm_vidc_inst *inst)
}
core = inst->core;
if (!core->capabilities) {
s_vpr_e(inst->sid, "%s: invalid core capabilities\n", __func__);
i_vpr_e(inst, "%s: invalid core capabilities\n", __func__);
return size;
}
num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
@@ -368,7 +368,7 @@ static u32 msm_vidc_encoder_line_size_iris2(struct msm_vidc_inst *inst)
else if (inst->codec == MSM_VIDC_HEVC)
HFI_BUFFER_LINE_H265E(size, width, height, is_tenbit, num_vpp_pipes);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -399,7 +399,7 @@ static u32 msm_vidc_encoder_dpb_size_iris2(struct msm_vidc_inst *inst)
else if (inst->codec == MSM_VIDC_HEVC)
HFI_BUFFER_DPB_H265E(size, width, height, is_tenbit);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -413,7 +413,7 @@ static u32 msm_vidc_encoder_arp_size_iris2(struct msm_vidc_inst *inst)
}
HFI_BUFFER_ARP_ENC(size);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
@@ -445,7 +445,7 @@ static u32 msm_vidc_encoder_vpss_size_iris2(struct msm_vidc_inst* inst)
HFI_BUFFER_VPSS_ENC(size, width, height, ds_enable,
rot_enable, flip_enable, is_tenbit);
s_vpr_l(inst->sid, "%s: size %d\n", __func__, size);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}

View File

@@ -556,7 +556,7 @@ int msm_vidc_decide_work_mode_iris2(struct msm_vidc_inst* inst)
return -EINVAL;
}
s_vpr_h(inst->sid, "Configuring work mode = %u low latency = %u",
i_vpr_h(inst, "Configuring work mode = %u low latency = %u",
work_mode, lowlatency);
inst->capabilities->cap[STAGE].value = work_mode;
@@ -602,7 +602,7 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst* inst)
return -EINVAL;
}
s_vpr_h(inst->sid, "Configuring work route = %u", work_route);
i_vpr_h(inst, "Configuring work route = %u", work_route);
inst->capabilities->cap[PIPE].value = work_route;
return 0;

View File

@@ -125,14 +125,14 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
vsp_cycles += mbs_per_second * base_cycles;
} else {
s_vpr_e(inst->sid, "%s: Unknown session type\n", __func__);
i_vpr_e(inst, "%s: Unknown session type\n", __func__);
return msm_vidc_max_freq(inst);
}
freq = max(vpp_cycles, vsp_cycles);
freq = max(freq, fw_cycles);
s_vpr_p(inst->sid, "%s: inst %pK: filled len %d required freq %llu\n",
i_vpr_p(inst, "%s: inst %pK: filled len %d required freq %llu\n",
__func__, inst, data_size, freq);
return freq;
@@ -660,7 +660,7 @@ static u64 __calculate(struct msm_vidc_inst* inst, struct vidc_bus_vote_data *d)
value = __calculate_decoder(d);
break;
default:
s_vpr_e(inst->sid, "%s: Unknown Domain %#x", __func__, d->domain);
i_vpr_e(inst, "%s: Unknown Domain %#x", __func__, d->domain);
}
return value;

View File

@@ -55,6 +55,27 @@ enum vidc_msg_prio {
#define FW_LOGSHIFT 16
#define FW_LOGMASK 0x0FFF0000
#define dprintk_inst(__level, inst, __fmt, ...) \
do { \
if (inst && (msm_vidc_debug & __level)) { \
pr_err(VIDC_DBG_TAG __fmt, \
level_str(__level), \
get_sid(inst), \
codec_str(inst), \
##__VA_ARGS__); \
} \
} while (0)
#define i_vpr_e(inst, __fmt, ...) dprintk_inst(VIDC_ERR, inst, __fmt, ##__VA_ARGS__)
#define i_vpr_i(inst, __fmt, ...) dprintk_inst(VIDC_INFO, inst, __fmt, ##__VA_ARGS__)
#define i_vpr_h(inst, __fmt, ...) dprintk_inst(VIDC_HIGH, inst, __fmt, ##__VA_ARGS__)
#define i_vpr_l(inst, __fmt, ...) dprintk_inst(VIDC_LOW, inst, __fmt, ##__VA_ARGS__)
#define i_vpr_p(inst, __fmt, ...) dprintk_inst(VIDC_PERF, inst, __fmt, ##__VA_ARGS__)
#define i_vpr_t(inst, __fmt, ...) dprintk_inst(VIDC_PKT, inst, __fmt, ##__VA_ARGS__)
#define i_vpr_b(inst, __fmt, ...) dprintk_inst(VIDC_BUS, inst, __fmt, ##__VA_ARGS__)
#define i_vpr_hp(inst, __fmt, ...) \
dprintk_inst(VIDC_HIGH | VIDC_PERF, inst, __fmt, ##__VA_ARGS__)
#define dprintk(__level, sid, __fmt, ...) \
do { \
if (msm_vidc_debug & __level) { \
@@ -66,16 +87,6 @@ enum vidc_msg_prio {
} \
} while (0)
#define s_vpr_e(sid, __fmt, ...) dprintk(VIDC_ERR, sid, __fmt, ##__VA_ARGS__)
#define s_vpr_i(sid, __fmt, ...) dprintk(VIDC_INFO, sid, __fmt, ##__VA_ARGS__)
#define s_vpr_h(sid, __fmt, ...) dprintk(VIDC_HIGH, sid, __fmt, ##__VA_ARGS__)
#define s_vpr_l(sid, __fmt, ...) dprintk(VIDC_LOW, sid, __fmt, ##__VA_ARGS__)
#define s_vpr_p(sid, __fmt, ...) dprintk(VIDC_PERF, sid, __fmt, ##__VA_ARGS__)
#define s_vpr_t(sid, __fmt, ...) dprintk(VIDC_PKT, sid, __fmt, ##__VA_ARGS__)
#define s_vpr_b(sid, __fmt, ...) dprintk(VIDC_BUS, sid, __fmt, ##__VA_ARGS__)
#define s_vpr_hp(sid, __fmt, ...) \
dprintk(VIDC_HIGH|VIDC_PERF, sid, __fmt, ##__VA_ARGS__)
#define d_vpr_e(__fmt, ...) \
dprintk(VIDC_ERR, DEFAULT_SID, __fmt, ##__VA_ARGS__)
#define d_vpr_i(__fmt, ...) \
@@ -104,6 +115,8 @@ enum vidc_msg_prio {
} while (0)
const char *level_str(u32 level);
const char *codec_str(void *instance);
u32 get_sid(void *instance);
enum msm_vidc_debugfs_event {
MSM_VIDC_DEBUGFS_EVENT_ETB,

View File

@@ -26,7 +26,7 @@ u32 get_hfi_port(struct msm_vidc_inst *inst,
hfi_port = HFI_PORT_RAW;
break;
default:
s_vpr_e(inst->sid, "%s: invalid port type %d\n",
i_vpr_e(inst, "%s: invalid port type %d\n",
__func__, port);
break;
}
@@ -41,12 +41,12 @@ u32 get_hfi_port(struct msm_vidc_inst *inst,
hfi_port = HFI_PORT_BITSTREAM;
break;
default:
s_vpr_e(inst->sid, "%s: invalid port type %d\n",
i_vpr_e(inst, "%s: invalid port type %d\n",
__func__, port);
break;
}
} else {
s_vpr_e(inst->sid, "%s: invalid domain %#x\n",
i_vpr_e(inst, "%s: invalid domain %#x\n",
__func__, inst->domain);
}
@@ -78,7 +78,7 @@ u32 get_hfi_port_from_buffer_type(struct msm_vidc_inst *inst,
hfi_port = HFI_PORT_RAW;
break;
default:
s_vpr_e(inst->sid, "%s: invalid buffer type %d\n",
i_vpr_e(inst, "%s: invalid buffer type %d\n",
__func__, buffer_type);
break;
}
@@ -102,12 +102,12 @@ u32 get_hfi_port_from_buffer_type(struct msm_vidc_inst *inst,
hfi_port = HFI_PORT_NONE;
break;
default:
s_vpr_e(inst->sid, "%s: invalid buffer type %d\n",
i_vpr_e(inst, "%s: invalid buffer type %d\n",
__func__, buffer_type);
break;
}
} else {
s_vpr_e(inst->sid, "%s: invalid domain %#x\n",
i_vpr_e(inst, "%s: invalid domain %#x\n",
__func__, inst->domain);
}
@@ -202,7 +202,7 @@ u32 get_hfi_colorformat(struct msm_vidc_inst *inst,
hfi_colorformat = HFI_COLOR_FMT_NV21;
break;
default:
s_vpr_e(inst->sid, "%s: invalid colorformat %d\n",
i_vpr_e(inst, "%s: invalid colorformat %d\n",
__func__, colorformat);
break;
}
@@ -227,7 +227,7 @@ u32 get_hfi_quality_mode(struct msm_vidc_inst *inst)
hfi_mode = HFI_MODE_POWER_SAVE;
break;
default:
s_vpr_e(inst->sid, "%s: invalid qulity mode %d\n", __func__,
i_vpr_e(inst, "%s: invalid qulity mode %d\n", __func__,
inst->capabilities->cap[QUALITY_MODE].value);
break;
}

View File

@@ -44,7 +44,7 @@ static int msm_vdec_codec_change(struct msm_vidc_inst *inst, u32 v4l2_codec)
if (inst->codec && inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat == v4l2_codec)
return 0;
s_vpr_h(inst->sid, "%s: codec changed from %#x to %#x\n",
i_vpr_h(inst, "%s: codec changed from %#x to %#x\n",
__func__, inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat, v4l2_codec);
inst->codec = v4l2_codec_to_driver(v4l2_codec, __func__);
@@ -72,7 +72,7 @@ static int msm_vdec_set_bitstream_resolution(struct msm_vidc_inst *inst,
resolution = inst->fmts[INPUT_PORT].fmt.pix_mp.width << 16 |
inst->fmts[INPUT_PORT].fmt.pix_mp.height;
s_vpr_h(inst->sid, "%s: width: %d height: %d\n", __func__,
i_vpr_h(inst, "%s: width: %d height: %d\n", __func__,
inst->fmts[INPUT_PORT].fmt.pix_mp.width,
inst->fmts[INPUT_PORT].fmt.pix_mp.height);
inst->subcr_params[port].bitstream_resolution = resolution;
@@ -84,7 +84,7 @@ static int msm_vdec_set_bitstream_resolution(struct msm_vidc_inst *inst,
&resolution,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -108,7 +108,7 @@ static int msm_vdec_set_linear_stride_scanline(struct msm_vidc_inst *inst)
payload[0] = stride_y << 16 | scanline_y;
payload[1] = stride_uv << 16 | scanline_uv;
s_vpr_h(inst->sid, "%s: stride_y: %d scanline_y: %d "
i_vpr_h(inst, "%s: stride_y: %d scanline_y: %d "
"stride_uv: %d, scanline_uv: %d", __func__,
stride_y, scanline_y, stride_uv, scanline_uv);
rc = venus_hfi_session_property(inst,
@@ -119,7 +119,7 @@ static int msm_vdec_set_linear_stride_scanline(struct msm_vidc_inst *inst)
&payload,
sizeof(u64));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -148,7 +148,7 @@ static int msm_vdec_set_crop_offsets(struct msm_vidc_inst *inst,
payload = (u64)right_offset << 48 | (u64)bottom_offset << 32 |
(u64)left_offset << 16 | top_offset;
s_vpr_h(inst->sid, "%s: left_offset: %d top_offset: %d "
i_vpr_h(inst, "%s: left_offset: %d top_offset: %d "
"right_offset: %d bottom_offset: %d", __func__,
left_offset, top_offset, right_offset, bottom_offset);
inst->subcr_params[port].crop_offsets = payload;
@@ -160,7 +160,7 @@ static int msm_vdec_set_crop_offsets(struct msm_vidc_inst *inst,
&payload,
sizeof(u64));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -173,7 +173,7 @@ static int msm_vdec_set_bit_depth(struct msm_vidc_inst *inst,
u32 bitdepth = 8 << 16 | 8;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
@@ -184,7 +184,7 @@ static int msm_vdec_set_bit_depth(struct msm_vidc_inst *inst,
inst->subcr_params[port].bit_depth = bitdepth;
inst->capabilities->cap[BIT_DEPTH].value = bitdepth;
s_vpr_h(inst->sid, "%s: bit depth: %d", __func__, bitdepth);
i_vpr_h(inst, "%s: bit depth: %d", __func__, bitdepth);
rc = venus_hfi_session_property(inst,
HFI_PROP_LUMA_CHROMA_BIT_DEPTH,
HFI_HOST_FLAGS_NONE,
@@ -193,7 +193,7 @@ static int msm_vdec_set_bit_depth(struct msm_vidc_inst *inst,
&bitdepth,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -206,13 +206,13 @@ static int msm_vdec_set_cabac(struct msm_vidc_inst *inst,
u32 cabac = 0;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
cabac = inst->capabilities->cap[ENTROPY_MODE].value;
inst->subcr_params[port].cabac = cabac;
s_vpr_h(inst->sid, "%s: entropy mode: %d", __func__, cabac);
i_vpr_h(inst, "%s: entropy mode: %d", __func__, cabac);
rc = venus_hfi_session_property(inst,
HFI_PROP_CABAC_SESSION,
HFI_HOST_FLAGS_NONE,
@@ -221,7 +221,7 @@ static int msm_vdec_set_cabac(struct msm_vidc_inst *inst,
&cabac,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -233,13 +233,13 @@ static int msm_vdec_set_coded_frames(struct msm_vidc_inst *inst,
u32 coded_frames;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
coded_frames = inst->capabilities->cap[CODED_FRAMES].value;
inst->subcr_params[port].coded_frames = coded_frames;
s_vpr_h(inst->sid, "%s: coded frames: %d", __func__, coded_frames);
i_vpr_h(inst, "%s: coded frames: %d", __func__, coded_frames);
rc = venus_hfi_session_property(inst,
HFI_PROP_CODED_FRAMES,
HFI_HOST_FLAGS_NONE,
@@ -248,7 +248,7 @@ static int msm_vdec_set_coded_frames(struct msm_vidc_inst *inst,
&coded_frames,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -260,13 +260,13 @@ static int msm_vdec_set_min_output_count(struct msm_vidc_inst *inst,
u32 min_output;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
min_output = inst->buffers.output.min_count;
inst->subcr_params[port].fw_min_count = min_output;
s_vpr_h(inst->sid, "%s: firmware min output count: %d",
i_vpr_h(inst, "%s: firmware min output count: %d",
__func__, min_output);
rc = venus_hfi_session_property(inst,
HFI_PROP_BUFFER_FW_MIN_OUTPUT_COUNT,
@@ -276,7 +276,7 @@ static int msm_vdec_set_min_output_count(struct msm_vidc_inst *inst,
&min_output,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -288,12 +288,12 @@ static int msm_vdec_set_picture_order_count(struct msm_vidc_inst *inst,
u32 poc = 0;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
inst->subcr_params[port].pic_order_cnt = poc;
s_vpr_h(inst->sid, "%s: picture order count: %d", __func__, poc);
i_vpr_h(inst, "%s: picture order count: %d", __func__, poc);
rc = venus_hfi_session_property(inst,
HFI_PROP_PIC_ORDER_CNT_TYPE,
HFI_HOST_FLAGS_NONE,
@@ -302,7 +302,7 @@ static int msm_vdec_set_picture_order_count(struct msm_vidc_inst *inst,
&poc,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -314,7 +314,7 @@ static int msm_vdec_set_colorspace(struct msm_vidc_inst *inst,
u32 colorspace, xfer_func, ycbcr_enc, color_info;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
@@ -325,7 +325,7 @@ static int msm_vdec_set_colorspace(struct msm_vidc_inst *inst,
color_info = ((ycbcr_enc << 16) & 0xFF0000) |
((xfer_func << 8) & 0xFF00) | (colorspace & 0xFF);
inst->subcr_params[port].color_info = color_info;
s_vpr_h(inst->sid, "%s: color info: %d", __func__, color_info);
i_vpr_h(inst, "%s: color info: %d", __func__, color_info);
rc = venus_hfi_session_property(inst,
HFI_PROP_SIGNAL_COLOR_INFO,
HFI_HOST_FLAGS_NONE,
@@ -334,7 +334,7 @@ static int msm_vdec_set_colorspace(struct msm_vidc_inst *inst,
&color_info,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -346,13 +346,13 @@ static int msm_vdec_set_profile(struct msm_vidc_inst *inst,
u32 profile;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
profile = inst->capabilities->cap[PROFILE].value;
inst->subcr_params[port].profile = profile;
s_vpr_h(inst->sid, "%s: profile: %d", __func__, profile);
i_vpr_h(inst, "%s: profile: %d", __func__, profile);
rc = venus_hfi_session_property(inst,
HFI_PROP_PROFILE,
HFI_HOST_FLAGS_NONE,
@@ -361,7 +361,7 @@ static int msm_vdec_set_profile(struct msm_vidc_inst *inst,
&profile,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -373,13 +373,13 @@ static int msm_vdec_set_level(struct msm_vidc_inst *inst,
u32 level;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
level = inst->capabilities->cap[LEVEL].value;
inst->subcr_params[port].level = level;
s_vpr_h(inst->sid, "%s: level: %d", __func__, level);
i_vpr_h(inst, "%s: level: %d", __func__, level);
rc = venus_hfi_session_property(inst,
HFI_PROP_LEVEL,
HFI_HOST_FLAGS_NONE,
@@ -388,7 +388,7 @@ static int msm_vdec_set_level(struct msm_vidc_inst *inst,
&level,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -400,13 +400,13 @@ static int msm_vdec_set_tier(struct msm_vidc_inst *inst,
u32 tier;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
tier = inst->capabilities->cap[HEVC_TIER].value;
inst->subcr_params[port].tier = tier;
s_vpr_h(inst->sid, "%s: tier: %d", __func__, tier);
i_vpr_h(inst, "%s: tier: %d", __func__, tier);
rc = venus_hfi_session_property(inst,
HFI_PROP_TIER,
HFI_HOST_FLAGS_NONE,
@@ -415,7 +415,7 @@ static int msm_vdec_set_tier(struct msm_vidc_inst *inst,
&tier,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -430,7 +430,7 @@ static int msm_vdec_set_colorformat(struct msm_vidc_inst *inst)
pixelformat = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat;
colorformat = v4l2_colorformat_to_driver(pixelformat, __func__);
hfi_colorformat = get_hfi_colorformat(inst, colorformat);
s_vpr_h(inst->sid, "%s: hfi colorformat: %d",
i_vpr_h(inst, "%s: hfi colorformat: %d",
__func__, hfi_colorformat);
rc = venus_hfi_session_property(inst,
HFI_PROP_COLOR_FORMAT,
@@ -440,7 +440,7 @@ static int msm_vdec_set_colorformat(struct msm_vidc_inst *inst)
&hfi_colorformat,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -454,13 +454,13 @@ static int msm_vdec_set_stage(struct msm_vidc_inst *inst)
rc = call_session_op(core, decide_work_mode, inst);
if (rc) {
s_vpr_e(inst->sid, "%s: decide_work_mode failed %d\n",
i_vpr_e(inst, "%s: decide_work_mode failed %d\n",
__func__);
return -EINVAL;
}
stage = capability->cap[STAGE].value;
s_vpr_h(inst->sid, "%s: stage: %d", __func__, stage);
i_vpr_h(inst, "%s: stage: %d", __func__, stage);
rc = venus_hfi_session_property(inst,
HFI_PROP_STAGE,
HFI_HOST_FLAGS_NONE,
@@ -469,7 +469,7 @@ static int msm_vdec_set_stage(struct msm_vidc_inst *inst)
&stage,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -483,13 +483,13 @@ static int msm_vdec_set_pipe(struct msm_vidc_inst *inst)
rc = call_session_op(core, decide_work_route, inst);
if (rc) {
s_vpr_e(inst->sid, "%s: decide_work_route failed\n",
i_vpr_e(inst, "%s: decide_work_route failed\n",
__func__);
return -EINVAL;
}
pipe = capability->cap[PIPE].value;
s_vpr_h(inst->sid, "%s: pipe: %d", __func__, pipe);
i_vpr_h(inst, "%s: pipe: %d", __func__, pipe);
rc = venus_hfi_session_property(inst,
HFI_PROP_PIPE,
HFI_HOST_FLAGS_NONE,
@@ -498,7 +498,7 @@ static int msm_vdec_set_pipe(struct msm_vidc_inst *inst)
&pipe,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -510,12 +510,12 @@ static int msm_vdec_set_output_order(struct msm_vidc_inst *inst,
u32 output_order;
if (port != INPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
output_order = inst->capabilities->cap[DISPLAY_DELAY_ENABLE].value;
s_vpr_h(inst->sid, "%s: output order: %d", __func__, output_order);
i_vpr_h(inst, "%s: output order: %d", __func__, output_order);
rc = venus_hfi_session_property(inst,
HFI_PROP_DECODE_ORDER_OUTPUT,
HFI_HOST_FLAGS_NONE,
@@ -524,7 +524,7 @@ static int msm_vdec_set_output_order(struct msm_vidc_inst *inst,
&output_order,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -536,7 +536,7 @@ static int msm_vdec_set_secure_mode(struct msm_vidc_inst *inst,
u32 secure_mode;
secure_mode = inst->capabilities->cap[SECURE_MODE].value;
s_vpr_h(inst->sid, "%s: secure mode: %d", __func__, secure_mode);
i_vpr_h(inst, "%s: secure mode: %d", __func__, secure_mode);
rc = venus_hfi_session_property(inst,
HFI_PROP_SECURE,
HFI_HOST_FLAGS_NONE,
@@ -545,7 +545,7 @@ static int msm_vdec_set_secure_mode(struct msm_vidc_inst *inst,
&secure_mode,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -557,11 +557,11 @@ static int msm_vdec_set_thumbnail_mode(struct msm_vidc_inst *inst,
u32 thumbnail_mode = 0;
if (port != INPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s: thumbnail mode: %d", __func__, thumbnail_mode);
i_vpr_h(inst, "%s: thumbnail mode: %d", __func__, thumbnail_mode);
rc = venus_hfi_session_property(inst,
HFI_PROP_THUMBNAIL_MODE,
HFI_HOST_FLAGS_NONE,
@@ -570,7 +570,7 @@ static int msm_vdec_set_thumbnail_mode(struct msm_vidc_inst *inst,
&thumbnail_mode,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -582,11 +582,11 @@ static int msm_vdec_set_realtime(struct msm_vidc_inst *inst,
u32 realtime = 1; //todo
if (port != INPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s: priority: %d", __func__, realtime);
i_vpr_h(inst, "%s: priority: %d", __func__, realtime);
rc = venus_hfi_session_property(inst,
HFI_PROP_REALTIME,
HFI_HOST_FLAGS_NONE,
@@ -595,7 +595,7 @@ static int msm_vdec_set_realtime(struct msm_vidc_inst *inst,
&realtime,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -607,12 +607,12 @@ static int msm_vdec_set_conceal_color_8bit(struct msm_vidc_inst *inst,
u32 conceal_color_8bit;
if (port != INPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
conceal_color_8bit = inst->capabilities->cap[CONCEAL_COLOR_8BIT].value;
s_vpr_h(inst->sid, "%s: conceal color 8bit: %#x",
i_vpr_h(inst, "%s: conceal color 8bit: %#x",
__func__, conceal_color_8bit);
rc = venus_hfi_session_property(inst,
HFI_PROP_CONCEAL_COLOR_8BIT,
@@ -622,7 +622,7 @@ static int msm_vdec_set_conceal_color_8bit(struct msm_vidc_inst *inst,
&conceal_color_8bit,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -634,12 +634,12 @@ static int msm_vdec_set_conceal_color_10bit(struct msm_vidc_inst *inst,
u32 conceal_color_10bit;
if (port != INPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
conceal_color_10bit = inst->capabilities->cap[CONCEAL_COLOR_8BIT].value;
s_vpr_h(inst->sid, "%s: conceal color 10bit: %#x",
i_vpr_h(inst, "%s: conceal color 10bit: %#x",
__func__, conceal_color_10bit);
rc = venus_hfi_session_property(inst,
HFI_PROP_CONCEAL_COLOR_10BIT,
@@ -649,7 +649,7 @@ static int msm_vdec_set_conceal_color_10bit(struct msm_vidc_inst *inst,
&conceal_color_10bit,
sizeof(u32));
if (rc)
s_vpr_e(inst->sid, "%s: set property failed\n", __func__);
i_vpr_e(inst, "%s: set property failed\n", __func__);
return rc;
}
@@ -747,24 +747,24 @@ static int msm_vdec_get_input_internal_buffers(struct msm_vidc_inst *inst)
if (rc)
return rc;
s_vpr_h(inst->sid, "input internal buffer: min size reuse\n");
s_vpr_h(inst->sid, "bin buffer: %d %d %d\n",
i_vpr_h(inst, "input internal buffer: min size reuse\n");
i_vpr_h(inst, "bin buffer: %d %d %d\n",
inst->buffers.bin.min_count,
inst->buffers.bin.size,
inst->buffers.bin.reuse);
s_vpr_h(inst->sid, "comv buffer: %d %d %d\n",
i_vpr_h(inst, "comv buffer: %d %d %d\n",
inst->buffers.comv.min_count,
inst->buffers.comv.size,
inst->buffers.comv.reuse);
s_vpr_h(inst->sid, "non_comv buffer: %d %d %d\n",
i_vpr_h(inst, "non_comv buffer: %d %d %d\n",
inst->buffers.non_comv.min_count,
inst->buffers.non_comv.size,
inst->buffers.non_comv.reuse);
s_vpr_h(inst->sid, "line buffer: %d %d %d\n",
i_vpr_h(inst, "line buffer: %d %d %d\n",
inst->buffers.line.min_count,
inst->buffers.line.size,
inst->buffers.line.reuse);
s_vpr_h(inst->sid, "persist buffer: %d %d %d\n",
i_vpr_h(inst, "persist buffer: %d %d %d\n",
inst->buffers.persist.min_count,
inst->buffers.persist.size,
inst->buffers.persist.reuse);
@@ -785,8 +785,8 @@ static int msm_vdec_get_output_internal_buffers(struct msm_vidc_inst *inst)
if (rc)
return rc;
s_vpr_h(inst->sid, "output internal buffer: min size reuse\n");
s_vpr_h(inst->sid, "dpb buffer: %d %d %d\n",
i_vpr_h(inst, "output internal buffer: min size reuse\n");
i_vpr_h(inst, "dpb buffer: %d %d %d\n",
inst->buffers.dpb.min_count,
inst->buffers.dpb.size,
inst->buffers.dpb.reuse);
@@ -890,7 +890,7 @@ static int msm_vdec_release_input_internal_buffers(struct msm_vidc_inst *inst)
d_vpr_e("%s: invalid params\n", __func__);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s()\n",__func__);
i_vpr_h(inst, "%s()\n",__func__);
rc = msm_vidc_release_internal_buffers(inst, MSM_VIDC_BUF_BIN);
if (rc)
@@ -919,7 +919,7 @@ static int msm_vdec_release_output_internal_buffers(struct msm_vidc_inst *inst)
d_vpr_e("%s: invalid params\n", __func__);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s()\n",__func__);
i_vpr_h(inst, "%s()\n",__func__);
rc = msm_vidc_release_internal_buffers(inst, MSM_VIDC_BUF_DPB);
if (rc)
@@ -1212,7 +1212,7 @@ int msm_vdec_input_port_settings_change(struct msm_vidc_inst *inst)
struct v4l2_event event = {0};
if (!inst->vb2q[INPUT_PORT].streaming) {
s_vpr_e(inst->sid, "%s: input port not streaming\n",
i_vpr_e(inst, "%s: input port not streaming\n",
__func__);
return 0;
}
@@ -1281,7 +1281,7 @@ int msm_vdec_streamon_input(struct msm_vidc_inst *inst)
if (is_input_meta_enabled(inst) &&
!inst->vb2q[INPUT_META_PORT].streaming) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Meta port must be streamed on before data port\n",
__func__);
return -EINVAL;
@@ -1344,7 +1344,7 @@ int msm_vdec_streamon_input(struct msm_vidc_inst *inst)
return 0;
error:
s_vpr_e(inst->sid, "%s: failed\n", __func__);
i_vpr_e(inst, "%s: failed\n", __func__);
msm_vdec_streamoff_input(inst);
return rc;
}
@@ -1483,7 +1483,7 @@ int msm_vdec_streamon_output(struct msm_vidc_inst *inst)
if (is_output_meta_enabled(inst) &&
!inst->vb2q[OUTPUT_META_PORT].streaming) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Meta port must be streamed on before data port\n",
__func__);
return -EINVAL;
@@ -1530,7 +1530,7 @@ int msm_vdec_streamon_output(struct msm_vidc_inst *inst)
return 0;
error:
s_vpr_e(inst->sid, "%s: failed\n", __func__);
i_vpr_e(inst, "%s: failed\n", __func__);
msm_vdec_streamoff_output(inst);
return rc;
}
@@ -1629,7 +1629,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
if (f->type == INPUT_MPLANE) {
if (inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat !=
f->fmt.pix_mp.pixelformat) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: codec changed from %#x to %#x\n", __func__,
inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat,
f->fmt.pix_mp.pixelformat);
@@ -1670,7 +1670,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
goto err_invalid_fmt;
//update_log_ctxt(inst->sid, inst->session_type,
// mplane->pixelformat);
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: input: codec %#x width %d height %d size %d min_count %d extra_count %d\n",
__func__, f->fmt.pix_mp.pixelformat, f->fmt.pix_mp.width,
f->fmt.pix_mp.height,
@@ -1702,7 +1702,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
inst->buffers.input_meta.actual_count = 0;
inst->buffers.input_meta.size = 0;
}
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: input meta: size %d min_count %d extra_count %d\n",
__func__, fmt->fmt.meta.buffersize,
inst->buffers.input_meta.min_count,
@@ -1748,7 +1748,7 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
//rc = msm_vidc_check_session_supported(inst);
if (rc)
goto err_invalid_fmt;
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: output: format %#x width %d height %d size %d min_count %d extra_count %d\n",
__func__, fmt->fmt.pix_mp.pixelformat, fmt->fmt.pix_mp.width,
fmt->fmt.pix_mp.height,
@@ -1776,13 +1776,13 @@ int msm_vdec_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
inst->buffers.output_meta.actual_count = 0;
inst->buffers.output_meta.size = 0;
}
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: output meta: size %d min_count %d extra_count %d\n",
__func__, fmt->fmt.meta.buffersize,
inst->buffers.output_meta.min_count,
inst->buffers.output_meta.extra_count);
} else {
s_vpr_e(inst->sid, "%s: invalid type %d\n", __func__, f->type);
i_vpr_e(inst, "%s: invalid type %d\n", __func__, f->type);
goto err_invalid_fmt;
}
memcpy(f, fmt, sizeof(struct v4l2_format));
@@ -1816,7 +1816,7 @@ int msm_vdec_s_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
d_vpr_e("%s: invalid params\n", __func__);
return -EINVAL;
}
s_vpr_e(inst->sid, "%s: unsupported\n", __func__);
i_vpr_e(inst, "%s: unsupported\n", __func__);
return -EINVAL;
}
@@ -1842,7 +1842,7 @@ int msm_vdec_g_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
s->r.height = inst->crop.height;
break;
}
s_vpr_h(inst->sid, "%s: type %d target %d, r [%d, %d, %d, %d]\n",
i_vpr_h(inst, "%s: type %d target %d, r [%d, %d, %d, %d]\n",
__func__, s->type, s->target, s->r.top, s->r.left,
s->r.width, s->r.height);
return 0;
@@ -1876,7 +1876,7 @@ int msm_vdec_s_param(struct msm_vidc_inst *inst,
}
if (!timeperframe->denominator || !timeperframe->numerator) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: invalid rate for type %u\n",
__func__, s_parm->type);
input_rate = default_rate >> 16;
@@ -1887,7 +1887,7 @@ int msm_vdec_s_param(struct msm_vidc_inst *inst,
do_div(us_per_frame, timeperframe->denominator);
if (!us_per_frame) {
s_vpr_e(inst->sid, "%s: us_per_frame is zero\n",
i_vpr_e(inst, "%s: us_per_frame is zero\n",
__func__);
rc = -EINVAL;
goto exit;
@@ -1898,7 +1898,7 @@ int msm_vdec_s_param(struct msm_vidc_inst *inst,
/* Check max allowed rate */
if (input_rate > max_rate) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Unsupported rate %u, max_fps %u, type: %u\n",
__func__, input_rate, max_rate, s_parm->type);
rc = -ENOTSUPP;
@@ -1907,7 +1907,7 @@ int msm_vdec_s_param(struct msm_vidc_inst *inst,
set_default:
q16_rate = (u32)input_rate << 16;
s_vpr_h(inst->sid, "%s: type %u value %#x\n",
i_vpr_h(inst, "%s: type %u value %#x\n",
__func__, s_parm->type, q16_rate);
if (is_frame_rate) {
@@ -1944,7 +1944,7 @@ int msm_vdec_g_param(struct msm_vidc_inst *inst,
capability->cap[OPERATING_RATE].value >> 16;
}
s_vpr_h(inst->sid, "%s: type %u, num %u denom %u\n",
i_vpr_h(inst, "%s: type %u, num %u denom %u\n",
__func__, s_parm->type, timeperframe->numerator,
timeperframe->denominator);
return 0;
@@ -2039,7 +2039,7 @@ int msm_vdec_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
}
memset(f->reserved, 0, sizeof(f->reserved));
s_vpr_h(inst->sid, "%s: index %d, %s : %#x, flags %#x, driver colorfmt %#x\n",
i_vpr_h(inst, "%s: index %d, %s : %#x, flags %#x, driver colorfmt %#x\n",
__func__, f->index, f->description, f->pixelformat, f->flags,
v4l2_colorformat_to_driver(f->pixelformat, __func__));
return rc;

View File

@@ -46,7 +46,7 @@ static int msm_venc_codec_change(struct msm_vidc_inst *inst, u32 v4l2_codec)
if (inst->codec && inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat == v4l2_codec)
return 0;
s_vpr_h(inst->sid, "%s: codec changed from %#x to %#x\n",
i_vpr_h(inst, "%s: codec changed from %#x to %#x\n",
__func__, inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, v4l2_codec);
inst->codec = v4l2_codec_to_driver(v4l2_codec, __func__);
@@ -76,14 +76,14 @@ static int msm_venc_set_colorformat(struct msm_vidc_inst *inst,
u32 hfi_colorformat;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
pixelformat = inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat;
if (pixelformat != V4L2_PIX_FMT_VIDC_NV12C &&
pixelformat != V4L2_PIX_FMT_VIDC_TP10C) {
s_vpr_e(inst->sid, "%s: invalid pixelformat %#x\n",
i_vpr_e(inst, "%s: invalid pixelformat %#x\n",
__func__, pixelformat);
return -EINVAL;
}
@@ -110,7 +110,7 @@ static int msm_venc_set_linear_alignment_factor(struct msm_vidc_inst *inst,
u32 alignment_factor[2];
if (port != INPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
@@ -118,7 +118,7 @@ static int msm_venc_set_linear_alignment_factor(struct msm_vidc_inst *inst,
if (pixelformat == V4L2_PIX_FMT_VIDC_NV12C ||
pixelformat == V4L2_PIX_FMT_VIDC_TP10C ||
pixelformat == V4L2_PIX_FMT_VIDC_ARGB32C) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: not a linear color fmt, property is not set\n",
__func__);
return 0;
@@ -138,7 +138,7 @@ static int msm_venc_set_linear_alignment_factor(struct msm_vidc_inst *inst,
uv_scanline_alignment(pixelformat, __func__);
}
s_vpr_h(inst->sid, "%s: payload[0]: %u payload[1]: %u\n", __func__,
i_vpr_h(inst, "%s: payload[0]: %u payload[1]: %u\n", __func__,
alignment_factor[0], alignment_factor[1]);
rc = venus_hfi_session_property(inst,
HFI_PROP_LINEAR_ALIGNMENT_FACTOR,
@@ -160,12 +160,12 @@ static int msm_venc_set_raw_resolution(struct msm_vidc_inst *inst,
u32 resolution;
if (port != INPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
resolution = inst->crop.width << 16 | inst->crop.height;
s_vpr_h(inst->sid, "%s: width: %d height: %d\n", __func__,
i_vpr_h(inst, "%s: width: %d height: %d\n", __func__,
inst->crop.width, inst->crop.height);
rc = venus_hfi_session_property(inst,
HFI_PROP_RAW_RESOLUTION,
@@ -186,13 +186,13 @@ static int msm_venc_set_bitstream_resolution(struct msm_vidc_inst *inst,
u32 resolution;
if (port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
resolution = (inst->fmts[port].fmt.pix_mp.width << 16) |
inst->fmts[port].fmt.pix_mp.height;
s_vpr_h(inst->sid, "%s: width: %d height: %d\n", __func__,
i_vpr_h(inst, "%s: width: %d height: %d\n", __func__,
inst->fmts[port].fmt.pix_mp.width,
inst->fmts[port].fmt.pix_mp.height);
rc = venus_hfi_session_property(inst,
@@ -215,7 +215,7 @@ static int msm_venc_set_crop_offsets(struct msm_vidc_inst *inst,
u64 crop;
if (port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
@@ -228,7 +228,7 @@ static int msm_venc_set_crop_offsets(struct msm_vidc_inst *inst,
crop = (u64)right_offset << 48 | (u64)bottom_offset << 32 |
(u64)left_offset << 16 | top_offset;
s_vpr_h(inst->sid, "%s: left_offset: %d top_offset: %d "
i_vpr_h(inst, "%s: left_offset: %d top_offset: %d "
"right_offset: %d bottom_offset: %d", __func__,
left_offset, top_offset, right_offset, bottom_offset);
@@ -251,11 +251,11 @@ static int msm_venc_set_host_max_buf_count(struct msm_vidc_inst *inst,
u32 count = DEFAULT_MAX_HOST_BUF_COUNT;
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s: count: %u port: %u\n", __func__, count, port);
i_vpr_h(inst, "%s: count: %u port: %u\n", __func__, count, port);
rc = venus_hfi_session_property(inst,
HFI_PROP_BUFFER_HOST_MAX_COUNT,
HFI_HOST_FLAGS_NONE,
@@ -277,13 +277,13 @@ static int msm_venc_set_stage(struct msm_vidc_inst *inst)
rc = call_session_op(core, decide_work_mode, inst);
if (rc) {
s_vpr_e(inst->sid, "%s: decide_work_mode failed\n",
i_vpr_e(inst, "%s: decide_work_mode failed\n",
__func__);
return -EINVAL;
}
stage = capability->cap[STAGE].value;
s_vpr_h(inst->sid, "%s: stage: %u\n", __func__, stage);
i_vpr_h(inst, "%s: stage: %u\n", __func__, stage);
rc = venus_hfi_session_property(inst,
HFI_PROP_STAGE,
HFI_HOST_FLAGS_NONE,
@@ -305,13 +305,13 @@ static int msm_venc_set_pipe(struct msm_vidc_inst *inst)
rc = call_session_op(core, decide_work_route, inst);
if (rc) {
s_vpr_e(inst->sid, "%s: decide_work_route failed\n",
i_vpr_e(inst, "%s: decide_work_route failed\n",
__func__);
return -EINVAL;
}
pipe = capability->cap[PIPE].value;
s_vpr_h(inst->sid, "%s: pipe: %u\n", __func__, pipe);
i_vpr_h(inst, "%s: pipe: %u\n", __func__, pipe);
rc = venus_hfi_session_property(inst,
HFI_PROP_PIPE,
HFI_HOST_FLAGS_NONE,
@@ -333,13 +333,13 @@ static int msm_venc_set_quality_mode(struct msm_vidc_inst *inst)
rc = call_session_op(core, decide_quality_mode, inst);
if (rc) {
s_vpr_e(inst->sid, "%s: decide_work_route failed\n",
i_vpr_e(inst, "%s: decide_work_route failed\n",
__func__);
return -EINVAL;
}
mode = capability->cap[QUALITY_MODE].value;
s_vpr_h(inst->sid, "%s: quality_mode: %u\n", __func__, mode);
i_vpr_h(inst, "%s: quality_mode: %u\n", __func__, mode);
rc = venus_hfi_session_property(inst,
HFI_PROP_QUALITY_MODE,
HFI_HOST_FLAGS_NONE,
@@ -467,8 +467,8 @@ static int msm_venc_get_input_internal_buffers(struct msm_vidc_inst *inst)
inst->buffers.dpb.min_count = call_session_op(core, min_count,
inst, MSM_VIDC_BUF_VPSS);
s_vpr_h(inst->sid, "%s: internal buffer: min size\n", __func__);
s_vpr_h(inst->sid, "vpss buffer: %d %d\n",
i_vpr_h(inst, "%s: internal buffer: min size\n", __func__);
i_vpr_h(inst, "vpss buffer: %d %d\n",
inst->buffers.vpss.min_count,
inst->buffers.vpss.size);
*/
@@ -541,20 +541,20 @@ static int msm_venc_get_output_internal_buffers(struct msm_vidc_inst *inst)
if (rc)
return rc;
s_vpr_h(inst->sid, "internal buffer: min size\n");
s_vpr_h(inst->sid, "bin buffer: %d %d\n",
i_vpr_h(inst, "internal buffer: min size\n");
i_vpr_h(inst, "bin buffer: %d %d\n",
inst->buffers.bin.min_count,
inst->buffers.bin.size);
s_vpr_h(inst->sid, "comv buffer: %d %d\n",
i_vpr_h(inst, "comv buffer: %d %d\n",
inst->buffers.comv.min_count,
inst->buffers.comv.size);
s_vpr_h(inst->sid, "non_comv buffer: %d %d\n",
i_vpr_h(inst, "non_comv buffer: %d %d\n",
inst->buffers.non_comv.min_count,
inst->buffers.non_comv.size);
s_vpr_h(inst->sid, "line buffer: %d %d\n",
i_vpr_h(inst, "line buffer: %d %d\n",
inst->buffers.line.min_count,
inst->buffers.line.size);
s_vpr_h(inst->sid, "dpb buffer: %d %d\n",
i_vpr_h(inst, "dpb buffer: %d %d\n",
inst->buffers.dpb.min_count,
inst->buffers.dpb.size);
@@ -647,7 +647,7 @@ static int msm_venc_property_subscription(struct msm_vidc_inst *inst,
payload_size = (ARRAY_SIZE(msm_venc_output_subscribe_for_properties) + 1) *
sizeof(u32);
} else {
s_vpr_e(inst->sid, "%s: invalid port: %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port: %d\n", __func__, port);
return -EINVAL;
}
@@ -782,7 +782,7 @@ int msm_venc_streamon_input(struct msm_vidc_inst *inst)
if (is_input_meta_enabled(inst) &&
!inst->vb2q[INPUT_META_PORT].streaming) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Meta port must be streamed on before data port\n",
__func__);
return -EINVAL;
@@ -829,7 +829,7 @@ int msm_venc_streamon_input(struct msm_vidc_inst *inst)
return 0;
error:
s_vpr_e(inst->sid, "%s: failed\n", __func__);
i_vpr_e(inst, "%s: failed\n", __func__);
msm_venc_streamoff_input(inst);
return rc;
}
@@ -911,7 +911,7 @@ int msm_venc_streamon_output(struct msm_vidc_inst *inst)
if (is_output_meta_enabled(inst) &&
!inst->vb2q[OUTPUT_META_PORT].streaming) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Meta port must be streamed on before data port\n",
__func__);
return -EINVAL;
@@ -960,7 +960,7 @@ int msm_venc_streamon_output(struct msm_vidc_inst *inst)
return 0;
error:
s_vpr_e(inst->sid, "%s: failed\n", __func__);
i_vpr_e(inst, "%s: failed\n", __func__);
msm_venc_streamoff_output(inst);
return rc;
}
@@ -1041,7 +1041,7 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
goto err_invalid_fmt;
//update_log_ctxt(inst->sid, inst->session_type,
// mplane->pixelformat);
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: input: codec %#x width %d height %d size %d min_count %d extra_count %d\n",
__func__, f->fmt.pix_mp.pixelformat, f->fmt.pix_mp.width,
f->fmt.pix_mp.height,
@@ -1073,7 +1073,7 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
inst->buffers.input_meta.actual_count = 0;
inst->buffers.input_meta.size = 0;
}
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: input meta: size %d min_count %d extra_count %d\n",
__func__, fmt->fmt.meta.buffersize,
inst->buffers.input_meta.min_count,
@@ -1081,7 +1081,7 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
} else if (f->type == OUTPUT_MPLANE) {
fmt = &inst->fmts[OUTPUT_PORT];
if (fmt->fmt.pix_mp.pixelformat != f->fmt.pix_mp.pixelformat) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: codec changed from %#x to %#x\n", __func__,
fmt->fmt.pix_mp.pixelformat, f->fmt.pix_mp.pixelformat);
rc = msm_venc_codec_change(inst, f->fmt.pix_mp.pixelformat);
@@ -1121,7 +1121,7 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
//update_log_ctxt(inst->sid, inst->session_type,
// mplane->pixelformat);
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: output: format %#x width %d height %d size %d min_count %d extra_count %d\n",
__func__, fmt->fmt.pix_mp.pixelformat, fmt->fmt.pix_mp.width,
fmt->fmt.pix_mp.height,
@@ -1149,13 +1149,13 @@ int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
inst->buffers.output_meta.actual_count = 0;
inst->buffers.output_meta.size = 0;
}
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: output meta: size %d min_count %d extra_count %d\n",
__func__, fmt->fmt.meta.buffersize,
inst->buffers.output_meta.min_count,
inst->buffers.output_meta.extra_count);
} else {
s_vpr_e(inst->sid, "%s: invalid type %d\n", __func__, f->type);
i_vpr_e(inst, "%s: invalid type %d\n", __func__, f->type);
goto err_invalid_fmt;
}
memcpy(f, fmt, sizeof(struct v4l2_format));
@@ -1193,7 +1193,7 @@ int msm_venc_s_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
return -EINVAL;
}
if (s->type != INPUT_MPLANE && s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
s_vpr_e(inst->sid, "%s: invalid type %d\n", __func__, s->type);
i_vpr_e(inst, "%s: invalid type %d\n", __func__, s->type);
return -EINVAL;
}
@@ -1204,20 +1204,20 @@ int msm_venc_s_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
codec_align = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat ==
V4L2_PIX_FMT_HEVC ? 32 : 16;
if (s->r.left || s->r.top) {
s_vpr_h(inst->sid, "%s: unsupported top %d or left %d\n",
i_vpr_h(inst, "%s: unsupported top %d or left %d\n",
__func__, s->r.left, s->r.top);
s->r.left = s->r.top = 0;
}
if (s->r.width > inst->fmts[OUTPUT_PORT].fmt.pix_mp.width ||
ALIGN(s->r.width, codec_align) != inst->fmts[OUTPUT_PORT].fmt.pix_mp.width) {
s_vpr_h(inst->sid, "%s: unsupported width %d, fmt width %d\n",
i_vpr_h(inst, "%s: unsupported width %d, fmt width %d\n",
__func__, s->r.width,
inst->fmts[OUTPUT_PORT].fmt.pix_mp.width);
s->r.width = inst->fmts[OUTPUT_PORT].fmt.pix_mp.width;
}
if (s->r.height > inst->fmts[OUTPUT_PORT].fmt.pix_mp.height ||
ALIGN(s->r.height, codec_align) != inst->fmts[OUTPUT_PORT].fmt.pix_mp.height) {
s_vpr_h(inst->sid, "%s: unsupported height %d, fmt height %d\n",
i_vpr_h(inst, "%s: unsupported height %d, fmt height %d\n",
__func__, s->r.height,
inst->fmts[OUTPUT_PORT].fmt.pix_mp.height);
s->r.height = inst->fmts[OUTPUT_PORT].fmt.pix_mp.height;
@@ -1242,25 +1242,25 @@ int msm_venc_s_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
case V4L2_SEL_TGT_COMPOSE_DEFAULT:
case V4L2_SEL_TGT_COMPOSE:
if (s->r.left < inst->crop.left) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: compose left (%d) less than crop left (%d)\n",
__func__, s->r.left, inst->crop.left);
s->r.left = inst->crop.left;
}
if (s->r.top < inst->crop.top) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: compose top (%d) less than crop top (%d)\n",
__func__, s->r.top, inst->crop.top);
s->r.top = inst->crop.top;
}
if (s->r.width > inst->crop.width) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: compose width (%d) greate than crop width (%d)\n",
__func__, s->r.width, inst->crop.width);
s->r.width = inst->crop.width;
}
if (s->r.height > inst->crop.height) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: compose height (%d) greate than crop height (%d)\n",
__func__, s->r.height, inst->crop.height);
s->r.height = inst->crop.height;
@@ -1271,13 +1271,13 @@ int msm_venc_s_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
inst->compose.height= s->r.height;
break;
default:
s_vpr_e(inst->sid, "%s: invalid target %d\n",
i_vpr_e(inst, "%s: invalid target %d\n",
__func__, s->target);
rc = -EINVAL;
break;
}
if (!rc)
s_vpr_h(inst->sid, "%s: target %d, r [%d, %d, %d, %d]\n",
i_vpr_h(inst, "%s: target %d, r [%d, %d, %d, %d]\n",
__func__, s->target, s->r.top, s->r.left,
s->r.width, s->r.height);
return rc;
@@ -1292,7 +1292,7 @@ int msm_venc_g_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
return -EINVAL;
}
if (s->type != INPUT_MPLANE && s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
s_vpr_e(inst->sid, "%s: invalid type %d\n", __func__, s->type);
i_vpr_e(inst, "%s: invalid type %d\n", __func__, s->type);
return -EINVAL;
}
@@ -1315,13 +1315,13 @@ int msm_venc_g_selection(struct msm_vidc_inst* inst, struct v4l2_selection* s)
s->r.height = inst->compose.height;
break;
default:
s_vpr_e(inst->sid, "%s: invalid target %d\n",
i_vpr_e(inst, "%s: invalid target %d\n",
__func__, s->target);
rc = -EINVAL;
break;
}
if (!rc)
s_vpr_h(inst->sid, "%s: target %d, r [%d, %d, %d, %d]\n",
i_vpr_h(inst, "%s: target %d, r [%d, %d, %d, %d]\n",
__func__, s->target, s->r.top, s->r.left,
s->r.width, s->r.height);
return rc;
@@ -1355,7 +1355,7 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
}
if (!timeperframe->denominator || !timeperframe->numerator) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: invalid rate for type %u\n",
__func__, s_parm->type);
input_rate = default_rate >> 16;
@@ -1366,7 +1366,7 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
do_div(us_per_frame, timeperframe->denominator);
if (!us_per_frame) {
s_vpr_e(inst->sid, "%s: us_per_frame is zero\n",
i_vpr_e(inst, "%s: us_per_frame is zero\n",
__func__);
rc = -EINVAL;
goto exit;
@@ -1377,7 +1377,7 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
/* Check max allowed rate */
if (input_rate > max_rate) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Unsupported rate %u, max_fps %u, type: %u\n",
__func__, input_rate, max_rate, s_parm->type);
rc = -ENOTSUPP;
@@ -1386,7 +1386,7 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
set_default:
q16_rate = (u32)input_rate << 16;
s_vpr_h(inst->sid, "%s: type %u value %#x\n",
i_vpr_h(inst, "%s: type %u value %#x\n",
__func__, s_parm->type, q16_rate);
if (!is_frame_rate) {
@@ -1411,7 +1411,7 @@ set_default:
&q16_rate,
sizeof(u32));
if (rc) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: failed to set frame rate to fw\n",
__func__);
goto exit;
@@ -1446,7 +1446,7 @@ int msm_venc_g_param(struct msm_vidc_inst *inst,
capability->cap[FRAME_RATE].value >> 16;
}
s_vpr_h(inst->sid, "%s: type %u, num %u denom %u\n",
i_vpr_h(inst, "%s: type %u, num %u denom %u\n",
__func__, s_parm->type, timeperframe->numerator,
timeperframe->denominator);
return 0;
@@ -1510,7 +1510,7 @@ int msm_venc_enum_fmt(struct msm_vidc_inst *inst, struct v4l2_fmtdesc *f)
}
memset(f->reserved, 0, sizeof(f->reserved));
s_vpr_h(inst->sid, "%s: index %d, %s : %#x, flags %#x, driver colorfmt %#x\n",
i_vpr_h(inst, "%s: index %d, %s : %#x, flags %#x, driver colorfmt %#x\n",
__func__, f->index, f->description, f->pixelformat, f->flags,
v4l2_colorformat_to_driver(f->pixelformat, __func__));
return rc;

View File

@@ -70,7 +70,7 @@ int msm_vidc_poll(void *instance, struct file *filp,
return -EINVAL;
}
if (inst->state == MSM_VIDC_ERROR) {
s_vpr_e(inst->sid, "%s: inst in error state\n", __func__);
i_vpr_e(inst, "%s: inst in error state\n", __func__);
return -EINVAL;
}
@@ -156,7 +156,7 @@ int msm_vidc_query_ctrl(void *instance, struct v4l2_queryctrl *q_ctrl)
ctrl = v4l2_ctrl_find(&inst->ctrl_handler, q_ctrl->id);
if (!ctrl) {
s_vpr_e(inst->sid, "%s: get_ctrl failed for id %d\n",
i_vpr_e(inst, "%s: get_ctrl failed for id %d\n",
__func__, q_ctrl->id);
return -EINVAL;
}
@@ -165,7 +165,7 @@ int msm_vidc_query_ctrl(void *instance, struct v4l2_queryctrl *q_ctrl)
q_ctrl->default_value = ctrl->default_value;
q_ctrl->flags = 0;
q_ctrl->step = ctrl->step;
s_vpr_h(inst->sid,
i_vpr_h(inst,
"query ctrl: %s: min %d, max %d, default %d step %d flags %#x\n",
ctrl->name, q_ctrl->minimum, q_ctrl->maximum,
q_ctrl->default_value, q_ctrl->step, q_ctrl->flags);
@@ -187,12 +187,12 @@ int msm_vidc_query_menu(void *instance, struct v4l2_querymenu *qmenu)
ctrl = v4l2_ctrl_find(&inst->ctrl_handler, qmenu->id);
if (!ctrl) {
s_vpr_e(inst->sid, "%s: get_ctrl failed for id %d\n",
i_vpr_e(inst, "%s: get_ctrl failed for id %d\n",
__func__, qmenu->id);
return -EINVAL;
}
if (ctrl->type != V4L2_CTRL_TYPE_MENU) {
s_vpr_e(inst->sid, "%s: ctrl: %s: type (%d) is not MENU type\n",
i_vpr_e(inst, "%s: ctrl: %s: type (%d) is not MENU type\n",
__func__, ctrl->name, ctrl->type);
return -EINVAL;
}
@@ -202,7 +202,7 @@ int msm_vidc_query_menu(void *instance, struct v4l2_querymenu *qmenu)
if (ctrl->menu_skip_mask & (1 << qmenu->index))
rc = -EINVAL;
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: ctrl: %s: min %d, max %d, menu_skip_mask %#x, qmenu: id %d, index %d, %s\n",
__func__, ctrl->name, ctrl->minimum, ctrl->maximum,
ctrl->menu_skip_mask, qmenu->id, qmenu->index,
@@ -230,7 +230,7 @@ int msm_vidc_s_fmt(void *instance, struct v4l2_format *f)
rc = msm_venc_s_fmt(inst, f);
if (rc)
s_vpr_e(inst->sid, "%s: s_fmt(%d) failed %d\n",
i_vpr_e(inst, "%s: s_fmt(%d) failed %d\n",
__func__, f->type, rc);
return rc;
}
@@ -254,12 +254,12 @@ int msm_vidc_g_fmt(void *instance, struct v4l2_format *f)
return rc;
if (f->type == INPUT_MPLANE || f->type == OUTPUT_MPLANE)
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: type %d format %#x width %d height %d size %d\n",
__func__, f->type, f->fmt.pix_mp.pixelformat, f->fmt.pix_mp.width,
f->fmt.pix_mp.height, f->fmt.pix_mp.plane_fmt[0].sizeimage);
else if (f->type == INPUT_META_PLANE || f->type == OUTPUT_META_PLANE)
s_vpr_h(inst->sid, "%s: meta type %d size %d\n",
i_vpr_h(inst, "%s: meta type %d size %d\n",
__func__, f->type, f->fmt.meta.buffersize);
return 0;
}
@@ -380,10 +380,10 @@ int msm_vidc_g_ctrl(void *instance, struct v4l2_control *control)
control->value = ctrl->val;
}
if (rc)
s_vpr_e(inst->sid, "%s: failed for control id %#x\n",
i_vpr_e(inst, "%s: failed for control id %#x\n",
__func__, control->id);
else
s_vpr_h(inst->sid, "%s: control id %#x, value %d\n",
i_vpr_h(inst, "%s: control id %#x, value %d\n",
__func__, control->id, control->value);
return rc;
}
@@ -415,7 +415,7 @@ int msm_vidc_reqbufs(void *instance, struct v4l2_requestbuffers *b)
rc = vb2_reqbufs(&inst->vb2q[port], b);
if (rc) {
s_vpr_e(inst->sid, "%s: vb2_reqbufs(%d) failed, %d\n",
i_vpr_e(inst, "%s: vb2_reqbufs(%d) failed, %d\n",
__func__, b->type, rc);
goto unlock;
}
@@ -453,7 +453,7 @@ int msm_vidc_qbuf(void *instance, struct media_device *mdev,
rc = vb2_qbuf(q, mdev, b);
if (rc)
s_vpr_e(inst->sid, "%s: failed with %d\n", __func__, rc);
i_vpr_e(inst, "%s: failed with %d\n", __func__, rc);
unlock:
mutex_unlock(&inst->lock);
@@ -484,7 +484,7 @@ int msm_vidc_dqbuf(void *instance, struct v4l2_buffer *b)
if (rc == -EAGAIN) {
goto unlock;
} else if (rc) {
s_vpr_e(inst->sid, "%s: failed with %d\n", __func__, rc);
i_vpr_e(inst, "%s: failed with %d\n", __func__, rc);
goto unlock;
}
@@ -523,7 +523,7 @@ int msm_vidc_streamon(void *instance, enum v4l2_buf_type type)
rc = vb2_streamon(&inst->vb2q[port], type);
if (rc) {
s_vpr_e(inst->sid, "%s: vb2_streamon(%d) failed, %d\n",
i_vpr_e(inst, "%s: vb2_streamon(%d) failed, %d\n",
__func__, type, rc);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
goto unlock;
@@ -564,7 +564,7 @@ int msm_vidc_streamoff(void *instance, enum v4l2_buf_type type)
rc = vb2_streamoff(&inst->vb2q[port], type);
if (rc) {
s_vpr_e(inst->sid, "%s: vb2_streamoff(%d) failed, %d\n",
i_vpr_e(inst, "%s: vb2_streamoff(%d) failed, %d\n",
__func__, type, rc);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
goto unlock;
@@ -606,7 +606,7 @@ int msm_vidc_enum_framesizes(void *instance, struct v4l2_frmsizeenum *fsize)
return -EINVAL;
}
if (!inst->capabilities) {
s_vpr_e(inst->sid, "capabilities not available\n", __func__);
i_vpr_e(inst, "capabilities not available\n", __func__);
return -EINVAL;
}
capability = inst->capabilities;
@@ -634,11 +634,11 @@ int msm_vidc_subscribe_event(void *instance,
d_vpr_e("%s: invalid params\n", __func__);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s: type %d id %d\n", __func__, sub->type, sub->id);
i_vpr_h(inst, "%s: type %d id %d\n", __func__, sub->type, sub->id);
rc = v4l2_event_subscribe(&inst->event_handler,
sub, MAX_EVENTS, NULL);
if (rc)
s_vpr_e(inst->sid, "%s: fialed, type %d id %d\n",
i_vpr_e(inst, "%s: fialed, type %d id %d\n",
__func__, sub->type, sub->id);
return rc;
}
@@ -654,10 +654,10 @@ int msm_vidc_unsubscribe_event(void *instance,
d_vpr_e("%s: invalid params\n", __func__);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s: type %d id %d\n", __func__, sub->type, sub->id);
i_vpr_h(inst, "%s: type %d id %d\n", __func__, sub->type, sub->id);
rc = v4l2_event_unsubscribe(&inst->event_handler, sub);
if (rc)
s_vpr_e(inst->sid, "%s: fialed, type %d id %d\n",
i_vpr_e(inst, "%s: fialed, type %d id %d\n",
__func__, sub->type, sub->id);
return rc;
}
@@ -674,7 +674,7 @@ int msm_vidc_dqevent(void *instance, struct v4l2_event *event)
}
rc = v4l2_event_dequeue(&inst->event_handler, event, false);
if (rc)
s_vpr_e(inst->sid, "%s: fialed\n", __func__);
i_vpr_e(inst, "%s: fialed\n", __func__);
return rc;
}
EXPORT_SYMBOL(msm_vidc_dqevent);
@@ -718,7 +718,7 @@ void *msm_vidc_open(void *vidc_core, u32 session_type)
d_vpr_e("%s: failed to get session id\n", __func__);
goto error;
}
s_vpr_e(inst->sid, "Opening video instance: %d\n", session_type);
i_vpr_e(inst, "Opening video instance: %d\n", session_type);
inst->response_workq = create_singlethread_workqueue("response_workq");
if (!inst->response_workq) {
@@ -729,7 +729,7 @@ void *msm_vidc_open(void *vidc_core, u32 session_type)
inst->capabilities = kzalloc(
sizeof(struct msm_vidc_inst_capability), GFP_KERNEL);
if (!inst->capabilities) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: inst capability allocation failed\n", __func__);
goto error;
}
@@ -805,7 +805,7 @@ void *msm_vidc_open(void *vidc_core, u32 session_type)
inst->debugfs_root =
msm_vidc_debugfs_init_inst(inst, core->debugfs_root);
if (!inst->debugfs_root)
s_vpr_h(inst->sid, "%s: debugfs not available\n", __func__);
i_vpr_h(inst, "%s: debugfs not available\n", __func__);
return inst;
@@ -828,7 +828,7 @@ int msm_vidc_close(void *instance)
core = inst->core;
s_vpr_h(inst->sid, "%s()\n", __func__);
i_vpr_h(inst, "%s()\n", __func__);
mutex_lock(&inst->lock);
msm_vidc_session_close(inst);
msm_vidc_remove_session(inst);

View File

@@ -26,7 +26,7 @@ u32 msm_vidc_input_min_count(struct msm_vidc_inst* inst)
} else if (is_encode_session(inst)) {
input_min_count = MIN_ENC_INPUT_BUFFERS;
} else {
s_vpr_e(inst->sid, "%s: invalid domain\n",
i_vpr_e(inst, "%s: invalid domain\n",
__func__, inst->domain);
return 0;
}
@@ -180,7 +180,7 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
inst->capabilities->cap[BITSTREAM_SIZE_OVERWRITE].value;
if (bitstream_size_overwrite) {
frame_size = bitstream_size_overwrite;
s_vpr_h(inst->sid, "client configured bitstream buffer size %d\n",
i_vpr_h(inst, "client configured bitstream buffer size %d\n",
frame_size);
return frame_size;
}
@@ -223,7 +223,7 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_HEVC)
frame_size = frame_size + (frame_size >> 2);
s_vpr_h(inst->sid, "set input buffer size to %d\n", frame_size);
i_vpr_h(inst, "set input buffer size to %d\n", frame_size);
return ALIGN(frame_size, SZ_4K);
}

View File

@@ -89,7 +89,7 @@ static u32 msm_vidc_get_port_info(struct msm_vidc_inst *inst,
if (capability->cap[cap_id].flags & CAP_FLAG_INPUT_PORT &&
capability->cap[cap_id].flags & CAP_FLAG_OUTPUT_PORT) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: both ports enabled. Default port set: BITSTREAM\n",
__func__);
return HFI_PORT_BITSTREAM;
@@ -113,13 +113,13 @@ static const char * const * msm_vidc_get_qmenu_type(
case V4L2_CID_MPEG_VIDC_VIDEO_BLUR_TYPES:
return mpeg_video_blur_types;
default:
s_vpr_e(inst->sid, "%s: No available qmenu for ctrl %#x\n",
i_vpr_e(inst, "%s: No available qmenu for ctrl %#x\n",
__func__, control_id);
return NULL;
}
}
static const char *msm_vidc_get_priv_ctrl_name(u32 sid, u32 control_id)
static const char *msm_vidc_get_priv_ctrl_name(struct msm_vidc_inst *inst, u32 control_id)
{
switch (control_id) {
case V4L2_CID_MPEG_VIDC_SECURE:
@@ -205,7 +205,7 @@ static const char *msm_vidc_get_priv_ctrl_name(u32 sid, u32 control_id)
case V4L2_CID_MPEG_VIDC_HEVC_P_FRAME_MAX_QP:
return "HEVC P Frame Max QP";
default:
s_vpr_e(sid, "%s: ctrl name not available for ctrl id %#x\n",
i_vpr_e(inst, "%s: ctrl name not available for ctrl id %#x\n",
__func__, control_id);
return NULL;
}
@@ -217,7 +217,7 @@ static int msm_vidc_packetize_control(struct msm_vidc_inst *inst,
{
int rc = 0;
s_vpr_l(inst->sid,
i_vpr_l(inst,
"%s: hfi_id: %#x, value: %#x\n", func,
inst->capabilities->cap[cap_id].hfi_id,
*(s64 *)hfi_val);
@@ -230,7 +230,7 @@ static int msm_vidc_packetize_control(struct msm_vidc_inst *inst,
hfi_val,
sizeof(payload_size));
if (rc)
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: failed to set cap_id: %d to fw\n",
__func__, cap_id);
@@ -266,7 +266,7 @@ static int msm_vidc_add_capid_to_list(struct msm_vidc_inst *inst,
if (type & FW_LIST) {
list_for_each_entry(curr_node, &inst->firmware.list, list) {
if (curr_node->cap_id == cap_id) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: cap %d cannot be the child of two parents\n",
__func__, cap_id);
return 0;
@@ -276,7 +276,7 @@ static int msm_vidc_add_capid_to_list(struct msm_vidc_inst *inst,
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
if (!entry) {
s_vpr_e(inst->sid, "%s: alloc failed\n", __func__);
i_vpr_e(inst, "%s: alloc failed\n", __func__);
return -ENOMEM;
}
entry->cap_id = cap_id;
@@ -328,7 +328,7 @@ static int msm_vidc_update_cap_value(struct msm_vidc_inst* inst, u32 cap,
s32 adjusted_val, const char *func)
{
if (inst->capabilities->cap[cap].value != adjusted_val)
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: updated database value from %#x to %#x\n",
func, inst->capabilities->cap[cap].value,
adjusted_val);
@@ -349,7 +349,7 @@ static int msm_vidc_get_parent_value(struct msm_vidc_inst* inst,
else
*value = inst->capabilities->cap[parent].value;
} else {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: missing parent %d for cap %d, please correct database\n",
func, parent, cap);
rc = -EINVAL;
@@ -367,7 +367,7 @@ static int msm_vidc_adjust_hevc_qp(struct msm_vidc_inst *inst,
capability = inst->capabilities;
if (inst->codec != MSM_VIDC_HEVC) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: incorrect entry in database for cap %d. fix the database\n",
__func__, cap_id);
return -EINVAL;
@@ -449,7 +449,7 @@ static int msm_vidc_adjust_dynamic_property(struct msm_vidc_inst *inst,
* adjustment is allowed for its children.
*/
if (!(capability->cap[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: dynamic setting of cap_id %d is not allowed\n",
__func__, cap_id);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
@@ -461,7 +461,7 @@ static int msm_vidc_adjust_dynamic_property(struct msm_vidc_inst *inst,
* must have an adjust function defined
*/
if (!ctrl && !capability->cap[cap_id].adjust) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: child cap %d must have ajdust function\n",
__func__, capability->cap[cap_id].cap);
return -EINVAL;
@@ -500,7 +500,7 @@ int msm_vidc_ctrl_deinit(struct msm_vidc_inst *inst)
d_vpr_e("%s: invalid parameters\n", __func__);
return -EINVAL;
}
s_vpr_h(inst->sid, "%s(): num ctrls %d\n", __func__, inst->num_ctrls);
i_vpr_h(inst, "%s(): num ctrls %d\n", __func__, inst->num_ctrls);
v4l2_ctrl_handler_free(&inst->ctrl_handler);
kfree(inst->ctrls);
@@ -524,7 +524,7 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
capability = inst->capabilities;
if (!core->v4l2_ctrl_ops) {
s_vpr_e(inst->sid, "%s: no control ops\n", __func__);
i_vpr_e(inst, "%s: no control ops\n", __func__);
return -EINVAL;
}
@@ -533,20 +533,20 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
num_ctrls++;
}
if (!num_ctrls) {
s_vpr_e(inst->sid, "%s: no ctrls available in cap database\n",
i_vpr_e(inst, "%s: no ctrls available in cap database\n",
__func__);
return -EINVAL;
}
inst->ctrls = kcalloc(num_ctrls,
sizeof(struct v4l2_ctrl *), GFP_KERNEL);
if (!inst->ctrls) {
s_vpr_e(inst->sid, "%s: failed to allocate ctrl\n", __func__);
i_vpr_e(inst, "%s: failed to allocate ctrl\n", __func__);
return -ENOMEM;
}
rc = v4l2_ctrl_handler_init(&inst->ctrl_handler, num_ctrls);
if (rc) {
s_vpr_e(inst->sid, "control handler init failed, %d\n",
i_vpr_e(inst, "control handler init failed, %d\n",
inst->ctrl_handler.error);
return rc;
}
@@ -558,13 +558,13 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
continue;
if (ctrl_idx >= num_ctrls) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: invalid ctrl %#x, max allowed %d\n",
__func__, capability->cap[idx].v4l2_id,
num_ctrls);
return -EINVAL;
}
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: cap idx %d, value %d min %d max %d step_or_mask %#x flags %#x v4l2_id %#x hfi_id %#x\n",
__func__, idx,
capability->cap[idx].value,
@@ -598,10 +598,10 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
ctrl_cfg.step =
capability->cap[idx].step_or_mask;
}
ctrl_cfg.name = msm_vidc_get_priv_ctrl_name(inst->sid,
ctrl_cfg.name = msm_vidc_get_priv_ctrl_name(inst,
capability->cap[idx].v4l2_id);
if (!ctrl_cfg.name) {
s_vpr_e(inst->sid, "%s: %#x ctrl name is null\n",
i_vpr_e(inst, "%s: %#x ctrl name is null\n",
__func__, ctrl_cfg.id);
return -EINVAL;
}
@@ -627,14 +627,14 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
}
}
if (!ctrl) {
s_vpr_e(inst->sid, "%s: invalid ctrl %#x\n", __func__,
i_vpr_e(inst, "%s: invalid ctrl %#x\n", __func__,
capability->cap[idx].v4l2_id);
return -EINVAL;
}
rc = inst->ctrl_handler.error;
if (rc) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"error adding ctrl (%#x) to ctrl handle, %d\n",
capability->cap[idx].v4l2_id,
inst->ctrl_handler.error);
@@ -650,7 +650,7 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
ctrl_idx++;
}
inst->num_ctrls = num_ctrls;
s_vpr_h(inst->sid, "%s(): num ctrls %d\n", __func__, inst->num_ctrls);
i_vpr_h(inst, "%s(): num ctrls %d\n", __func__, inst->num_ctrls);
return rc;
}
@@ -677,19 +677,19 @@ int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl)
}
if (inst->state == MSM_VIDC_ERROR) {
s_vpr_e(inst->sid, "%s: set ctrl not allowed in error state\n");
i_vpr_e(inst, "%s: set ctrl not allowed in error state\n");
/* (error name TBD); */
return -EINVAL;
}
capability = inst->capabilities;
s_vpr_h(inst->sid, "%s: state %d, name %s, id 0x%x value %d\n",
i_vpr_h(inst, "%s: state %d, name %s, id 0x%x value %d\n",
__func__, inst->state, ctrl->name, ctrl->id, ctrl->val);
cap_id = msm_vidc_get_cap_id(inst, ctrl->id);
if (cap_id == INST_CAP_NONE) {
s_vpr_e(inst->sid, "%s: could not find cap_id for ctrl %s\n",
i_vpr_e(inst, "%s: could not find cap_id for ctrl %s\n",
__func__, ctrl->name);
return -EINVAL;
}
@@ -708,7 +708,7 @@ int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl)
/* check if dynamic adjustment is allowed */
if (inst->vb2q[OUTPUT_PORT].streaming &&
!(capability->cap[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: dynamic setting of cap_id %d is not allowed\n",
__func__, cap_id);
return -EBUSY;
@@ -736,7 +736,7 @@ int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl)
/* Dynamic set control ASAP */
rc = msm_vidc_set_v4l2_properties(inst);
if (rc) {
s_vpr_e(inst->sid, "%s: setting %s failed\n",
i_vpr_e(inst, "%s: setting %s failed\n",
__func__, ctrl->name);
goto exit;
}
@@ -763,7 +763,7 @@ int msm_vidc_adjust_entropy_mode(void *instance, struct v4l2_ctrl *ctrl)
capability->cap[ENTROPY_MODE].value;
if (inst->codec != MSM_VIDC_H264) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: incorrect entry in database. fix the database\n",
__func__);
return 0;
@@ -826,7 +826,7 @@ int msm_vidc_adjust_bitrate_mode(void *instance, struct v4l2_ctrl *ctrl)
update:
inst->hfi_rc_type = hfi_value;
s_vpr_h(inst->sid, "%s: hfi rc type: %#x\n",
i_vpr_h(inst, "%s: hfi rc type: %#x\n",
__func__, inst->hfi_rc_type);
return 0;
@@ -925,7 +925,7 @@ int msm_vidc_adjust_use_ltr(void *instance, struct v4l2_ctrl *ctrl)
} else if (adjusted_value <= 0 ||
adjusted_value >= (1 << ltr_count)) {
/* USE_LTR value should be > 0 and < (2 ^ LTR_COUNT) */
s_vpr_e(inst->sid, "%s: invalid value %d\n",
i_vpr_e(inst, "%s: invalid value %d\n",
__func__, adjusted_value);
return -EINVAL;
}
@@ -961,7 +961,7 @@ int msm_vidc_adjust_mark_ltr(void *instance, struct v4l2_ctrl *ctrl)
} else if (adjusted_value < 0 ||
adjusted_value > (ltr_count - 1)) {
/* MARK_LTR value should be > 0 and <= (LTR_COUNT - 1) */
s_vpr_e(inst->sid, "%s: invalid value %d\n",
i_vpr_e(inst, "%s: invalid value %d\n",
__func__, adjusted_value);
return -EINVAL;
}
@@ -1048,7 +1048,7 @@ int msm_vidc_adjust_transform_8x8(void *instance, struct v4l2_ctrl *ctrl)
capability->cap[TRANSFORM_8X8].value;
if (inst->codec != MSM_VIDC_H264) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: incorrect entry in database. fix the database\n",
__func__);
return 0;
@@ -1569,7 +1569,7 @@ int msm_vidc_set_array(void *instance,
* STRUCTURE, BLOB, STRING, PACKED, ARRAY,
*
case BITRATE_MODE:
s_vpr_h(inst->sid, "%s: %d\n", __func__, hfi_value);
i_vpr_h(inst, "%s: %d\n", __func__, hfi_value);
hfi_create_packet(inst->packet, inst->packet_size,
offset,
capability->cap[cap_id].hfi_id,
@@ -1580,7 +1580,7 @@ int msm_vidc_set_array(void *instance,
}
*/
default:
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Unknown cap id %d, cannot set to fw\n",
__func__, cap_id);
rc = -EINVAL;
@@ -1643,14 +1643,14 @@ int msm_vidc_v4l2_menu_to_hfi(struct msm_vidc_inst *inst,
}
return 0;
default:
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: mapping not specified for ctrl_id: %#x\n",
__func__, capability->cap[cap_id].v4l2_id);
return -EINVAL;
}
set_default:
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: invalid value %d for ctrl id: %#x. Set default: %u\n",
__func__, capability->cap[cap_id].value,
capability->cap[cap_id].v4l2_id, *value);
@@ -1741,14 +1741,14 @@ int msm_vidc_v4l2_to_hfi_enum(struct msm_vidc_inst *inst,
}
return 0;
default:
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: mapping not specified for ctrl_id: %#x\n",
__func__, capability->cap[cap_id].v4l2_id);
return -EINVAL;
}
set_default:
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: invalid value %d for ctrl id: %#x. Set default: %u\n",
__func__, capability->cap[cap_id].value,
capability->cap[cap_id].v4l2_id, *value);

View File

@@ -44,6 +44,43 @@ const char *level_str(u32 level)
return "????";
}
const char *codec_str(void *instance)
{
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
if (!inst) {
d_vpr_e("%s: invalid params\n", __func__);
goto err_invalid_inst;
}
if (inst->codec == MSM_VIDC_H264)
return "h264 ";
else if (inst->codec == MSM_VIDC_HEVC)
return "hevc ";
else if (inst->codec == MSM_VIDC_VP9)
return "vp9 ";
else
return "?????";
err_invalid_inst:
return "null ";
}
u32 get_sid(void *instance)
{
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
if (!inst) {
d_vpr_e("%s: invalid params\n", __func__);
goto err_invalid_inst;
}
return inst->sid;
err_invalid_inst:
return 0;
}
#define MAX_DBG_BUF_SIZE 4096
struct core_inst_pair {
@@ -356,7 +393,7 @@ static ssize_t inst_info_read(struct file *file, char __user *buf,
dbuf = kzalloc(MAX_DBG_BUF_SIZE, GFP_KERNEL);
if (!dbuf) {
s_vpr_e(inst->sid, "%s: Allocation failed!\n", __func__);
i_vpr_e(inst, "%s: Allocation failed!\n", __func__);
len = -ENOMEM;
goto failed_alloc;
}
@@ -446,7 +483,7 @@ struct dentry *msm_vidc_debugfs_init_inst(void *instance, struct dentry *parent)
idata = kzalloc(sizeof(struct core_inst_pair), GFP_KERNEL);
if (!idata) {
s_vpr_e(inst->sid, "%s: Allocation failed!\n", __func__);
i_vpr_e(inst, "%s: Allocation failed!\n", __func__);
goto exit;
}
@@ -456,7 +493,7 @@ struct dentry *msm_vidc_debugfs_init_inst(void *instance, struct dentry *parent)
dir = debugfs_create_dir(debugfs_name, parent);
if (IS_ERR_OR_NULL(dir)) {
dir = NULL;
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: Failed to create debugfs for msm_vidc\n",
__func__);
goto failed_create_dir;
@@ -465,7 +502,7 @@ struct dentry *msm_vidc_debugfs_init_inst(void *instance, struct dentry *parent)
info = debugfs_create_file("info", 0444, dir,
idata, &inst_info_fops);
if (IS_ERR_OR_NULL(info)) {
s_vpr_e(inst->sid, "%s: debugfs_create_file: fail\n",
i_vpr_e(inst, "%s: debugfs_create_file: fail\n",
__func__);
goto failed_create_file;
}
@@ -493,7 +530,7 @@ void msm_vidc_debugfs_deinit_inst(void *instance)
dentry = inst->debugfs_root;
if (dentry->d_inode) {
s_vpr_l(inst->sid, "%s: Destroy %pK\n",
i_vpr_l(inst, "%s: Destroy %pK\n",
__func__, dentry->d_inode->i_private);
kfree(dentry->d_inode->i_private);
dentry->d_inode->i_private = NULL;
@@ -529,10 +566,10 @@ void msm_vidc_debugfs_update(void *instance,
if (inst->debug_count.ebd &&
inst->debug_count.ebd == inst->debug_count.etb) {
toc(inst, FRAME_PROCESSING);
s_vpr_p(inst->sid, "EBD: FW needs input buffers\n");
i_vpr_p(inst, "EBD: FW needs input buffers\n");
}
if (inst->debug_count.ftb == inst->debug_count.fbd)
s_vpr_p(inst->sid, "EBD: FW needs output buffers\n");
i_vpr_p(inst, "EBD: FW needs output buffers\n");
break;
case MSM_VIDC_DEBUGFS_EVENT_FTB:
inst->debug_count.ftb++;
@@ -548,13 +585,13 @@ void msm_vidc_debugfs_update(void *instance,
if (inst->debug_count.fbd &&
inst->debug_count.fbd == inst->debug_count.ftb) {
toc(inst, FRAME_PROCESSING);
s_vpr_p(inst->sid, "FBD: FW needs output buffers\n");
i_vpr_p(inst, "FBD: FW needs output buffers\n");
}
if (inst->debug_count.etb == inst->debug_count.ebd)
s_vpr_p(inst->sid, "FBD: FW needs input buffers\n");
i_vpr_p(inst, "FBD: FW needs input buffers\n");
break;
default:
s_vpr_e(inst->sid, "invalid event in debugfs: %d\n", e);
i_vpr_e(inst, "invalid event in debugfs: %d\n", e);
break;
}
}

View File

@@ -58,7 +58,7 @@ void print_vb2_buffer(const char *str, struct msm_vidc_inst *inst,
if (!inst || !vb2)
return;
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: %s: idx %2d fd %d off %d size %d filled %d\n",
str, vb2->type == INPUT_MPLANE ? "INPUT" : "OUTPUT",
vb2->index, vb2->planes[0].m.fd,
@@ -258,7 +258,7 @@ int v4l2_type_to_driver_port(struct msm_vidc_inst *inst, u32 type,
} else if (type == OUTPUT_META_PLANE) {
port = OUTPUT_META_PORT;
} else {
s_vpr_e(inst->sid, "%s: port not found for v4l2 type %d\n",
i_vpr_e(inst, "%s: port not found for v4l2 type %d\n",
func, type);
port = -EINVAL;
}
@@ -310,7 +310,7 @@ u32 msm_vidc_get_buffer_region(struct msm_vidc_inst *inst,
region = MSM_VIDC_SECURE_NONPIXEL;
break;
default:
s_vpr_e(inst->sid, "%s: invalid driver buffer type %d\n",
i_vpr_e(inst, "%s: invalid driver buffer type %d\n",
func, buffer_type);
}
return region;
@@ -346,7 +346,7 @@ struct msm_vidc_buffers *msm_vidc_get_buffers(
case MSM_VIDC_BUF_VPSS:
return &inst->buffers.vpss;
default:
s_vpr_e(inst->sid, "%s: invalid driver buffer type %d\n",
i_vpr_e(inst, "%s: invalid driver buffer type %d\n",
func, buffer_type);
return NULL;
}
@@ -382,7 +382,7 @@ struct msm_vidc_mappings *msm_vidc_get_mappings(
case MSM_VIDC_BUF_VPSS:
return &inst->mappings.vpss;
default:
s_vpr_e(inst->sid, "%s: invalid driver buffer type %d\n",
i_vpr_e(inst, "%s: invalid driver buffer type %d\n",
func, buffer_type);
return NULL;
}
@@ -410,7 +410,7 @@ struct msm_vidc_allocations *msm_vidc_get_allocations(
case MSM_VIDC_BUF_VPSS:
return &inst->allocations.vpss;
default:
s_vpr_e(inst->sid, "%s: invalid driver buffer type %d\n",
i_vpr_e(inst, "%s: invalid driver buffer type %d\n",
func, buffer_type);
return NULL;
}
@@ -508,18 +508,18 @@ int msm_vidc_change_inst_state(struct msm_vidc_inst *inst,
}
if (!request_state) {
s_vpr_e(inst->sid, "%s: invalid request state\n", func);
i_vpr_e(inst, "%s: invalid request state\n", func);
return -EINVAL;
}
if (inst->state == MSM_VIDC_ERROR) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: inst is in bad state, can not change state to %s\n",
func, state_name(request_state));
return 0;
}
s_vpr_h(inst->sid, "%s: state changed from %s to %s\n",
i_vpr_h(inst, "%s: state changed from %s to %s\n",
func, state_name(inst->state), state_name(request_state));
inst->state = request_state;
return 0;
@@ -552,7 +552,7 @@ bool msm_vidc_allow_s_fmt(struct msm_vidc_inst *inst, u32 type)
exit:
if (!allow)
s_vpr_e(inst->sid, "%s: type %d not allowed in state %s\n",
i_vpr_e(inst, "%s: type %d not allowed in state %s\n",
__func__, type, state_name(inst->state));
return allow;
}
@@ -617,7 +617,7 @@ bool msm_vidc_allow_s_ctrl(struct msm_vidc_inst *inst, u32 id)
exit:
if (!allow)
s_vpr_e(inst->sid, "%s: id %d not allowed in state %s\n",
i_vpr_e(inst, "%s: id %d not allowed in state %s\n",
__func__, id, state_name(inst->state));
return allow;
}
@@ -649,7 +649,7 @@ bool msm_vidc_allow_reqbufs(struct msm_vidc_inst *inst, u32 type)
exit:
if (!allow)
s_vpr_e(inst->sid, "%s: type %d not allowed in state %s\n",
i_vpr_e(inst, "%s: type %d not allowed in state %s\n",
__func__, type, state_name(inst->state));
return allow;
}
@@ -669,10 +669,10 @@ enum msm_vidc_allow msm_vidc_allow_stop(struct msm_vidc_inst *inst)
allow = MSM_VIDC_ALLOW;
} else if (inst->state == MSM_VIDC_START_INPUT) {
allow = MSM_VIDC_IGNORE;
s_vpr_e(inst->sid, "%s: stop ignored in state %s\n",
i_vpr_e(inst, "%s: stop ignored in state %s\n",
__func__, state_name(inst->state));
} else {
s_vpr_e(inst->sid, "%s: stop not allowed in state %s\n",
i_vpr_e(inst, "%s: stop not allowed in state %s\n",
__func__, state_name(inst->state));
}
@@ -690,7 +690,7 @@ bool msm_vidc_allow_start(struct msm_vidc_inst *inst)
inst->state == MSM_VIDC_DRC_DRAIN_LAST_FLAG)
return true;
s_vpr_e(inst->sid, "%s: not allowed in state %s\n",
i_vpr_e(inst, "%s: not allowed in state %s\n",
__func__, state_name(inst->state));
return false;
}
@@ -712,7 +712,7 @@ bool msm_vidc_allow_streamon(struct msm_vidc_inst *inst, u32 type)
return true;
}
s_vpr_e(inst->sid, "%s: type %d not allowed in state %s\n",
i_vpr_e(inst, "%s: type %d not allowed in state %s\n",
__func__, type, state_name(inst->state));
return false;
}
@@ -741,7 +741,7 @@ bool msm_vidc_allow_streamoff(struct msm_vidc_inst *inst, u32 type)
allow = false;
}
if (!allow)
s_vpr_e(inst->sid, "%s: type %d not allowed in state %s\n",
i_vpr_e(inst, "%s: type %d not allowed in state %s\n",
__func__, type, state_name(inst->state));
return allow;
@@ -754,7 +754,7 @@ bool msm_vidc_allow_qbuf(struct msm_vidc_inst *inst)
return false;
}
if (inst->state == MSM_VIDC_ERROR) {
s_vpr_e(inst->sid, "%s: inst in error state\n", __func__);
i_vpr_e(inst, "%s: inst in error state\n", __func__);
return false;
} else {
return true;
@@ -778,11 +778,11 @@ enum msm_vidc_allow msm_vidc_allow_input_psc(struct msm_vidc_inst *inst)
inst->state == MSM_VIDC_DRC_DRAIN ||
inst->state == MSM_VIDC_DRC_DRAIN_LAST_FLAG ||
inst->state == MSM_VIDC_DRAIN_START_INPUT) {
s_vpr_h(inst->sid, "%s: defer input psc, inst state %s\n",
i_vpr_h(inst, "%s: defer input psc, inst state %s\n",
__func__, state_name(inst->state));
allow = MSM_VIDC_DEFER;
} else {
s_vpr_e(inst->sid, "%s: input psc in wrong state %s\n",
i_vpr_e(inst, "%s: input psc in wrong state %s\n",
__func__, state_name(inst->state));
allow = MSM_VIDC_DISALLOW;
}
@@ -801,7 +801,7 @@ bool msm_vidc_allow_last_flag(struct msm_vidc_inst *inst)
inst->state == MSM_VIDC_DRC_DRAIN)
return true;
s_vpr_e(inst->sid, "%s: not allowed in state %s\n",
i_vpr_e(inst, "%s: not allowed in state %s\n",
__func__, state_name(inst->state));
return false;
}
@@ -831,7 +831,7 @@ int msm_vidc_state_change_streamon(struct msm_vidc_inst *inst, u32 type)
} else if (inst->state == MSM_VIDC_START_INPUT) {
new_state = MSM_VIDC_START;
} else if (inst->state == MSM_VIDC_DRAIN_START_INPUT) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: streamon(output) in DRAIN_START_INPUT state\n",
__func__);
new_state = MSM_VIDC_DRAIN;
@@ -839,12 +839,12 @@ int msm_vidc_state_change_streamon(struct msm_vidc_inst *inst, u32 type)
resp_work = list_first_entry(&inst->response_works,
struct response_work, list);
if (resp_work->type == RESP_WORK_INPUT_PSC) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: streamon(output) in DRAIN_START_INPUT state, input psc pending\n",
__func__);
rc = handle_session_response_work(inst, resp_work);
if (rc) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: handle input psc failed\n", __func__);
new_state = MSM_VIDC_ERROR;
} else {
@@ -895,7 +895,7 @@ int msm_vidc_state_change_streamoff(struct msm_vidc_inst *inst, u32 type)
list_for_each_entry_safe(resp_work, dummy,
&inst->response_works, list) {
if (resp_work->type == RESP_WORK_INPUT_PSC) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: discard pending input psc\n", __func__);
list_del(&resp_work->list);
kfree(resp_work->data);
@@ -943,7 +943,7 @@ int msm_vidc_state_change_stop(struct msm_vidc_inst *inst)
inst->state == MSM_VIDC_DRC_LAST_FLAG) {
new_state = MSM_VIDC_DRC_DRAIN_LAST_FLAG;
} else {
s_vpr_e(inst->sid, "%s: wrong state %s\n",
i_vpr_e(inst, "%s: wrong state %s\n",
__func__, state_name(inst->state));
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return -EINVAL;
@@ -973,12 +973,12 @@ int msm_vidc_state_change_start(struct msm_vidc_inst *inst)
resp_work = list_first_entry(&inst->response_works,
struct response_work, list);
if (resp_work->type == RESP_WORK_INPUT_PSC) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: start in DRC(DRAIN)_LAST_FLAG state, input psc pending\n",
__func__);
rc = handle_session_response_work(inst, resp_work);
if (rc) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: handle input psc failed\n", __func__);
new_state = MSM_VIDC_ERROR;
} else {
@@ -995,11 +995,11 @@ int msm_vidc_state_change_start(struct msm_vidc_inst *inst)
resp_work = list_first_entry(&inst->response_works,
struct response_work, list);
if (resp_work->type == RESP_WORK_INPUT_PSC) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: start in DRC_DRAIN_LAST_FLAG state, input psc pending\n");
rc = handle_session_response_work(inst, resp_work);
if (rc) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: handle input psc failed\n", __func__);
new_state = MSM_VIDC_ERROR;
} else {
@@ -1011,7 +1011,7 @@ int msm_vidc_state_change_start(struct msm_vidc_inst *inst)
}
}
} else {
s_vpr_e(inst->sid, "%s: wrong state %s\n",
i_vpr_e(inst, "%s: wrong state %s\n",
__func__, state_name(inst->state));
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return -EINVAL;
@@ -1041,7 +1041,7 @@ int msm_vidc_state_change_input_psc(struct msm_vidc_inst *inst)
} else if (inst->state == MSM_VIDC_DRAIN) {
new_state = MSM_VIDC_DRC_DRAIN;
} else {
s_vpr_e(inst->sid, "%s: wrong state %s\n",
i_vpr_e(inst, "%s: wrong state %s\n",
__func__, state_name(inst->state));
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return -EINVAL;
@@ -1069,7 +1069,7 @@ int msm_vidc_state_change_last_flag(struct msm_vidc_inst *inst)
} else if (inst->state == MSM_VIDC_DRC_DRAIN) {
new_state = MSM_VIDC_DRC_DRAIN_LAST_FLAG;
} else {
s_vpr_e(inst->sid, "%s: wrong state %s\n",
i_vpr_e(inst, "%s: wrong state %s\n",
__func__, state_name(inst->state));
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return -EINVAL;
@@ -1094,12 +1094,12 @@ int msm_vidc_get_control(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE:
ctrl->val = inst->buffers.output.min_count +
inst->buffers.output.extra_count;
s_vpr_h(inst->sid, "g_min: output buffers %d\n", ctrl->val);
i_vpr_h(inst, "g_min: output buffers %d\n", ctrl->val);
break;
case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT:
ctrl->val = inst->buffers.input.min_count +
inst->buffers.input.extra_count;
s_vpr_h(inst->sid, "g_min: input buffers %d\n", ctrl->val);
i_vpr_h(inst, "g_min: input buffers %d\n", ctrl->val);
break;
default:
break;
@@ -1162,7 +1162,7 @@ int msm_vidc_num_buffers(struct msm_vidc_inst *inst,
} else if (type == MSM_VIDC_BUF_INPUT) {
buffers = &inst->buffers.input;
} else {
s_vpr_e(inst->sid, "%s: invalid buffer type %#x\n",
i_vpr_e(inst, "%s: invalid buffer type %#x\n",
__func__, type);
return count;
}
@@ -1305,7 +1305,7 @@ int msm_vidc_map_driver_buf(struct msm_vidc_inst *inst,
}
map = kzalloc(sizeof(struct msm_vidc_map), GFP_KERNEL);
if (!map) {
s_vpr_e(inst->sid, "%s: alloc failed\n", __func__);
i_vpr_e(inst, "%s: alloc failed\n", __func__);
return -ENOMEM;
}
INIT_LIST_HEAD(&map->list);
@@ -1379,7 +1379,7 @@ struct msm_vidc_buffer *msm_vidc_get_driver_buf(struct msm_vidc_inst *inst,
} else {
buf = kzalloc(sizeof(struct msm_vidc_buffer), GFP_KERNEL);
if (!buf) {
s_vpr_e(inst->sid, "%s: alloc failed\n", __func__);
i_vpr_e(inst, "%s: alloc failed\n", __func__);
goto error;
}
INIT_LIST_HEAD(&buf->list);
@@ -1422,7 +1422,7 @@ struct msm_vidc_buffer *get_meta_buffer(struct msm_vidc_inst *inst,
} else if (buf->type == MSM_VIDC_BUF_OUTPUT) {
buffers = &inst->buffers.output_meta;
} else {
s_vpr_e(inst->sid, "%s: invalid buffer type %d\n",
i_vpr_e(inst, "%s: invalid buffer type %d\n",
__func__, buf->type);
return NULL;
}
@@ -1529,12 +1529,12 @@ int msm_vidc_destroy_internal_buffer(struct msm_vidc_inst *inst,
}
if (!is_internal_buffer(buffer->type)) {
s_vpr_e(inst->sid, "%s: buffer type %#x is not internal\n",
i_vpr_e(inst, "%s: buffer type %#x is not internal\n",
__func__, buffer->type);
return 0;
}
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: destroy buffer_type %#x, size %d device_addr %#x\n",
__func__, buffer->type, buffer->buffer_size,
buffer->device_addr);
@@ -1626,7 +1626,7 @@ int msm_vidc_create_internal_buffer(struct msm_vidc_inst *inst,
return -EINVAL;
}
if (!is_internal_buffer(buffer_type)) {
s_vpr_e(inst->sid, "%s: buffer type %#x is not internal\n",
i_vpr_e(inst, "%s: buffer type %#x is not internal\n",
__func__, buffer_type);
return 0;
}
@@ -1642,13 +1642,13 @@ int msm_vidc_create_internal_buffer(struct msm_vidc_inst *inst,
return -EINVAL;
if (!buffers->size) {
s_vpr_e(inst->sid, "%s: invalid buffer %#x\n",
i_vpr_e(inst, "%s: invalid buffer %#x\n",
__func__, buffer_type);
return -EINVAL;
}
buffer = kzalloc(sizeof(struct msm_vidc_buffer), GFP_KERNEL);
if (!buffer) {
s_vpr_e(inst->sid, "%s: buf alloc failed\n", __func__);
i_vpr_e(inst, "%s: buf alloc failed\n", __func__);
return -ENOMEM;
}
INIT_LIST_HEAD(&buffer->list);
@@ -1660,7 +1660,7 @@ int msm_vidc_create_internal_buffer(struct msm_vidc_inst *inst,
alloc = kzalloc(sizeof(struct msm_vidc_alloc), GFP_KERNEL);
if (!alloc) {
s_vpr_e(inst->sid, "%s: alloc failed\n", __func__);
i_vpr_e(inst, "%s: alloc failed\n", __func__);
return -ENOMEM;
}
INIT_LIST_HEAD(&alloc->list);
@@ -1676,7 +1676,7 @@ int msm_vidc_create_internal_buffer(struct msm_vidc_inst *inst,
map = kzalloc(sizeof(struct msm_vidc_map), GFP_KERNEL);
if (!map) {
s_vpr_e(inst->sid, "%s: map alloc failed\n", __func__);
i_vpr_e(inst, "%s: map alloc failed\n", __func__);
return -ENOMEM;
}
INIT_LIST_HEAD(&map->list);
@@ -1690,7 +1690,7 @@ int msm_vidc_create_internal_buffer(struct msm_vidc_inst *inst,
buffer->dmabuf = alloc->dmabuf;
buffer->device_addr = map->device_addr;
s_vpr_h(inst->sid,
i_vpr_h(inst,
"%s: created buffer_type %#x, size %d device_addr %#x\n",
__func__, buffer_type, buffers->size,
buffer->device_addr);
@@ -1715,7 +1715,7 @@ int msm_vidc_create_internal_buffers(struct msm_vidc_inst *inst,
return -EINVAL;
if (buffers->reuse) {
s_vpr_l(inst->sid, "%s: reuse enabled for buffer type %#x\n",
i_vpr_l(inst, "%s: reuse enabled for buffer type %#x\n",
__func__, buffer_type);
return 0;
}
@@ -1741,7 +1741,7 @@ int msm_vidc_queue_internal_buffers(struct msm_vidc_inst *inst,
return -EINVAL;
}
if (!is_internal_buffer(buffer_type)) {
s_vpr_e(inst->sid, "%s: buffer type %#x is not internal\n",
i_vpr_e(inst, "%s: buffer type %#x is not internal\n",
__func__, buffer_type);
return 0;
}
@@ -1751,7 +1751,7 @@ int msm_vidc_queue_internal_buffers(struct msm_vidc_inst *inst,
return -EINVAL;
if (buffers->reuse) {
s_vpr_l(inst->sid, "%s: reuse enabled for buffer type %#x\n",
i_vpr_l(inst, "%s: reuse enabled for buffer type %#x\n",
__func__, buffer_type);
return 0;
}
@@ -1769,7 +1769,7 @@ int msm_vidc_queue_internal_buffers(struct msm_vidc_inst *inst,
/* mark queued */
buffer->attr |= MSM_VIDC_ATTR_QUEUED;
s_vpr_h(inst->sid, "%s: queued buffer_type %#x, size %d\n",
i_vpr_h(inst, "%s: queued buffer_type %#x, size %d\n",
__func__, buffer_type, buffers->size);
}
@@ -1788,7 +1788,7 @@ int msm_vidc_alloc_and_queue_session_internal_buffers(struct msm_vidc_inst *inst
if (buffer_type != MSM_VIDC_BUF_ARP &&
buffer_type != MSM_VIDC_BUF_PERSIST) {
s_vpr_e(inst->sid, "%s: invalid buffer type: %d\n",
i_vpr_e(inst, "%s: invalid buffer type: %d\n",
__func__, buffer_type);
rc = -EINVAL;
goto exit;
@@ -1822,7 +1822,7 @@ int msm_vidc_release_internal_buffers(struct msm_vidc_inst *inst,
return -EINVAL;
}
if (!is_internal_buffer(buffer_type)) {
s_vpr_e(inst->sid, "%s: buffer type %#x is not internal\n",
i_vpr_e(inst, "%s: buffer type %#x is not internal\n",
__func__, buffer_type);
return 0;
}
@@ -1832,7 +1832,7 @@ int msm_vidc_release_internal_buffers(struct msm_vidc_inst *inst,
return -EINVAL;
if (buffers->reuse) {
s_vpr_l(inst->sid, "%s: reuse enabled for buffer type %#x\n",
i_vpr_l(inst, "%s: reuse enabled for buffer type %#x\n",
__func__, buffer_type);
return 0;
}
@@ -1850,7 +1850,7 @@ int msm_vidc_release_internal_buffers(struct msm_vidc_inst *inst,
/* mark pending release */
buffer->attr |= MSM_VIDC_ATTR_PENDING_RELEASE;
s_vpr_e(inst->sid, "%s: released buffer_type %#x, size %d\n",
i_vpr_e(inst, "%s: released buffer_type %#x, size %d\n",
__func__, buffer_type, buffers->size);
}
@@ -1879,7 +1879,7 @@ int msm_vidc_vb2_buffer_done(struct msm_vidc_inst *inst,
q = &inst->vb2q[port];
if (!q->streaming) {
s_vpr_e(inst->sid, "%s: port %d is not streaming\n",
i_vpr_e(inst, "%s: port %d is not streaming\n",
__func__, port);
return -EINVAL;
}
@@ -1968,7 +1968,7 @@ static int vb2q_init(struct msm_vidc_inst *inst,
q->copy_timestamp = 1;
rc = vb2_queue_init(q);
if (rc)
s_vpr_e(inst->sid, "%s: vb2_queue_init failed for type %d\n",
i_vpr_e(inst, "%s: vb2_queue_init failed for type %d\n",
__func__, type);
return rc;
}
@@ -2091,7 +2091,7 @@ int msm_vidc_session_open(struct msm_vidc_inst *inst)
inst->packet_size = 4096;
inst->packet = kzalloc(inst->packet_size, GFP_KERNEL);
if (!inst->packet) {
s_vpr_e(inst->sid, "%s(): inst packet allocation failed\n", __func__);
i_vpr_e(inst, "%s(): inst packet allocation failed\n", __func__);
return -ENOMEM;
}
@@ -2101,7 +2101,7 @@ int msm_vidc_session_open(struct msm_vidc_inst *inst)
return 0;
error:
s_vpr_e(inst->sid, "%s(): session open failed\n", __func__);
i_vpr_e(inst, "%s(): session open failed\n", __func__);
kfree(inst->packet);
inst->packet = NULL;
return rc;
@@ -2163,7 +2163,7 @@ int msm_vidc_session_streamoff(struct msm_vidc_inst *inst,
signal_type = SIGNAL_CMD_STOP_OUTPUT;
buffer_type = MSM_VIDC_BUF_OUTPUT;
} else {
s_vpr_e(inst->sid, "%s: invalid port: %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port: %d\n", __func__, port);
return -EINVAL;
}
@@ -2172,7 +2172,7 @@ int msm_vidc_session_streamoff(struct msm_vidc_inst *inst,
goto error;
core = inst->core;
s_vpr_h(inst->sid, "%s: wait on port: %d for time: %d ms\n",
i_vpr_h(inst, "%s: wait on port: %d for time: %d ms\n",
__func__, port, core->capabilities[HW_RESPONSE_TIMEOUT].value);
mutex_unlock(&inst->lock);
rc = wait_for_completion_timeout(
@@ -2180,7 +2180,7 @@ int msm_vidc_session_streamoff(struct msm_vidc_inst *inst,
msecs_to_jiffies(
core->capabilities[HW_RESPONSE_TIMEOUT].value));
if (!rc) {
s_vpr_e(inst->sid, "%s: session stop timed out for port: %d\n",
i_vpr_e(inst, "%s: session stop timed out for port: %d\n",
__func__, port);
rc = -ETIMEDOUT;
msm_vidc_core_timeout(inst->core);
@@ -2192,10 +2192,10 @@ int msm_vidc_session_streamoff(struct msm_vidc_inst *inst,
/* no more queued buffers after streamoff */
count = msm_vidc_num_buffers(inst, buffer_type, MSM_VIDC_ATTR_QUEUED);
if (!count) {
s_vpr_h(inst->sid, "%s: stop successful on port: %d\n",
i_vpr_h(inst, "%s: stop successful on port: %d\n",
__func__, port);
} else {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: %d buffers pending with firmware on port: %d\n",
__func__, count, port);
rc = -EINVAL;
@@ -2224,7 +2224,7 @@ int msm_vidc_session_close(struct msm_vidc_inst *inst)
return rc;
core = inst->core;
s_vpr_h(inst->sid, "%s: wait on close for time: %d ms\n",
i_vpr_h(inst, "%s: wait on close for time: %d ms\n",
__func__, core->capabilities[HW_RESPONSE_TIMEOUT].value);
mutex_unlock(&inst->lock);
rc = wait_for_completion_timeout(
@@ -2232,18 +2232,18 @@ int msm_vidc_session_close(struct msm_vidc_inst *inst)
msecs_to_jiffies(
core->capabilities[HW_RESPONSE_TIMEOUT].value));
if (!rc) {
s_vpr_e(inst->sid, "%s: session close timed out\n", __func__);
i_vpr_e(inst, "%s: session close timed out\n", __func__);
rc = -ETIMEDOUT;
msm_vidc_core_timeout(inst->core);
} else {
rc = 0;
s_vpr_h(inst->sid, "%s: close successful\n", __func__);
i_vpr_h(inst, "%s: close successful\n", __func__);
}
mutex_lock(&inst->lock);
msm_vidc_remove_session(inst);
s_vpr_h(inst->sid, "%s: free session packet data\n", __func__);
i_vpr_h(inst, "%s: free session packet data\n", __func__);
kfree(inst->packet);
inst->packet = NULL;
@@ -2257,11 +2257,11 @@ int msm_vidc_kill_session(struct msm_vidc_inst *inst)
return -EINVAL;
}
if (!inst->session_id) {
s_vpr_e(inst->sid, "%s: already killed\n", __func__);
i_vpr_e(inst, "%s: already killed\n", __func__);
return 0;
}
s_vpr_e(inst->sid, "%s: killing session\n", __func__);
i_vpr_e(inst, "%s: killing session\n", __func__);
msm_vidc_session_close(inst);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
@@ -2284,7 +2284,7 @@ int msm_vidc_get_inst_capability(struct msm_vidc_inst *inst)
for (i = 0; i < core->codecs_count; i++) {
if (core->inst_caps[i].domain == inst->domain &&
core->inst_caps[i].codec == inst->codec) {
s_vpr_h(inst->sid,
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],
@@ -2292,7 +2292,7 @@ int msm_vidc_get_inst_capability(struct msm_vidc_inst *inst)
}
}
if (!inst->capabilities) {
s_vpr_e(inst->sid, "%s: capabilities not found\n", __func__);
i_vpr_e(inst, "%s: capabilities not found\n", __func__);
return -EINVAL;
}
@@ -2667,7 +2667,7 @@ int msm_vidc_flush_buffers(struct msm_vidc_inst* inst,
buffer_type[0] = MSM_VIDC_BUF_OUTPUT_META;
buffer_type[1] = MSM_VIDC_BUF_OUTPUT;
} else {
s_vpr_h(inst->sid, "%s: invalid buffer type %d\n",
i_vpr_h(inst, "%s: invalid buffer type %d\n",
__func__, type);
return -EINVAL;
}
@@ -2720,7 +2720,7 @@ void msm_vidc_destroy_buffers(struct msm_vidc_inst *inst)
if (!buffers)
continue;
list_for_each_entry_safe(buf, dummy, &buffers->list, list) {
s_vpr_h(inst->sid,
i_vpr_h(inst,
"destroying buffer: type %d idx %d fd %d addr %#x size %d\n",
buf->type, buf->index, buf->fd, buf->device_addr, buf->buffer_size);
if (is_internal_buffer(buf->type))
@@ -2736,7 +2736,7 @@ static void msm_vidc_close_helper(struct kref *kref)
struct msm_vidc_inst *inst = container_of(kref,
struct msm_vidc_inst, kref);
s_vpr_h(inst->sid, "%s()\n", __func__);
i_vpr_h(inst, "%s()\n", __func__);
msm_vidc_event_queue_deinit(inst);
msm_vidc_vb2_queue_deinit(inst);
msm_vidc_debugfs_deinit_inst(inst);

View File

@@ -270,21 +270,26 @@ int msm_vidc_memory_free(struct msm_vidc_core *core, struct msm_vidc_alloc *mem)
return rc;
};
/*
int msm_memory_cache_operations(struct dma_buf *dbuf,
enum smem_cache_ops cache_op, unsigned long offset,
unsigned long size, u32 sid)
int msm_memory_cache_operations(struct msm_vidc_inst *inst,
struct dma_buf *dbuf, enum smem_cache_ops cache_op,
unsigned long offset, unsigned long size, u32 sid)
{
int rc = 0;
unsigned long flags = 0;
if (!inst) {
d_vpr_e("%s: invalid parameters\n", __func__);
return -EINVAL;
}
if (!dbuf) {
s_vpr_e(sid, "%s: invalid params\n", __func__);
i_vpr_e(inst, "%s: invalid params\n", __func__);
return -EINVAL;
}
rc = dma_buf_get_flags(dbuf, &flags);
if (rc) {
s_vpr_e(sid, "%s: dma_buf_get_flags failed, err %d\n",
i_vpr_e(inst, "%s: dma_buf_get_flags failed, err %d\n",
__func__, rc);
return rc;
} else if (!(flags & ION_FLAG_CACHED)) {
@@ -310,7 +315,7 @@ int msm_memory_cache_operations(struct dma_buf *dbuf,
offset, size);
break;
default:
s_vpr_e(sid, "%s: cache (%d) operation not supported\n",
i_vpr_e(inst, "%s: cache (%d) operation not supported\n",
__func__, cache_op);
rc = -EINVAL;
break;
@@ -332,7 +337,7 @@ int msm_smem_memory_prefetch(struct msm_vidc_inst *inst)
vidc_regions = &inst->regions;
if (vidc_regions->num_regions > MEMORY_REGIONS_MAX) {
s_vpr_e(inst->sid, "%s: invalid num_regions %d, max %d\n",
i_vpr_e(inst, "%s: invalid num_regions %d, max %d\n",
__func__, vidc_regions->num_regions,
MEMORY_REGIONS_MAX);
return -EINVAL;
@@ -347,10 +352,10 @@ int msm_smem_memory_prefetch(struct msm_vidc_inst *inst)
rc = msm_ion_heap_prefetch(ION_SECURE_HEAP_ID, ion_region,
vidc_regions->num_regions);
if (rc)
s_vpr_e(inst->sid, "%s: prefetch failed, ret: %d\n",
i_vpr_e(inst, "%s: prefetch failed, ret: %d\n",
__func__, rc);
else
s_vpr_l(inst->sid, "%s: prefetch succeeded\n", __func__);
i_vpr_l(inst, "%s: prefetch succeeded\n", __func__);
return rc;
}
@@ -368,7 +373,7 @@ int msm_smem_memory_drain(struct msm_vidc_inst *inst)
vidc_regions = &inst->regions;
if (vidc_regions->num_regions > MEMORY_REGIONS_MAX) {
s_vpr_e(inst->sid, "%s: invalid num_regions %d, max %d\n",
i_vpr_e(inst, "%s: invalid num_regions %d, max %d\n",
__func__, vidc_regions->num_regions,
MEMORY_REGIONS_MAX);
return -EINVAL;
@@ -383,9 +388,9 @@ int msm_smem_memory_drain(struct msm_vidc_inst *inst)
rc = msm_ion_heap_drain(ION_SECURE_HEAP_ID, ion_region,
vidc_regions->num_regions);
if (rc)
s_vpr_e(inst->sid, "%s: drain failed, ret: %d\n", __func__, rc);
i_vpr_e(inst, "%s: drain failed, ret: %d\n", __func__, rc);
else
s_vpr_l(inst->sid, "%s: drain succeeded\n", __func__);
i_vpr_l(inst, "%s: drain succeeded\n", __func__);
return rc;
}

View File

@@ -31,13 +31,13 @@ u64 msm_vidc_max_freq(struct msm_vidc_inst *inst)
}
core = inst->core;
if (!core->dt || !core->dt->allowed_clks_tbl) {
s_vpr_e(inst->sid, "%s: invalid params\n", __func__);
i_vpr_e(inst, "%s: invalid params\n", __func__);
return freq;
}
allowed_clks_tbl = core->dt->allowed_clks_tbl;
freq = allowed_clks_tbl[0].clock_rate;
s_vpr_l(inst->sid, "%s: rate = %lu\n", __func__, freq);
i_vpr_l(inst, "%s: rate = %lu\n", __func__, freq);
return freq;
}
@@ -148,7 +148,7 @@ static int fill_dynamic_stats(struct msm_vidc_inst *inst,
vote_data->complexity_factor = max_cf;
vote_data->input_cr = min_input_cr;
s_vpr_l(inst->sid,
i_vpr_l(inst,
"Input CR = %d Recon CR = %d Complexity Factor = %d\n",
vote_data->input_cr, vote_data->compression_ratio,
vote_data->complexity_factor);
@@ -250,7 +250,7 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
codec = out_f->fmt.pix_mp.pixelformat;
break;
default:
s_vpr_e(inst->sid, "%s: invalid session_type %#x\n",
i_vpr_e(inst, "%s: invalid session_type %#x\n",
__func__, inst->domain);
break;
}
@@ -423,7 +423,7 @@ static int msm_vidc_apply_dcvs(struct msm_vidc_inst *inst)
}
if (!inst->power.dcvs_mode || inst->decode_batch.enable) {
s_vpr_l(inst->sid, "Skip DCVS (dcvs %d, batching %d)\n",
i_vpr_l(inst, "Skip DCVS (dcvs %d, batching %d)\n",
inst->power.dcvs_mode, inst->decode_batch.enable);
inst->power.dcvs_flags = 0;
return 0;
@@ -468,7 +468,7 @@ static int msm_vidc_apply_dcvs(struct msm_vidc_inst *inst)
bufs_with_fw <= power->nom_threshold))
power->dcvs_flags = 0;
s_vpr_p(inst->sid, "DCVS: bufs_with_fw %d th[%d %d %d] flags %#x\n",
i_vpr_p(inst, "DCVS: bufs_with_fw %d th[%d %d %d] flags %#x\n",
bufs_with_fw, power->min_threshold,
power->nom_threshold, power->max_threshold,
power->dcvs_flags);
@@ -529,14 +529,14 @@ int msm_vidc_scale_power(struct msm_vidc_inst *inst, bool scale_buses)
}
if (msm_vidc_scale_clocks(inst))
s_vpr_e(inst->sid, "failed to scale clock\n");
i_vpr_e(inst, "failed to scale clock\n");
if (scale_buses) {
if (msm_vidc_scale_buses(inst))
s_vpr_e(inst->sid, "failed to scale bus\n");
i_vpr_e(inst, "failed to scale bus\n");
}
s_vpr_h(inst->sid,
i_vpr_h(inst,
"power: inst: clk %lld ddr %d llcc %d dcvs flags %#x, core: clk %lld ddr %lld llcc %lld\n",
inst->power.curr_freq, inst->power.ddr_bw,
inst->power.sys_cache_bw, inst->power.dcvs_flags,
@@ -563,7 +563,7 @@ void msm_vidc_dcvs_data_reset(struct msm_vidc_inst *inst)
min_count = inst->buffers.output.min_count;
actual_count = inst->buffers.output.actual_count;
} else {
s_vpr_e(inst->sid, "%s: invalid domain type %d\n",
i_vpr_e(inst, "%s: invalid domain type %d\n",
__func__, inst->domain);
return;
}
@@ -585,7 +585,7 @@ void msm_vidc_dcvs_data_reset(struct msm_vidc_inst *inst)
dcvs->dcvs_flags = 0;
s_vpr_p(inst->sid, "%s: DCVS: thresholds [%d %d %d] flags %#x\n",
i_vpr_p(inst, "%s: DCVS: thresholds [%d %d %d] flags %#x\n",
__func__, dcvs->min_threshold,
dcvs->nom_threshold, dcvs->max_threshold,
dcvs->dcvs_flags);
@@ -599,7 +599,7 @@ void msm_vidc_power_data_reset(struct msm_vidc_inst *inst)
d_vpr_e("%s: invalid params\n", __func__);
return;
}
s_vpr_h(inst->sid, "%s\n", __func__);
i_vpr_h(inst, "%s\n", __func__);
msm_vidc_dcvs_data_reset(inst);
@@ -608,5 +608,5 @@ void msm_vidc_power_data_reset(struct msm_vidc_inst *inst)
rc = msm_vidc_scale_power(inst, true);
if (rc)
s_vpr_e(inst->sid, "%s: failed to scale power\n", __func__);
i_vpr_e(inst, "%s: failed to scale power\n", __func__);
}

View File

@@ -31,7 +31,7 @@ struct vb2_queue *msm_vidc_get_vb2q(struct msm_vidc_inst *inst,
} else if (type == OUTPUT_META_PLANE) {
q = &inst->vb2q[OUTPUT_META_PORT];
} else {
s_vpr_e(inst->sid, "%s: invalid buffer type %d\n",
i_vpr_e(inst, "%s: invalid buffer type %d\n",
__func__, type);
}
return q;
@@ -133,7 +133,7 @@ int msm_vidc_queue_setup(struct vb2_queue *q,
else if (port == INPUT_META_PORT || port == OUTPUT_META_PORT)
sizes[0] = inst->fmts[port].fmt.meta.buffersize;
s_vpr_h(inst->sid,
i_vpr_h(inst,
"queue_setup: type %d num_buffers %d sizes[0] %d\n",
q->type, *num_buffers, sizes[0]);
return rc;
@@ -154,16 +154,16 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
return -EINVAL;
}
if (q->type == INPUT_META_PLANE || q->type == OUTPUT_META_PLANE) {
s_vpr_h(inst->sid, "%s: nothing to start on meta port %d\n",
i_vpr_h(inst, "%s: nothing to start on meta port %d\n",
__func__, q->type);
return 0;
}
if (!is_decode_session(inst) && !is_encode_session(inst)) {
s_vpr_e(inst->sid, "%s: invalid session %d\n",
i_vpr_e(inst, "%s: invalid session %d\n",
__func__, inst->domain);
return -EINVAL;
}
s_vpr_h(inst->sid, "Streamon: %d\n", q->type);
i_vpr_h(inst, "Streamon: %d\n", q->type);
if (!inst->once_per_session_set) {
inst->once_per_session_set = true;
@@ -176,7 +176,7 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
MSM_VIDC_BUF_ARP);
if (rc)
goto error;
s_vpr_h(inst->sid, "arp buffer: %d %d\n",
i_vpr_h(inst, "arp buffer: %d %d\n",
inst->buffers.arp.min_count,
inst->buffers.arp.size);
} else if(is_decode_session(inst)) {
@@ -185,7 +185,7 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
MSM_VIDC_BUF_PERSIST);
if (rc)
goto error;
s_vpr_h(inst->sid, "persist buffer: %d %d\n",
i_vpr_h(inst, "persist buffer: %d %d\n",
inst->buffers.persist.min_count,
inst->buffers.persist.size);
*/
@@ -207,16 +207,16 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
else
goto error;
} else {
s_vpr_e(inst->sid, "%s: invalid type %d\n", q->type);
i_vpr_e(inst, "%s: invalid type %d\n", q->type);
goto error;
}
if (!rc)
s_vpr_h(inst->sid, "Streamon: %d successful\n", q->type);
i_vpr_h(inst, "Streamon: %d successful\n", q->type);
return rc;
error:
s_vpr_h(inst->sid, "Streamon: %d failed\n", q->type);
i_vpr_h(inst, "Streamon: %d failed\n", q->type);
return -EINVAL;
}
@@ -235,16 +235,16 @@ void msm_vidc_stop_streaming(struct vb2_queue *q)
return;
}
if (q->type == INPUT_META_PLANE || q->type == OUTPUT_META_PLANE) {
s_vpr_h(inst->sid, "%s: nothing to stop on meta port %d\n",
i_vpr_h(inst, "%s: nothing to stop on meta port %d\n",
__func__, q->type);
return;
}
if (!is_decode_session(inst) && !is_encode_session(inst)) {
s_vpr_e(inst->sid, "%s: invalid session %d\n",
i_vpr_e(inst, "%s: invalid session %d\n",
__func__, inst->domain);
return;
}
s_vpr_h(inst->sid, "Streamoff: %d\n", q->type);
i_vpr_h(inst, "Streamoff: %d\n", q->type);
if (q->type == INPUT_MPLANE) {
if (is_decode_session(inst))
@@ -261,16 +261,16 @@ void msm_vidc_stop_streaming(struct vb2_queue *q)
else
goto error;
} else {
s_vpr_e(inst->sid, "%s: invalid type %d\n", q->type);
i_vpr_e(inst, "%s: invalid type %d\n", q->type);
goto error;
}
if (!rc)
s_vpr_h(inst->sid, "Streamoff: %d successful\n", q->type);
i_vpr_h(inst, "Streamoff: %d successful\n", q->type);
return;
error:
s_vpr_e(inst->sid, "Streamoff: %d failed\n", q->type);
i_vpr_e(inst, "Streamoff: %d failed\n", q->type);
return;
}

View File

@@ -189,7 +189,7 @@ static bool __valdiate_session(struct msm_vidc_core *core,
}
}
if (!valid)
s_vpr_e(inst->sid, "%s: invalid session\n", func);
i_vpr_e(inst, "%s: invalid session\n", func);
return valid;
}
@@ -2923,7 +2923,7 @@ int venus_hfi_start(struct msm_vidc_inst *inst, enum msm_vidc_port_type port)
}
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
goto unlock;
}
@@ -2966,7 +2966,7 @@ int venus_hfi_stop(struct msm_vidc_inst *inst, enum msm_vidc_port_type port)
}
if (port != INPUT_PORT && port != OUTPUT_PORT) {
s_vpr_e(inst->sid, "%s: invalid port %d\n", __func__, port);
i_vpr_e(inst, "%s: invalid port %d\n", __func__, port);
goto unlock;
}
@@ -3124,7 +3124,7 @@ int venus_hfi_release_buffer(struct msm_vidc_inst *inst,
}
if (!is_internal_buffer(buffer->type)) {
s_vpr_e(inst->sid, "release not allowed for buffer type %d\n",
i_vpr_e(inst, "release not allowed for buffer type %d\n",
buffer->type);
goto unlock;
}
@@ -3177,7 +3177,7 @@ int venus_hfi_scale_clocks(struct msm_vidc_inst* inst, u64 freq)
core_lock(core, __func__);
if (__resume(core)) {
s_vpr_e(inst->sid, "Resume from power collapse failed\n");
i_vpr_e(inst, "Resume from power collapse failed\n");
rc = -EINVAL;
goto exit;
}

View File

@@ -65,7 +65,7 @@ u32 vidc_port_from_hfi(struct msm_vidc_inst *inst,
port = OUTPUT_PORT;
break;
default:
s_vpr_e(inst->sid, "%s: invalid hfi port type %d\n",
i_vpr_e(inst, "%s: invalid hfi port type %d\n",
__func__, hfi_port);
break;
}
@@ -78,12 +78,12 @@ u32 vidc_port_from_hfi(struct msm_vidc_inst *inst,
port = OUTPUT_PORT;
break;
default:
s_vpr_e(inst->sid, "%s: invalid hfi port type %d\n",
i_vpr_e(inst, "%s: invalid hfi port type %d\n",
__func__, hfi_port);
break;
}
} else {
s_vpr_e(inst->sid, "%s: invalid domain %#x\n",
i_vpr_e(inst, "%s: invalid domain %#x\n",
__func__, inst->domain);
}
@@ -94,7 +94,7 @@ bool is_valid_hfi_port(struct msm_vidc_inst *inst, u32 port,
u32 buffer_type, const char *func)
{
if (!inst) {
s_vpr_e(inst->sid, "%s: invalid params\n", func);
i_vpr_e(inst, "%s: invalid params\n", func);
return false;
}
@@ -109,7 +109,7 @@ bool is_valid_hfi_port(struct msm_vidc_inst *inst, u32 port,
return true;
invalid:
s_vpr_e(inst->sid, "%s: invalid port %#x buffer_type %u\n",
i_vpr_e(inst, "%s: invalid port %#x buffer_type %u\n",
func, port, buffer_type);
return false;
}
@@ -118,7 +118,7 @@ bool is_valid_hfi_buffer_type(struct msm_vidc_inst *inst,
u32 buffer_type, const char *func)
{
if (!inst) {
s_vpr_e(inst->sid, "%s: invalid params\n", func);
i_vpr_e(inst, "%s: invalid params\n", func);
return false;
}
@@ -132,7 +132,7 @@ bool is_valid_hfi_buffer_type(struct msm_vidc_inst *inst,
buffer_type != HFI_BUFFER_LINE &&
buffer_type != HFI_BUFFER_DPB &&
buffer_type != HFI_BUFFER_PERSIST) {
s_vpr_e(inst->sid, "%s: invalid buffer type %#x\n",
i_vpr_e(inst, "%s: invalid buffer type %#x\n",
func, buffer_type);
return false;
}
@@ -191,7 +191,7 @@ static bool check_last_flag(struct msm_vidc_inst *inst,
buffer = (struct hfi_buffer *)((u8 *)pkt + sizeof(struct hfi_packet));
if (buffer->flags & HFI_BUF_FW_FLAG_LAST) {
s_vpr_h(inst->sid, "%s: received last flag on FBD, index: %d\n",
i_vpr_h(inst, "%s: received last flag on FBD, index: %d\n",
__func__, buffer->index);
return true;
}
@@ -217,7 +217,7 @@ static int handle_session_info(struct msm_vidc_inst *inst,
break;
}
s_vpr_e(inst->sid, "session info (%#x): %s\n", pkt->type, info);
i_vpr_e(inst, "session info (%#x): %s\n", pkt->type, info);
return rc;
}
@@ -252,7 +252,7 @@ static int handle_session_error(struct msm_vidc_inst *inst,
break;
}
s_vpr_e(inst->sid, "session error (%#x): %s\n", pkt->type, error);
i_vpr_e(inst, "session error (%#x): %s\n", pkt->type, error);
rc = msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return rc;
@@ -287,13 +287,13 @@ static int handle_session_open(struct msm_vidc_inst *inst,
struct hfi_packet *pkt)
{
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return 0;
}
if (pkt->flags & HFI_FW_FLAGS_SUCCESS)
s_vpr_h(inst->sid, "%s: successful\n", __func__);
i_vpr_h(inst, "%s: successful\n", __func__);
return 0;
}
@@ -302,12 +302,12 @@ static int handle_session_close(struct msm_vidc_inst *inst,
struct hfi_packet *pkt)
{
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
}
if (pkt->flags & HFI_FW_FLAGS_SUCCESS)
s_vpr_h(inst->sid, "%s: successful\n", __func__);
i_vpr_h(inst, "%s: successful\n", __func__);
signal_session_msg_receipt(inst, SIGNAL_CMD_CLOSE);
return 0;
@@ -317,13 +317,13 @@ static int handle_session_start(struct msm_vidc_inst *inst,
struct hfi_packet *pkt)
{
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return 0;
}
if (pkt->flags & HFI_FW_FLAGS_SUCCESS)
s_vpr_h(inst->sid, "%s: successful for port %d\n",
i_vpr_h(inst, "%s: successful for port %d\n",
__func__, pkt->port);
return 0;
}
@@ -334,12 +334,12 @@ static int handle_session_stop(struct msm_vidc_inst *inst,
int signal_type = -1;
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
}
if (pkt->flags & HFI_FW_FLAGS_SUCCESS)
s_vpr_h(inst->sid, "%s: successful for port %d\n",
i_vpr_h(inst, "%s: successful for port %d\n",
__func__, pkt->port);
if (is_encode_session(inst)) {
@@ -348,7 +348,7 @@ static int handle_session_stop(struct msm_vidc_inst *inst,
} else if (pkt->port == HFI_PORT_BITSTREAM) {
signal_type = SIGNAL_CMD_STOP_OUTPUT;
} else {
s_vpr_e(inst->sid, "%s: invalid port: %d\n",
i_vpr_e(inst, "%s: invalid port: %d\n",
__func__, pkt->port);
return -EINVAL;
}
@@ -358,12 +358,12 @@ static int handle_session_stop(struct msm_vidc_inst *inst,
} else if (pkt->port == HFI_PORT_BITSTREAM) {
signal_type = SIGNAL_CMD_STOP_INPUT;
} else {
s_vpr_e(inst->sid, "%s: invalid port: %d\n",
i_vpr_e(inst, "%s: invalid port: %d\n",
__func__, pkt->port);
return -EINVAL;
}
} else {
s_vpr_e(inst->sid, "%s: invalid session\n", __func__);
i_vpr_e(inst, "%s: invalid session\n", __func__);
return -EINVAL;
}
@@ -376,13 +376,13 @@ static int handle_session_drain(struct msm_vidc_inst *inst,
struct hfi_packet *pkt)
{
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return 0;
}
if (pkt->flags & HFI_FW_FLAGS_SUCCESS)
s_vpr_h(inst->sid, "%s: successful\n", __func__);
i_vpr_h(inst, "%s: successful\n", __func__);
return 0;
}
@@ -406,7 +406,7 @@ static int handle_input_buffer(struct msm_vidc_inst *inst,
}
}
if (!found) {
s_vpr_e(inst->sid, "%s: buffer not found for idx %d addr %#x\n",
i_vpr_e(inst, "%s: buffer not found for idx %d addr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -417,11 +417,11 @@ static int handle_input_buffer(struct msm_vidc_inst *inst,
buf->flags = 0;
//todo:
/*if (buffer->flags & HFI_BUF_FW_FLAG_CORRUPT) {
s_vpr_h(inst->sid, "%s: data corrupted\n", __func__);
i_vpr_h(inst, "%s: data corrupted\n", __func__);
buf->flags |= MSM_VIDC_BUF_FLAG_ERROR;
}
if (buffer->flags & HFI_BUF_FW_FLAG_UNSUPPORTED) {
s_vpr_e(inst->sid, "%s: unsupported input\n", __func__);
i_vpr_e(inst, "%s: unsupported input\n", __func__);
buf->flags |= MSM_VIDC_BUF_FLAG_ERROR;
// TODO: move inst->state to error state
}*/
@@ -452,7 +452,7 @@ static int handle_output_buffer(struct msm_vidc_inst *inst,
}
}
if (!found) {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -508,7 +508,7 @@ static int handle_input_metadata_buffer(struct msm_vidc_inst *inst,
}
}
if (!found) {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -543,7 +543,7 @@ static int handle_output_metadata_buffer(struct msm_vidc_inst *inst,
}
}
if (!found) {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -614,7 +614,7 @@ static int handle_dpb_buffer(struct msm_vidc_inst *inst,
if (found) {
rc = msm_vidc_destroy_internal_buffer(inst, buf);
} else {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -643,7 +643,7 @@ static int handle_persist_buffer(struct msm_vidc_inst *inst,
if (found) {
rc = msm_vidc_destroy_internal_buffer(inst, buf);
} else {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -672,7 +672,7 @@ static int handle_line_buffer(struct msm_vidc_inst *inst,
if (found) {
rc = msm_vidc_destroy_internal_buffer(inst, buf);
} else {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -701,7 +701,7 @@ static int handle_non_comv_buffer(struct msm_vidc_inst *inst,
if (found) {
rc = msm_vidc_destroy_internal_buffer(inst, buf);
} else {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -730,7 +730,7 @@ static int handle_comv_buffer(struct msm_vidc_inst *inst,
if (found) {
rc = msm_vidc_destroy_internal_buffer(inst, buf);
} else {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -759,7 +759,7 @@ static int handle_bin_buffer(struct msm_vidc_inst *inst,
if (found) {
rc = msm_vidc_destroy_internal_buffer(inst, buf);
} else {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -788,7 +788,7 @@ static int handle_arp_buffer(struct msm_vidc_inst *inst,
if (found) {
rc = msm_vidc_destroy_internal_buffer(inst, buf);
} else {
s_vpr_e(inst->sid, "%s: invalid idx %d daddr %#x\n",
i_vpr_e(inst, "%s: invalid idx %d daddr %#x\n",
__func__, buffer->index, buffer->base_address);
return -EINVAL;
}
@@ -803,7 +803,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
u32 buf_type = 0, port_type = 0;
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
return 0;
}
@@ -841,7 +841,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
else if (buf_type == HFI_BUFFER_DPB)
rc = handle_dpb_buffer(inst, buffer);
else
s_vpr_e(inst->sid, "%s: unknown bitstream port buffer type %#x\n",
i_vpr_e(inst, "%s: unknown bitstream port buffer type %#x\n",
__func__, buf_type);
} else if (port_type == HFI_PORT_RAW) {
if (buf_type == HFI_BUFFER_METADATA)
@@ -849,7 +849,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
else if (buf_type == HFI_BUFFER_RAW)
rc = handle_input_buffer(inst, buffer);
else
s_vpr_e(inst->sid, "%s: unknown raw port buffer type %#x\n",
i_vpr_e(inst, "%s: unknown raw port buffer type %#x\n",
__func__, buf_type);
}
} else if (is_decode_session(inst)) {
@@ -869,7 +869,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
else if (buf_type == HFI_BUFFER_PERSIST)
rc = handle_persist_buffer(inst, buffer);
else
s_vpr_e(inst->sid, "%s: unknown bitstream port buffer type %#x\n",
i_vpr_e(inst, "%s: unknown bitstream port buffer type %#x\n",
__func__, buf_type);
} else if (port_type == HFI_PORT_RAW) {
if (buf_type == HFI_BUFFER_METADATA)
@@ -879,11 +879,11 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
else if (buf_type == HFI_BUFFER_DPB)
rc = handle_dpb_buffer(inst, buffer);
else
s_vpr_e(inst->sid, "%s: unknown raw port buffer type %#x\n",
i_vpr_e(inst, "%s: unknown raw port buffer type %#x\n",
__func__, buf_type);
}
} else {
s_vpr_e(inst->sid, "%s: invalid session %d\n",
i_vpr_e(inst, "%s: invalid session %d\n",
__func__, inst->domain);
return -EINVAL;
}
@@ -894,7 +894,7 @@ static int handle_session_buffer(struct msm_vidc_inst *inst,
static int handle_port_settings_change(struct msm_vidc_inst *inst,
struct hfi_packet *pkt)
{
s_vpr_h(inst->sid, "%s: Received port settings change, type %d\n",
i_vpr_h(inst, "%s: Received port settings change, type %d\n",
__func__, pkt->port);
return 0;
}
@@ -903,12 +903,12 @@ static int handle_session_subscribe_mode(struct msm_vidc_inst *inst,
struct hfi_packet *pkt)
{
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
}
if (pkt->flags & HFI_FW_FLAGS_SUCCESS)
s_vpr_h(inst->sid, "%s: successful\n", __func__);
i_vpr_h(inst, "%s: successful\n", __func__);
return 0;
}
@@ -916,12 +916,12 @@ static int handle_session_delivery_mode(struct msm_vidc_inst *inst,
struct hfi_packet *pkt)
{
if (pkt->flags & HFI_FW_FLAGS_SESSION_ERROR) {
s_vpr_e(inst->sid, "%s: received session error\n", __func__);
i_vpr_e(inst, "%s: received session error\n", __func__);
msm_vidc_change_inst_state(inst, MSM_VIDC_ERROR, __func__);
}
if (pkt->flags & HFI_FW_FLAGS_SUCCESS)
s_vpr_h(inst->sid, "%s: successful\n", __func__);
i_vpr_h(inst, "%s: successful\n", __func__);
return 0;
}
@@ -948,7 +948,7 @@ static int handle_session_command(struct msm_vidc_inst *inst,
case HFI_CMD_DELIVERY_MODE:
return handle_session_delivery_mode(inst, pkt);
default:
s_vpr_e(inst->sid, "%s: Unsupported command type: %#x\n",
i_vpr_e(inst, "%s: Unsupported command type: %#x\n",
__func__, pkt->type);
return -EINVAL;
}
@@ -961,7 +961,7 @@ static int handle_session_property(struct msm_vidc_inst *inst,
u32 port;
u32 *payload_ptr;
s_vpr_h(inst->sid, "%s: property type %#x\n", __func__, pkt->type);
i_vpr_h(inst, "%s: property type %#x\n", __func__, pkt->type);
port = vidc_port_from_hfi(inst, pkt->port);
payload_ptr = (u32 *)((u8 *)pkt + sizeof(struct hfi_packet));
@@ -999,7 +999,7 @@ static int handle_session_property(struct msm_vidc_inst *inst,
inst->subcr_params[port].tier = payload_ptr[0];
break;
default:
s_vpr_e(inst->sid, "%s: invalid port settings property %#x\n",
i_vpr_e(inst, "%s: invalid port settings property %#x\n",
__func__, pkt->type);
return -EINVAL;
}
@@ -1133,7 +1133,7 @@ int handle_session_response_work(struct msm_vidc_inst *inst,
if (packet->type > HFI_CMD_BEGIN &&
packet->type < HFI_CMD_END) {
if (hfi_cmd_type == HFI_CMD_SETTINGS_CHANGE) {
s_vpr_e(inst->sid,
i_vpr_e(inst,
"%s: invalid packet type %d in port settings change\n",
__func__, packet->type);
rc = -EINVAL;
@@ -1152,7 +1152,7 @@ int handle_session_response_work(struct msm_vidc_inst *inst,
packet->type < HFI_INFORMATION_END) {
rc = handle_session_info(inst, packet);
} else {
s_vpr_e(inst->sid, "%s: Unknown packet type: %#x\n",
i_vpr_e(inst, "%s: Unknown packet type: %#x\n",
__func__, packet->type);
rc = -EINVAL;
goto exit;
@@ -1181,7 +1181,7 @@ int handle_session_response_work(struct msm_vidc_inst *inst,
if (rc)
goto exit;
} else {
s_vpr_e(inst->sid, "%s: invalid port type: %#x\n",
i_vpr_e(inst, "%s: invalid port type: %#x\n",
__func__, hfi_port);
}
}
@@ -1336,7 +1336,7 @@ static int handle_session_response(struct msm_vidc_core *core,
packet->type < HFI_INFORMATION_END) {
rc = handle_session_info(inst, packet);
} else {
s_vpr_e(inst->sid, "%s: Unknown packet type: %#x\n",
i_vpr_e(inst, "%s: Unknown packet type: %#x\n",
__func__, packet->type);
rc = -EINVAL;
goto exit;