decoder: fix avs && h265 vts timeout issue

PD#163674: fix avs && h265 vts timeout issue
1.remove some print info
2.use sema instead of sleep 20ms to save time in vmh265_stop

Change-Id: I17d0a23da75933a02e20500b26d783255761d9a6
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
This commit is contained in:
Yao.Liu
2018-04-09 21:29:12 +08:00
committed by Dongjin Kim
parent dec79ab908
commit 58175e2f66
3 changed files with 22 additions and 15 deletions

View File

@@ -14,6 +14,7 @@
* more details.
*
*/
#define DEBUG
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
@@ -1102,7 +1103,7 @@ static int vavs_prot_init(void)
#ifdef ENABLE_USER_DATA
WRITE_VREG(AV_SCRATCH_N, (u32)(user_data_buffer_phys - buf_offset));
pr_info("AV_SCRATCH_N = 0x%x\n", READ_VREG(AV_SCRATCH_N));
pr_debug("AV_SCRATCH_N = 0x%x\n", READ_VREG(AV_SCRATCH_N));
#endif
return r;
@@ -1517,7 +1518,7 @@ static s32 vavs_init(void)
}
if (size == 1)
pr_info ("tee load ok");
pr_info("tee load ok\n");
if (get_cpu_type() >= MESON_CPU_MAJOR_ID_GXM)
size = amvdec_loadmc_ex(VFORMAT_AVS, "avs_gxm", buf);
@@ -1641,7 +1642,7 @@ static int amvdec_avs_probe(struct platform_device *pdev)
__func__);
return -ENOMEM;
}
pr_info("user_data_buffer = 0x%p, user_data_buffer_phys = 0x%x\n",
pr_debug("user_data_buffer = 0x%p, user_data_buffer_phys = 0x%x\n",
user_data_buffer, (u32)user_data_buffer_phys);
}
#endif
@@ -1749,9 +1750,9 @@ static int amvdec_avs_remove(struct platform_device *pdev)
mm_blk_handle = NULL;
}
#ifdef DEBUG_PTS
pr_info("pts hit %d, pts missed %d, i hit %d, missed %d\n", pts_hit,
pr_debug("pts hit %d, pts missed %d, i hit %d, missed %d\n", pts_hit,
pts_missed, pts_i_hit, pts_i_missed);
pr_info("total frame %d, avi_flag %d, rate %d\n", total_frame, avi_flag,
pr_debug("total frame %d, avi_flag %d, rate %d\n", total_frame, avi_flag,
vavs_amstream_dec_info.rate);
#endif
kfree(gvs);

View File

@@ -49,6 +49,7 @@
/*#define TEST_NO_BUF*/
/*#define HEVC_PIC_STRUCT_SUPPORT*/
#define MULTI_INSTANCE_SUPPORT
#define USE_UNINIT_SEMA
/* .buf_size = 0x100000*16,
//4k2k , 0x100000 per buffer */
@@ -8501,7 +8502,7 @@ static int h265_task_handle(void *data)
hevc_print(hevc, 0, "uninit list\n");
hevc->uninit_list = 0;
#ifdef USE_UNINIT_SEMA
if (use_cma)
if (use_cma && hevc->init_flag)
up(&hevc->h265_uninit_done_sema);
#endif
}
@@ -9024,8 +9025,10 @@ static int vh265_stop(struct hevc_state_s *hevc)
hevc->uninit_list = 1;
up(&h265_sema);
#ifdef USE_UNINIT_SEMA
ret = down_interruptible(
&hevc->h265_uninit_done_sema);
if (hevc->init_flag) {
ret = down_interruptible(
&hevc->h265_uninit_done_sema);
}
#else
while (hevc->uninit_list) /* wait uninit complete */
msleep(20);
@@ -9139,8 +9142,10 @@ static int vmh265_stop(struct hevc_state_s *hevc)
reset_process_time(hevc);
vdec_schedule_work(&hevc->work);
#ifdef USE_UNINIT_SEMA
ret = down_interruptible(
&hevc->h265_uninit_done_sema);
if (hevc->init_flag) {
ret = down_interruptible(
&hevc->h265_uninit_done_sema);
}
#else
while (hevc->uninit_list) /* wait uninit complete */
msleep(20);
@@ -9229,8 +9234,9 @@ static void vh265_work(struct work_struct *work)
hevc_print(hevc, 0, "uninit list\n");
hevc->uninit_list = 0;
#ifdef USE_UNINIT_SEMA
if (use_cma)
if (use_cma && hevc->init_flag) {
up(&hevc->h265_uninit_done_sema);
}
#endif
return;
}

View File

@@ -14,7 +14,7 @@
* more details.
*
*/
#define DEBUG
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
@@ -1057,7 +1057,7 @@ static s32 vvc1_init(void)
}
if (size == 1)
pr_info ("tee load ok");
pr_info("tee load ok\n");
else if (amvdec_loadmc_ex(VFORMAT_VC1, NULL, buf) < 0) {
amvdec_disable();
vfree(buf);
@@ -1180,9 +1180,9 @@ static int amvdec_vc1_remove(struct platform_device *pdev)
}
#ifdef DEBUG_PTS
pr_info("pts hit %d, pts missed %d, i hit %d, missed %d\n", pts_hit,
pr_debug("pts hit %d, pts missed %d, i hit %d, missed %d\n", pts_hit,
pts_missed, pts_i_hit, pts_i_missed);
pr_info("total frame %d, avi_flag %d, rate %d\n",
pr_debug("total frame %d, avi_flag %d, rate %d\n",
total_frame, avi_flag,
vvc1_amstream_dec_info.rate);
#endif