video: driver: Change format specifier and API clean-up
-Removed unwanted functions -Removed unwanted part of code from function definitions -Added proper format specifier according to the data type. Change-Id: I700202f1cf588506b329d202ce3e2729c027dcae Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com> Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
This commit is contained in:
@@ -573,8 +573,7 @@ static int msm_vidc_input_min_count_iris2(struct msm_vidc_inst* inst)
|
||||
HFI_IRIS2_ENC_MIN_INPUT_BUF_COUNT(input_min_count,
|
||||
total_hb_layer);
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid domain\n",
|
||||
__func__, inst->domain);
|
||||
i_vpr_e(inst, "%s: invalid domain %d\n", __func__, inst->domain);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -296,7 +296,7 @@ static int __disable_regulator_iris2(struct msm_vidc_core *core,
|
||||
rc = __acquire_regulator(core, rinfo);
|
||||
if (rc) {
|
||||
d_vpr_e("%s: failed to acquire %s, rc = %d\n",
|
||||
rinfo->name, rc);
|
||||
__func__, rinfo->name, rc);
|
||||
/* Bring attention to this issue */
|
||||
WARN_ON(true);
|
||||
return rc;
|
||||
@@ -306,7 +306,7 @@ static int __disable_regulator_iris2(struct msm_vidc_core *core,
|
||||
rc = regulator_disable(rinfo->regulator);
|
||||
if (rc) {
|
||||
d_vpr_e("%s: failed to disable %s, rc = %d\n",
|
||||
rinfo->name, rc);
|
||||
__func__, rinfo->name, rc);
|
||||
return rc;
|
||||
}
|
||||
d_vpr_h("%s: disabled regulator %s\n", __func__, rinfo->name);
|
||||
@@ -1059,12 +1059,8 @@ int msm_vidc_decide_work_route_iris2(struct msm_vidc_inst* inst)
|
||||
CODED_FRAMES_INTERLACE)
|
||||
work_route = MSM_VIDC_PIPE_1;
|
||||
} else if (is_encode_session(inst)) {
|
||||
u32 slice_mode, width, height;
|
||||
struct v4l2_format* f;
|
||||
u32 slice_mode;
|
||||
|
||||
f = &inst->fmts[INPUT_PORT];
|
||||
height = f->fmt.pix_mp.height;
|
||||
width = f->fmt.pix_mp.width;
|
||||
slice_mode = inst->capabilities->cap[SLICE_MODE].value;
|
||||
|
||||
/*TODO Pipe=1 for legacy CBR*/
|
||||
|
@@ -14,7 +14,6 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
{
|
||||
u64 freq = 0;
|
||||
struct msm_vidc_core* core;
|
||||
struct msm_vidc_power* power;
|
||||
u64 vsp_cycles = 0, vpp_cycles = 0, fw_cycles = 0;
|
||||
u64 fw_vpp_cycles = 0, bitrate = 0;
|
||||
u32 vpp_cycles_per_mb;
|
||||
@@ -30,7 +29,6 @@ u64 msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst, u32 data_size)
|
||||
return freq;
|
||||
}
|
||||
|
||||
power = &inst->power;
|
||||
core = inst->core;
|
||||
if (!core->dt) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
|
@@ -191,11 +191,6 @@ static inline bool is_rgba_colorformat(enum msm_vidc_colorformat_type colorforma
|
||||
colorformat == MSM_VIDC_FMT_RGBA8888C;
|
||||
}
|
||||
|
||||
static inline bool is_secondary_output_mode(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return false; // TODO: inst->stream_output_mode == HAL_VIDEO_DECODER_SECONDARY;
|
||||
}
|
||||
|
||||
static inline bool is_thumbnail_session(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!(inst->capabilities->cap[THUMBNAIL_MODE].value);
|
||||
@@ -324,7 +319,6 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain,
|
||||
int msm_vidc_trigger_ssr(struct msm_vidc_core *core,
|
||||
u64 trigger_ssr_val);
|
||||
void msm_vidc_ssr_handler(struct work_struct *work);
|
||||
void msm_vidc_pm_work_handler(struct work_struct *work);
|
||||
void msm_vidc_fw_unload_handler(struct work_struct *work);
|
||||
int msm_vidc_suspend(struct msm_vidc_core *core);
|
||||
void msm_vidc_batch_handler(struct work_struct *work);
|
||||
|
@@ -64,11 +64,6 @@
|
||||
#define venus_hfi_for_each_clock_reverse(__device, __cinfo) \
|
||||
venus_hfi_for_each_thing_reverse(__device, __cinfo, clock)
|
||||
|
||||
#define venus_hfi_for_each_clock_reverse_continue(__device, __rinfo, \
|
||||
__from) \
|
||||
venus_hfi_for_each_thing_reverse_continue(__device, __rinfo, \
|
||||
clock, __from)
|
||||
|
||||
/* Bus set helpers */
|
||||
#define venus_hfi_for_each_bus(__device, __binfo) \
|
||||
venus_hfi_for_each_thing(__device, __binfo, bus)
|
||||
|
@@ -74,10 +74,6 @@ int __set_clocks(struct msm_vidc_core *core, u32 freq);
|
||||
int __scale_clocks(struct msm_vidc_core *core);
|
||||
int __set_clk_rate(struct msm_vidc_core *core,
|
||||
struct clock_info *cl, u64 rate);
|
||||
void __disable_unprepare_clks(struct msm_vidc_core *core);
|
||||
int __prepare_enable_clks(struct msm_vidc_core *core);
|
||||
int __disable_regulators(struct msm_vidc_core *core);
|
||||
int __enable_regulators(struct msm_vidc_core *core);
|
||||
int __acquire_regulator(struct msm_vidc_core *core,
|
||||
struct regulator_info *rinfo);
|
||||
int __unvote_buses(struct msm_vidc_core *core);
|
||||
|
@@ -282,32 +282,6 @@ u32 get_hfi_colorformat(struct msm_vidc_inst *inst,
|
||||
return hfi_colorformat;
|
||||
}
|
||||
|
||||
u32 get_hfi_quality_mode(struct msm_vidc_inst *inst)
|
||||
{
|
||||
u32 hfi_mode = HFI_MODE_POWER_SAVE;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
switch(inst->capabilities->cap[QUALITY_MODE].value) {
|
||||
case MSM_VIDC_MAX_QUALITY_MODE:
|
||||
hfi_mode = HFI_MODE_MAX_QUALITY;
|
||||
break;
|
||||
case MSM_VIDC_POWER_SAVE_MODE:
|
||||
hfi_mode = HFI_MODE_POWER_SAVE;
|
||||
break;
|
||||
default:
|
||||
i_vpr_e(inst, "%s: invalid qulity mode %d\n", __func__,
|
||||
inst->capabilities->cap[QUALITY_MODE].value);
|
||||
break;
|
||||
}
|
||||
|
||||
exit:
|
||||
return hfi_mode;
|
||||
}
|
||||
|
||||
int get_hfi_buffer(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *buffer, struct hfi_buffer *buf)
|
||||
{
|
||||
|
@@ -1129,16 +1129,14 @@ static int msm_vdec_subscribe_property(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
bool allow = false;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
payload[0] = HFI_MODE_PROPERTY;
|
||||
@@ -1178,7 +1176,6 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
@@ -1201,11 +1198,10 @@ static int msm_vdec_subscribe_metadata(struct msm_vidc_inst *inst,
|
||||
META_MAX_NUM_REORDER_FRAMES,
|
||||
};
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
@@ -1233,7 +1229,6 @@ static int msm_vdec_set_delivery_mode_metadata(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
@@ -1244,11 +1239,10 @@ static int msm_vdec_set_delivery_mode_metadata(struct msm_vidc_inst *inst,
|
||||
META_OUTPUT_BUF_TAG,
|
||||
};
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
@@ -1305,18 +1299,16 @@ static int msm_vdec_session_resume(struct msm_vidc_inst *inst,
|
||||
int msm_vdec_init_input_subcr_params(struct msm_vidc_inst *inst)
|
||||
{
|
||||
struct msm_vidc_subscription_params *subsc_params;
|
||||
struct msm_vidc_core *core;
|
||||
u32 left_offset, top_offset, right_offset, bottom_offset;
|
||||
u32 primaries, matrix_coeff, transfer_char;
|
||||
u32 full_range = 0, video_format = 0;
|
||||
u32 colour_description_present_flag = 0;
|
||||
u32 video_signal_type_present_flag = 0;
|
||||
|
||||
if (!inst || !inst->core || !inst->capabilities) {
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
subsc_params = &inst->subcr_params[INPUT_PORT];
|
||||
|
||||
subsc_params->bitstream_resolution =
|
||||
@@ -1373,7 +1365,7 @@ static int msm_vdec_read_input_subcr_params(struct msm_vidc_inst *inst)
|
||||
struct msm_vidc_core *core;
|
||||
u32 width, height;
|
||||
u32 primaries, matrix_coeff, transfer_char;
|
||||
u32 full_range = 0, video_format = 0;
|
||||
u32 full_range = 0;
|
||||
u32 colour_description_present_flag = 0;
|
||||
u32 video_signal_type_present_flag = 0;
|
||||
|
||||
@@ -1418,7 +1410,6 @@ static int msm_vdec_read_input_subcr_params(struct msm_vidc_inst *inst)
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT;
|
||||
|
||||
if (video_signal_type_present_flag) {
|
||||
video_format = (subsc_params.color_info & 0x1C000000) >> 26;
|
||||
inst->fmts[OUTPUT_PORT].fmt.pix_mp.quantization =
|
||||
full_range ?
|
||||
V4L2_QUANTIZATION_FULL_RANGE :
|
||||
@@ -2356,15 +2347,13 @@ int msm_vdec_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
|
||||
int msm_vdec_try_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
struct v4l2_pix_format_mplane *pixmp = &f->fmt.pix_mp;
|
||||
u32 pix_fmt;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
|
||||
memset(pixmp->reserved, 0, sizeof(pixmp->reserved));
|
||||
if (f->type == INPUT_MPLANE) {
|
||||
@@ -2714,7 +2703,7 @@ int msm_vdec_s_param(struct msm_vidc_inst *inst,
|
||||
do_div(input_rate, us_per_frame);
|
||||
|
||||
set_default:
|
||||
i_vpr_h(inst, "%s: type %s, %s value %d\n",
|
||||
i_vpr_h(inst, "%s: type %s, %s value %llu\n",
|
||||
__func__, v4l2_type_name(s_parm->type),
|
||||
is_frame_rate ? "frame rate" : "operating rate", input_rate);
|
||||
|
||||
@@ -2731,7 +2720,7 @@ set_default:
|
||||
}
|
||||
rc = input_rate > max_rate;
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: unsupported rate %u, max %u\n", __func__,
|
||||
i_vpr_e(inst, "%s: unsupported rate %llu, max %u\n", __func__,
|
||||
input_rate, max_rate);
|
||||
rc = -ENOMEM;
|
||||
goto reset_rate;
|
||||
@@ -2748,7 +2737,7 @@ set_default:
|
||||
|
||||
reset_rate:
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: setting rate %u failed, reset to %u\n", __func__,
|
||||
i_vpr_e(inst, "%s: setting rate %llu failed, reset to %u\n", __func__,
|
||||
input_rate, default_rate);
|
||||
msm_vidc_update_cap_value(inst, is_frame_rate ? FRAME_RATE : OPERATING_RATE,
|
||||
default_rate << 16, __func__);
|
||||
|
@@ -543,13 +543,11 @@ static int msm_venc_set_internal_properties(struct msm_vidc_inst *inst)
|
||||
static int msm_venc_get_input_internal_buffers(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int i, rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(msm_venc_input_internal_buffer_type); i++) {
|
||||
rc = msm_vidc_get_internal_buffers(inst,
|
||||
@@ -662,16 +660,14 @@ static int msm_venc_property_subscription(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
u32 payload[32] = {0};
|
||||
u32 i;
|
||||
u32 payload_size = 0;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
payload[0] = HFI_MODE_PROPERTY;
|
||||
@@ -752,7 +748,6 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
u32 payload[32] = {0};
|
||||
u32 i, count = 0;
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
@@ -765,11 +760,10 @@ static int msm_venc_metadata_subscription(struct msm_vidc_inst *inst,
|
||||
META_ENC_QP_METADATA,
|
||||
};
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
i_vpr_h(inst, "%s()\n", __func__);
|
||||
|
||||
capability = inst->capabilities;
|
||||
@@ -1052,15 +1046,13 @@ error:
|
||||
int msm_venc_try_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_core *core;
|
||||
struct v4l2_pix_format_mplane *pixmp = &f->fmt.pix_mp;
|
||||
u32 pix_fmt;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
|
||||
memset(pixmp->reserved, 0, sizeof(pixmp->reserved));
|
||||
|
||||
@@ -1618,7 +1610,7 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
|
||||
input_rate = (u64)USEC_PER_SEC;
|
||||
do_div(input_rate, us_per_frame);
|
||||
|
||||
i_vpr_h(inst, "%s: type %s, %s value %d\n",
|
||||
i_vpr_h(inst, "%s: type %s, %s value %llu\n",
|
||||
__func__, v4l2_type_name(s_parm->type),
|
||||
is_frame_rate ? "frame rate" : "operating rate", input_rate);
|
||||
|
||||
@@ -1635,7 +1627,7 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
|
||||
}
|
||||
rc = input_rate > max_rate;
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: unsupported rate %u, max %u\n", __func__,
|
||||
i_vpr_e(inst, "%s: unsupported rate %llu, max %u\n", __func__,
|
||||
input_rate, max_rate);
|
||||
rc = -ENOMEM;
|
||||
goto reset_rate;
|
||||
@@ -1673,7 +1665,7 @@ int msm_venc_s_param(struct msm_vidc_inst *inst,
|
||||
|
||||
reset_rate:
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: setting rate %u failed, reset to %u\n", __func__,
|
||||
i_vpr_e(inst, "%s: setting rate %llu failed, reset to %u\n", __func__,
|
||||
input_rate, default_rate);
|
||||
msm_vidc_update_cap_value(inst, is_frame_rate ? FRAME_RATE : OPERATING_RATE,
|
||||
default_rate << 16, __func__);
|
||||
|
@@ -207,7 +207,7 @@ int msm_vidc_query_menu(void *instance, struct v4l2_querymenu *qmenu)
|
||||
rc = -EINVAL;
|
||||
|
||||
i_vpr_h(inst,
|
||||
"%s: ctrl: %s: min %d, max %d, menu_skip_mask %#x, qmenu: id %d, index %d, %s\n",
|
||||
"%s: ctrl: %s: min %lld, max %lld, menu_skip_mask %#x, qmenu: id %u, index %d, %s\n",
|
||||
__func__, ctrl->name, ctrl->minimum, ctrl->maximum,
|
||||
ctrl->menu_skip_mask, qmenu->id, qmenu->index,
|
||||
rc ? "not supported" : "supported");
|
||||
@@ -634,7 +634,7 @@ int msm_vidc_enum_framesizes(void *instance, struct v4l2_frmsizeenum *fsize)
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!inst->capabilities) {
|
||||
i_vpr_e(inst, "capabilities not available\n", __func__);
|
||||
i_vpr_e(inst, "%s: capabilities not available\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
@@ -689,7 +689,7 @@ int msm_vidc_enum_frameintervals(void *instance, struct v4l2_frmivalenum *fival)
|
||||
core = inst->core;
|
||||
|
||||
if (!inst->capabilities || !core->capabilities) {
|
||||
i_vpr_e(inst, "capabilities not available\n", __func__);
|
||||
i_vpr_e(inst, "%s: capabilities not available\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
@@ -37,7 +37,7 @@ u32 msm_vidc_input_min_count(struct msm_vidc_inst* inst)
|
||||
input_min_count = (1 << hb_enh_layer) + 2;
|
||||
}
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid domain\n",
|
||||
i_vpr_e(inst, "%s: invalid domain %d\n",
|
||||
__func__, inst->domain);
|
||||
return 0;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
|
||||
u32 bitstream_size_overwrite = 0;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n");
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -248,7 +248,7 @@ static int msm_vidc_packetize_control(struct msm_vidc_inst *inst,
|
||||
payload_size);
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: failed to set cap[%d] %s to fw\n",
|
||||
__func__, cap_id, cap_name(cap_id));
|
||||
func, cap_id, cap_name(cap_id));
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ static int msm_vidc_get_parent_value(struct msm_vidc_inst* inst,
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (is_parent_available(inst, cap, parent, __func__)) {
|
||||
if (is_parent_available(inst, cap, parent, func)) {
|
||||
switch (parent) {
|
||||
case BITRATE_MODE:
|
||||
*value = inst->hfi_rc_type;
|
||||
|
@@ -212,7 +212,7 @@ static ssize_t stats_delay_write_ms(struct file *filp, const char __user *buf,
|
||||
|
||||
/* filter partial writes and invalid commands */
|
||||
if (*ppos != 0 || count >= sizeof(kbuf) || count == 0) {
|
||||
d_vpr_e("returning error - pos %d, count %d\n", *ppos, count);
|
||||
d_vpr_e("returning error - pos %lld, count %lu\n", *ppos, count);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
|
||||
|
@@ -2341,7 +2341,7 @@ int msm_vidc_flush_ts(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(ts, temp, &inst->timestamps.list, sort.list) {
|
||||
i_vpr_l(inst, "%s: flushing ts: val %lld, rank %%lld\n",
|
||||
i_vpr_l(inst, "%s: flushing ts: val %llu, rank %llu\n",
|
||||
__func__, ts->sort.val, ts->rank);
|
||||
list_del(&ts->sort.list);
|
||||
msm_memory_free(inst, ts);
|
||||
@@ -4677,10 +4677,6 @@ void msm_vidc_ssr_handler(struct work_struct *work)
|
||||
core_unlock(core, __func__);
|
||||
}
|
||||
|
||||
void msm_vidc_pm_work_handler(struct work_struct *work)
|
||||
{
|
||||
}
|
||||
|
||||
void msm_vidc_fw_unload_handler(struct work_struct *work)
|
||||
{
|
||||
struct msm_vidc_core *core = NULL;
|
||||
|
@@ -320,7 +320,7 @@ static int msm_vidc_load_allowed_clocks_table(
|
||||
|
||||
d_vpr_h("Found allowed clock rates\n");
|
||||
for (i = 0; i < dt->allowed_clks_tbl_size; i++)
|
||||
d_vpr_h(" %d\n", dt->allowed_clks_tbl[i]);
|
||||
d_vpr_h(" %d\n", dt->allowed_clks_tbl[i].clock_rate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -678,7 +678,7 @@ static int msm_vidc_read_resources_from_dt(struct platform_device *pdev)
|
||||
core = dev_get_drvdata(&pdev->dev);
|
||||
if (!core || !core->dt) {
|
||||
d_vpr_e("%s: core not found in device %s",
|
||||
dev_name(&pdev->dev));
|
||||
__func__, dev_name(&pdev->dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
dt = core->dt;
|
||||
@@ -927,11 +927,11 @@ void msm_vidc_deinit_dt(struct platform_device *pdev)
|
||||
core = dev_get_drvdata(&pdev->dev);
|
||||
if (!core) {
|
||||
d_vpr_e("%s: core not found in device %s",
|
||||
dev_name(&pdev->dev));
|
||||
__func__, dev_name(&pdev->dev));
|
||||
return;
|
||||
} else if (!core->dt) {
|
||||
d_vpr_e("%s: invalid dt in device %s",
|
||||
dev_name(&pdev->dev));
|
||||
__func__, dev_name(&pdev->dev));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -958,7 +958,7 @@ int msm_vidc_init_dt(struct platform_device *pdev)
|
||||
core = dev_get_drvdata(&pdev->dev);
|
||||
if (!core) {
|
||||
d_vpr_e("%s: core not found in device %s",
|
||||
dev_name(&pdev->dev));
|
||||
__func__, dev_name(&pdev->dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@@ -601,7 +601,7 @@ int msm_memory_pools_init(struct msm_vidc_inst *inst)
|
||||
}
|
||||
|
||||
if (ARRAY_SIZE(buftype_size_name_arr) != MSM_MEM_POOL_MAX) {
|
||||
i_vpr_e(inst, "%s: num elements mismatch %u %u\n", __func__,
|
||||
i_vpr_e(inst, "%s: num elements mismatch %lu %u\n", __func__,
|
||||
ARRAY_SIZE(buftype_size_name_arr), MSM_MEM_POOL_MAX);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@@ -303,7 +303,7 @@ int msm_vidc_deinit_platform(struct platform_device *pdev)
|
||||
core = dev_get_drvdata(&pdev->dev);
|
||||
if (!core) {
|
||||
d_vpr_e("%s: core not found in device %s",
|
||||
dev_name(&pdev->dev));
|
||||
__func__, dev_name(&pdev->dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ int msm_vidc_init_platform(struct platform_device *pdev)
|
||||
core = dev_get_drvdata(&pdev->dev);
|
||||
if (!core) {
|
||||
d_vpr_e("%s: core not found in device %s",
|
||||
dev_name(&pdev->dev));
|
||||
__func__, dev_name(&pdev->dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ u64 msm_vidc_max_freq(struct msm_vidc_inst *inst)
|
||||
allowed_clks_tbl = core->dt->allowed_clks_tbl;
|
||||
freq = allowed_clks_tbl[0].clock_rate;
|
||||
|
||||
i_vpr_l(inst, "%s: rate = %lu\n", __func__, freq);
|
||||
i_vpr_l(inst, "%s: rate = %llu\n", __func__, freq);
|
||||
return freq;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ int msm_vidc_set_clocks(struct msm_vidc_inst* inst)
|
||||
}
|
||||
core->power.clk_freq = (u32)rate;
|
||||
|
||||
i_vpr_p(inst, "%s: clock rate %lu requested %lu increment %d decrement %d\n",
|
||||
i_vpr_p(inst, "%s: clock rate %llu requested %llu increment %d decrement %d\n",
|
||||
__func__, rate, freq, increment, decrement);
|
||||
mutex_unlock(&core->lock);
|
||||
|
||||
|
@@ -20,7 +20,7 @@ struct vb2_queue *msm_vidc_get_vb2q(struct msm_vidc_inst *inst,
|
||||
struct vb2_queue *q = NULL;
|
||||
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid buffer type %d\n", func);
|
||||
d_vpr_e("%s: invalid params\n", func);
|
||||
return NULL;
|
||||
}
|
||||
if (type == INPUT_MPLANE) {
|
||||
@@ -154,7 +154,7 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
enum msm_vidc_buffer_type buf_type;
|
||||
|
||||
if (!q || !q->drv_priv) {
|
||||
d_vpr_e("%s: invalid input, q = %pK\n", q);
|
||||
d_vpr_e("%s: invalid input, q = %pK\n", __func__, q);
|
||||
return -EINVAL;
|
||||
}
|
||||
inst = q->drv_priv;
|
||||
@@ -222,7 +222,7 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
else
|
||||
goto error;
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid type %d\n", q->type);
|
||||
i_vpr_e(inst, "%s: invalid type %d\n", __func__, q->type);
|
||||
goto error;
|
||||
}
|
||||
if (rc)
|
||||
@@ -271,7 +271,7 @@ void msm_vidc_stop_streaming(struct vb2_queue *q)
|
||||
struct msm_vidc_inst *inst;
|
||||
|
||||
if (!q || !q->drv_priv) {
|
||||
d_vpr_e("%s: invalid input, q = %pK\n", q);
|
||||
d_vpr_e("%s: invalid input, q = %pK\n", __func__, q);
|
||||
return;
|
||||
}
|
||||
inst = q->drv_priv;
|
||||
@@ -302,7 +302,7 @@ void msm_vidc_stop_streaming(struct vb2_queue *q)
|
||||
else if (is_encode_session(inst))
|
||||
rc = msm_venc_streamoff_output(inst);
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid type %d\n", q->type);
|
||||
i_vpr_e(inst, "%s: invalid type %d\n", __func__, q->type);
|
||||
goto error;
|
||||
}
|
||||
if (rc)
|
||||
|
@@ -537,10 +537,10 @@ static int __vote_bandwidth(struct bus_info *bus,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
d_vpr_p("Voting bus %s to ab %llu kBps\n", bus->name, bw_kbps);
|
||||
d_vpr_p("Voting bus %s to ab %lu kBps\n", bus->name, bw_kbps);
|
||||
rc = icc_set_bw(bus->path, bw_kbps, 0);
|
||||
if (rc)
|
||||
d_vpr_e("Failed voting bus %s to ab %llu, rc=%d\n",
|
||||
d_vpr_e("Failed voting bus %s to ab %lu, rc=%d\n",
|
||||
bus->name, bw_kbps, rc);
|
||||
|
||||
return rc;
|
||||
@@ -603,7 +603,7 @@ int __vote_buses(struct msm_vidc_core *core,
|
||||
bus->range[0], bus->range[1]);
|
||||
|
||||
if (TRIVIAL_BW_CHANGE(bw_kbps, bw_prev) && bw_prev) {
|
||||
d_vpr_l("Skip voting bus %s to %llu kBps\n",
|
||||
d_vpr_l("Skip voting bus %s to %lu kBps\n",
|
||||
bus->name, bw_kbps);
|
||||
continue;
|
||||
}
|
||||
@@ -1572,32 +1572,6 @@ failed_to_reset:
|
||||
return rc;
|
||||
}
|
||||
|
||||
void __disable_unprepare_clks(struct msm_vidc_core *core)
|
||||
{
|
||||
struct clock_info *cl;
|
||||
|
||||
if (!core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
venus_hfi_for_each_clock_reverse(core, cl) {
|
||||
if (!cl->clk)
|
||||
continue;
|
||||
d_vpr_h("Clock: %s disable and unprepare\n",
|
||||
cl->name);
|
||||
|
||||
if (!__clk_is_enabled(cl->clk))
|
||||
d_vpr_e("%s: clock %s already disabled\n",
|
||||
__func__, cl->name);
|
||||
|
||||
clk_disable_unprepare(cl->clk);
|
||||
if (cl->has_scaling)
|
||||
__set_clk_rate(core, cl, 0);
|
||||
cl->prev = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int __reset_ahb2axi_bridge(struct msm_vidc_core *core)
|
||||
{
|
||||
int rc, i;
|
||||
@@ -1632,71 +1606,6 @@ failed_to_reset:
|
||||
return rc;
|
||||
}
|
||||
|
||||
int __prepare_enable_clks(struct msm_vidc_core *core)
|
||||
{
|
||||
struct clock_info *cl = NULL;
|
||||
int rc = 0, c = 0;
|
||||
u64 rate = 0;
|
||||
|
||||
if (!core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
venus_hfi_for_each_clock(core, cl) {
|
||||
if (!cl->clk) {
|
||||
d_vpr_e("%s: invalid clock\n", __func__);
|
||||
rc = -EINVAL;
|
||||
goto fail_clk_enable;
|
||||
}
|
||||
/*
|
||||
* For the clocks we control, set the rate prior to preparing
|
||||
* them. Since we don't really have a load at this point, scale
|
||||
* it to the lowest frequency possible
|
||||
*/
|
||||
if (cl->has_scaling) {
|
||||
rate = clk_round_rate(cl->clk, 0);
|
||||
/**
|
||||
* source clock is already multipled with scaling ratio and __set_clk_rate
|
||||
* attempts to multiply again. So divide scaling ratio before calling
|
||||
* __set_clk_rate.
|
||||
*/
|
||||
rate = rate / MSM_VIDC_CLOCK_SOURCE_SCALING_RATIO;
|
||||
__set_clk_rate(core, cl, rate);
|
||||
}
|
||||
|
||||
rc = clk_prepare_enable(cl->clk);
|
||||
if (rc) {
|
||||
d_vpr_e("Failed to enable clocks\n");
|
||||
goto fail_clk_enable;
|
||||
}
|
||||
|
||||
if (!__clk_is_enabled(cl->clk))
|
||||
d_vpr_e("%s: clock %s not enabled\n",
|
||||
__func__, cl->name);
|
||||
|
||||
c++;
|
||||
d_vpr_h("Clock: %s prepared and enabled\n", cl->name);
|
||||
}
|
||||
|
||||
call_venus_op(core, clock_config_on_enable, core);
|
||||
return rc;
|
||||
|
||||
fail_clk_enable:
|
||||
venus_hfi_for_each_clock_reverse_continue(core, cl, c) {
|
||||
if (!cl->clk)
|
||||
continue;
|
||||
d_vpr_e("Clock: %s disable and unprepare\n",
|
||||
cl->name);
|
||||
clk_disable_unprepare(cl->clk);
|
||||
if (cl->has_scaling)
|
||||
__set_clk_rate(core, cl, 0);
|
||||
cl->prev = 0;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void __deinit_bus(struct msm_vidc_core *core)
|
||||
{
|
||||
struct bus_info *bus = NULL;
|
||||
@@ -1918,113 +1827,6 @@ static void __deinit_resources(struct msm_vidc_core *core)
|
||||
__deinit_regulators(core);
|
||||
}
|
||||
|
||||
static int __disable_regulator(struct regulator_info *rinfo,
|
||||
struct msm_vidc_core *core)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (!rinfo->regulator) {
|
||||
d_vpr_e("%s: invalid regulator\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
d_vpr_h("Disabling regulator %s\n", rinfo->name);
|
||||
|
||||
/*
|
||||
* This call is needed. Driver needs to acquire the control back
|
||||
* from HW in order to disable the regualtor. Else the behavior
|
||||
* is unknown.
|
||||
*/
|
||||
|
||||
rc = __acquire_regulator(core, rinfo);
|
||||
if (rc) {
|
||||
/*
|
||||
* This is somewhat fatal, but nothing we can do
|
||||
* about it. We can't disable the regulator w/o
|
||||
* getting it back under s/w control
|
||||
*/
|
||||
d_vpr_e("Failed to acquire control on %s\n",
|
||||
rinfo->name);
|
||||
|
||||
goto disable_regulator_failed;
|
||||
}
|
||||
|
||||
if (!regulator_is_enabled(rinfo->regulator))
|
||||
d_vpr_e("%s: regulator %s already disabled\n",
|
||||
__func__, rinfo->name);
|
||||
|
||||
rc = regulator_disable(rinfo->regulator);
|
||||
if (rc) {
|
||||
d_vpr_e("Failed to disable %s: %d\n",
|
||||
rinfo->name, rc);
|
||||
goto disable_regulator_failed;
|
||||
}
|
||||
|
||||
return 0;
|
||||
disable_regulator_failed:
|
||||
|
||||
/* Bring attention to this issue */
|
||||
__fatal_error(true);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int __enable_regulators(struct msm_vidc_core *core)
|
||||
{
|
||||
int rc = 0, c = 0;
|
||||
struct regulator_info *rinfo;
|
||||
|
||||
if (!core) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
d_vpr_h("Enabling regulators\n");
|
||||
|
||||
venus_hfi_for_each_regulator(core, rinfo) {
|
||||
if (!rinfo->regulator) {
|
||||
d_vpr_e("%s: invalid regulator\n", __func__);
|
||||
rc = -EINVAL;
|
||||
goto err_reg_enable_failed;
|
||||
}
|
||||
|
||||
rc = regulator_enable(rinfo->regulator);
|
||||
if (rc) {
|
||||
d_vpr_e("Failed to enable %s: %d\n",
|
||||
rinfo->name, rc);
|
||||
goto err_reg_enable_failed;
|
||||
}
|
||||
|
||||
if (!regulator_is_enabled(rinfo->regulator))
|
||||
d_vpr_e("%s: regulator %s not enabled\n",
|
||||
__func__, rinfo->name);
|
||||
|
||||
d_vpr_h("Enabled regulator %s\n",
|
||||
rinfo->name);
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_reg_enable_failed:
|
||||
venus_hfi_for_each_regulator_reverse_continue(core, rinfo, c) {
|
||||
if (!rinfo->regulator)
|
||||
continue;
|
||||
__disable_regulator(rinfo, core);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int __disable_regulators(struct msm_vidc_core *core)
|
||||
{
|
||||
struct regulator_info *rinfo;
|
||||
|
||||
d_vpr_h("Disabling regulators\n");
|
||||
venus_hfi_for_each_regulator_reverse(core, rinfo)
|
||||
__disable_regulator(rinfo, core);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __release_subcaches(struct msm_vidc_core *core)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -2075,7 +1877,7 @@ static int __release_subcaches(struct msm_vidc_core *core)
|
||||
venus_hfi_for_each_subcache_reverse(core, sinfo) {
|
||||
if (sinfo->isactive) {
|
||||
sinfo->isset = false;
|
||||
d_vpr_h("Release Subcache id %d size %d done\n",
|
||||
d_vpr_h("Release Subcache id %d size %lu done\n",
|
||||
sinfo->subcache->slice_id,
|
||||
sinfo->subcache->slice_size);
|
||||
}
|
||||
@@ -2196,7 +1998,7 @@ static int __set_subcaches(struct msm_vidc_core *core)
|
||||
venus_hfi_for_each_subcache(core, sinfo) {
|
||||
if (sinfo->isactive) {
|
||||
sinfo->isset = true;
|
||||
d_vpr_h("Set Subcache id %d size %d done\n",
|
||||
d_vpr_h("Set Subcache id %d size %lu done\n",
|
||||
sinfo->subcache->slice_id,
|
||||
sinfo->subcache->slice_size);
|
||||
}
|
||||
|
@@ -260,7 +260,7 @@ static bool check_for_packet_payload(struct msm_vidc_inst *inst,
|
||||
u32 payload_size = 0;
|
||||
|
||||
if (!inst || !pkt) {
|
||||
d_vpr_e("%s: invalid params %d\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ static bool check_last_flag(struct msm_vidc_inst *inst,
|
||||
struct hfi_buffer *buffer;
|
||||
|
||||
if (!inst || !pkt) {
|
||||
d_vpr_e("%s: invalid params %d\n", __func__);
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user