video: driver: add macros for kernel space logs

adding kernel space logs used by post processing
scripts as macros to avoid changes in them.

Change-Id: Iea0fb0514c134767f063902ff98fd756898ef7c4
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
This commit is contained in:
Deepa Guthyappa Madivalara
2022-04-14 10:59:00 -07:00
parent 2d69ee17ae
commit 7e9d5106f6
4 changed files with 25 additions and 15 deletions

View File

@@ -39,6 +39,18 @@ extern int msm_vidc_llc_bw;
extern bool msm_vidc_fw_dump;
extern unsigned int msm_vidc_enable_bugon;
/* do not modify the log message as it is used in test scripts */
#define FMT_STRING_SET_CTRL \
"%s: state %s, name %s, id 0x%x value %d\n"
#define FMT_STRING_STATE_CHANGE \
"%s: state changed to %s from %s\n"
#define FMT_STRING_MSG_SFR \
"SFR Message from FW: %s\n"
#define FMT_STRING_FAULT_HANDLER \
"%s: faulting address: %lx\n"
#define FMT_STRING_SET_CAP \
"set cap: name: %24s, cap value: %#10x, hfi: %#10x\n"
/* To enable messages OR these values and
* echo the result to debugfs file.
*

View File

@@ -282,23 +282,21 @@ static int msm_vidc_packetize_control(struct msm_vidc_inst *inst,
int rc = 0;
u64 payload = 0;
if (payload_size > sizeof(u32)) {
i_vpr_e(inst, "%s: payload size is more than u32 for cap[%d] %s\n",
func, cap_id, cap_name(cap_id));
return -EINVAL;
}
if (payload_size == sizeof(u32))
payload = *(u32 *)hfi_val;
else if (payload_size == sizeof(u64))
payload = *(u64 *)hfi_val;
else if (payload_size == sizeof(u8))
payload = *(u8 *)hfi_val;
else if (payload_size == sizeof(u16))
payload = *(u16 *)hfi_val;
if (payload_size <= sizeof(u64))
i_vpr_h(inst,
"set cap: name: %24s, cap value: %#10x, hfi: %#10x\n",
cap_name(cap_id), inst->capabilities->cap[cap_id].value, payload);
else
i_vpr_h(inst,
"set cap: name: %24s, hfi payload size %d\n",
cap_name(cap_id), payload_size);
i_vpr_h(inst, FMT_STRING_SET_CAP,
cap_name(cap_id), inst->capabilities->cap[cap_id].value, payload);
rc = venus_hfi_session_property(inst,
inst->capabilities->cap[cap_id].hfi_id,
@@ -1122,7 +1120,7 @@ int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl)
capability = inst->capabilities;
i_vpr_h(inst, "%s: state %s, name %s, id 0x%x value %d\n",
i_vpr_h(inst, FMT_STRING_SET_CTRL,
__func__, state_name(inst->state), ctrl->name, ctrl->id, ctrl->val);
if (!msm_vidc_allow_s_ctrl(inst, ctrl->id))

View File

@@ -1250,10 +1250,10 @@ int msm_vidc_change_inst_state(struct msm_vidc_inst *inst,
}
if (request_state == MSM_VIDC_ERROR)
i_vpr_e(inst, "%s: state changed to %s from %s\n",
i_vpr_e(inst, FMT_STRING_STATE_CHANGE,
func, state_name(request_state), state_name(inst->state));
else
i_vpr_h(inst, "%s: state changed to %s from %s\n",
i_vpr_h(inst, FMT_STRING_STATE_CHANGE,
func, state_name(request_state), state_name(inst->state));
trace_msm_vidc_common_state_change(inst, func, state_name(inst->state),
@@ -5054,7 +5054,7 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain,
}
}
d_vpr_e("%s: faulting address: %lx\n", __func__, iova);
d_vpr_e(FMT_STRING_FAULT_HANDLER, __func__, iova);
core->smmu_fault_handled = true;

View File

@@ -78,7 +78,7 @@ static void print_sfr_message(struct msm_vidc_core *core)
if (p == NULL)
vsfr->rg_data[vsfr_size - 1] = '\0';
d_vpr_e("SFR Message from FW: %s\n", vsfr->rg_data);
d_vpr_e(FMT_STRING_MSG_SFR, vsfr->rg_data);
}
}