vdin: dv debug optimize [1/1]

PD#SWPL-129268

Problem:
dv log need optimize

Solution:
dv debug optimize

Verify:
t5m

Change-Id: Ia0ae20a66207fea6c8346c075a437416b519b79a
Signed-off-by: qiang.liu <qiang.liu@amlogic.com>
This commit is contained in:
qiang.liu
2023-08-04 20:55:03 +08:00
committed by gerrit autosubmit
parent eed779ee21
commit a5a061b4b2
4 changed files with 39 additions and 39 deletions
+31 -33
View File
@@ -5422,10 +5422,11 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
u32 crc1 = 0;
u32 max_pkt = 15;
static u32 cnt;
u32 rpt_cnt = 0, tail_cnt = 0, rev_cnt = 0, end_flag = 0;
u32 rpt_cnt = 0; //start type pkt num
u32 tail_cnt = 0, rev_cnt = 0, end_flag = 0;
u8 pkt_type;
struct dv_meta_pkt *pkt_p;
u32 cp_size, cp_offset, cp_sum = 0;
u32 cp_size = 0, cp_offset = 0, cp_sum = 0;
u32 *src_meta = devp->dv.meta_data_raw_buffer1;
devp->dv.dv_crc_check = true;
@@ -5506,8 +5507,9 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
}
if (((cnt % dv_dbg_log_du) == 0) &&
(dv_dbg_log & DV_DEBUG_NORMAL))
pr_info("pkt_type %d:0x%x\n", i,
pkt_type);
pr_info("pkt_type(%d-%d):%02x %02x %02x %02x %02x %02x\n",
count, i, pkt_type, c[i * 4], c[i * 4 + 1],
c[i * 4 + 2], c[i * 4 + 3], c[i * 4 + 4]);
}
if (i == 31 && multimeta_flag == 0)
@@ -5515,13 +5517,21 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
}
}
//print raw meta data
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_META_PKT_DATA)) {
vdin_dv_pr_meta_data(c, 128 * 2, index);
pr_info("raw data(%d-%d) rpt_cnt:%d tail_cnt:%d rev_cnt:%d max_pkt:%d\n",
devp->irq_cnt, count, rpt_cnt, tail_cnt, rev_cnt, max_pkt);
}
meta_size = (c[3] << 8) | c[4];
if (meta_size > 1024 || rev_cnt > 20 ||
rpt_cnt != tail_cnt ||
(meta_size > 128 && rev_cnt == 1)) {
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_NORMAL))
pr_info("err size:%d rp_cnt:%d, tal_cnt:%d, rv_cnt:%d max_pkt:%d\n",
meta_size, rpt_cnt, tail_cnt, rev_cnt, max_pkt);
pr_info("err:%d-%d-%d size:%d rpt:%d tal:%d rv_cnt:%d max_pkt:%d\n",
devp->irq_cnt, index, count, meta_size, rpt_cnt,
tail_cnt, rev_cnt, max_pkt);
devp->dv.dv_crc_check = false;
return;
@@ -5546,10 +5556,6 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
crc1 = pkt_p->crc;
crc1_r = crc32(0, (char *)pkt_p, 124);
crc1_r = swap32(crc1_r);
if (((cnt % dv_dbg_log_du) == 0) &&
(dv_dbg_log & DV_DEBUG_NORMAL))
pr_info("crc:0x%x, 0x%x\n",
crc1, crc1_r);
if (crc1 == crc1_r) {
cp_offset += j + 128 * i;
memcpy(cp,
@@ -5562,7 +5568,7 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
if (rpt_cnt == 0)
break;
if (((cnt % dv_dbg_log_du) == 0) &&
(dv_dbg_log & DV_DEBUG_NORMAL))
(dv_dbg_log & DV_DEBUG_HW_META_DATA))
pr_info("data idx %d:0x%x\n",
j, c[j] & 0xc0);
}
@@ -5573,10 +5579,11 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
}
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_NORMAL)) {
pr_info("mult_flag=%d tail_flag=%d meta_size=%d\n",
multimeta_flag, multimetatail_flag, meta_size);
pr_info("rpt_cnt:%d tail_cnt:%d rev_cnt:%d cp_sum:%d\n",
rpt_cnt, tail_cnt, rev_cnt, cp_sum);
pr_info("irq_cnt:%d count:%d mult_flag=%d tail_flag=%d crc:(%#x:%#x %#x:%#x)\n",
devp->irq_cnt, count, multimeta_flag, multimetatail_flag,
crc, crc_r, crc1, crc1_r);
pr_info("meta_size:%d rpt_cnt:%d tail_cnt:%d rev_cnt:%d pkt:%d cp_sum:%d\n",
meta_size, rpt_cnt, tail_cnt, rev_cnt, max_pkt, cp_sum);
}
if (crc == crc_r) {
@@ -5590,10 +5597,6 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
}
}
/*meta data pkt data*/
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_META_PKT_DATA))
vdin_dv_pr_meta_data(c, 128 * rev_cnt, index);
if (crc != crc_r ||
(multimeta_flag == 1 && multimetatail_flag == 1 &&
crc1 != crc1_r)) {
@@ -5602,15 +5605,14 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
*/
devp->vfp->dv_buf[index] = &c[5];
devp->vfp->dv_buf_size[index] = 4;
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_ERR_META_DATA)) {
pr_err("%s:hdmi dovi meta crc error:%08x!=%08x\n",
__func__, crc, crc_r);
pr_info("%s:index:%d dma:%x vaddr:%p size:%d\n",
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_NORMAL)) {
pr_err("%s irq:%d meta crc error(%#x:%#x %#x:%#x)\n",
__func__, devp->irq_cnt, crc, crc_r, crc1, crc1_r);
pr_info("%s index:%d dma:%x vaddr:%p size:%d\n",
__func__, index,
devp->vfp->dv_buf_mem[index],
devp->vfp->dv_buf_vmem[index],
meta_size);
vdin_dv_pr_meta_data(p, 128, index);
}
devp->dv.dv_crc_check = false;
} else {
@@ -5622,18 +5624,14 @@ void vdin_dolby_buffer_update(struct vdin_dev_s *devp, unsigned int index)
cp = devp->dv.temp_meta_data;
memcpy(c, cp, meta_size);
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_NORMAL))
pr_info("cp %d meta to buff\n", meta_size);
pr_info("irq:%d cp %d meta to buff ok\n", devp->irq_cnt, meta_size);
} else if (meta_size > DV_META_SINGLE_PKT_SIZE) {
devp->dv.dv_crc_check = false;
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_NORMAL))
pr_info("irq:%d cp %d meta to buff ng\n", devp->irq_cnt, meta_size);
}
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_NORMAL))
pr_info("%s:index:%d dma:%x vaddr:%p size:%d crc:%x crc1:%x\n",
__func__, index,
devp->vfp->dv_buf_mem[index],
devp->vfp->dv_buf_vmem[index],
meta_size, crc, crc1);
/*meta data raw data*/
/* print meta data packet body */
if (((cnt % dv_dbg_log_du) == 0) && (dv_dbg_log & DV_DEBUG_OK_META_DATA))
vdin_dv_pr_meta_data(c, meta_size, index);
}
@@ -5966,7 +5964,7 @@ int vdin_event_cb(int type, void *data, void *op_arg)
spin_unlock_irqrestore(&p->dv_lock, flags);
if (dv_dbg_log & DV_DEBUG_EVENT_META_DATA) {
pr_info("%s(type 0x%x vf index 0x%x)=>size 0x%x\n",
pr_info("%s(type %#x vf index %#x)=>size %#x\n",
__func__, type, index, req->aux_size);
vdin_dv_pr_event_meta_data(req->aux_buf,
req->aux_size, index);
+5 -4
View File
@@ -78,11 +78,12 @@
#define DV_DEBUG_NORMAL (BIT(0))
#define DV_DEBUG_ERR_META_DATA (BIT(3))
#define DV_DEBUG_OK_META_DATA (BIT(4))
#define DV_DEBUG_META_PKT_DATA (BIT(5))
#define DV_DEBUG_RAW_DATA (BIT(6))
#define DV_DEBUG_OK_META_DATA (BIT(4)) //print meta data packet body
#define DV_DEBUG_META_PKT_DATA (BIT(5)) //print raw meta data
#define DV_DEBUG_RAW_DATA (BIT(6)) //print tvin_dv_vsif_raw_s
#define DV_DEBUG_CANVAS_NUM (BIT(7))
#define DV_DEBUG_EVENT_META_DATA (BIT(8))
#define DV_DEBUG_EVENT_META_DATA (BIT(8)) //print dv get data
#define DV_DEBUG_HW_META_DATA (BIT(9))
#define CTL_DEBUG_NORMAL (BIT(0))
#define CTL_DEBUG_EVENT_INDEX (BIT(2))
+2 -1
View File
@@ -1881,7 +1881,8 @@ static void vdin_dump_state(struct vdin_dev_s *devp)
devp->prop.vtem_data.base_framerate);
pr_info("vdin_vrr_flag: pre=%d,cur:%d\n", devp->pre_prop.vdin_vrr_flag,
devp->prop.vdin_vrr_flag);
pr_info("vdin_pc_mode:%d force_pc_mode:%d\n", vdin_pc_mode, devp->debug.force_pc_mode);
pr_info("vdin_pc_mode:%d vdin_cur_mode:%d force_pc_mode:%d\n", vdin_pc_mode,
devp->vdin_pc_mode, devp->debug.force_pc_mode);
pr_info("afbce_flag: %#x %#x\n", devp->dts_config.afbce_flag_cfg, devp->afbce_flag);
pr_info("afbce_mode: %d, afbce_valid: %d\n", devp->afbce_mode,
+1 -1
View File
@@ -611,7 +611,7 @@ struct vdin_dv_s {
void *meta_data_raw_v_buffer0;/*for t7*/
void *meta_data_raw_buffer1;/*for t7*/
unsigned int dv_flag_cnt;/*cnt for no dv input*/
u8 dv_flag;
u8 dv_flag; /*is signal dolby version 1:vsif 2:emp */
bool dv_config;
bool dv_path_idx;
bool dv_crc_check;/*0:fail;1:ok*/