u32 old_udebug_flag;
u32 decode_status_skip_pic_done_flag;
u32 decode_decode_cont_start_code;
+ int vdec_pg_enable_flag;
};
static void reset_process_time(struct vdec_avs_hw_s *hw);
//hw->stat |= STAT_TIMER_INIT;
- amvdec_enable();
+ //amvdec_enable();
//vdec_enable_DMC(NULL);
hw->fw = NULL;
}
- amvdec_disable();
+ //amvdec_disable();
//vdec_disable_DMC(NULL);
hw->pic_type = 0;
{
struct vdec_avs_hw_s *hw =
(struct vdec_avs_hw_s *)vdec->private;
- int save_reg = READ_VREG(POWER_CTL_VLD);
+ int save_reg;
int size, ret;
+ if (!hw->vdec_pg_enable_flag) {
+ hw->vdec_pg_enable_flag = 1;
+ amvdec_enable();
+ }
+ save_reg = READ_VREG(POWER_CTL_VLD);
/* reset everything except DOS_TOP[1] and APB_CBUS[0]*/
debug_print(hw, PRINT_FLAG_RUN_FLOW,"run in\n");
if (vdec_stream_based(vdec)) {
bool enable_fence;
int fence_usage;
bool discard_dv_data;
+ int vdec_pg_enable_flag;
};
static u32 again_threshold;
INIT_WORK(&hw->user_data_ready_work, user_data_ready_notify_work);
#endif
- if (!amvdec_enable_flag) {
+ /*if (!amvdec_enable_flag) {
amvdec_enable_flag = true;
amvdec_enable();
if (hw->mmu_enable)
amhevc_enable();
- }
+ }*/
if (hw->mmu_enable) {
hw->frame_mmu_map_addr =
if (!hw->mc_cpu_addr) {
amvdec_enable_flag = false;
amvdec_disable();
+ hw->vdec_pg_enable_flag = 0;
if (hw->mmu_enable)
amhevc_disable();
pr_info("vh264_init: Can not allocate mc memory.\n");
(struct vdec_h264_hw_s *)vdec->private;
struct h264_dpb_stru *p_H264_Dpb = &hw->dpb;
int size, ret = -1;
-
+ if (!hw->vdec_pg_enable_flag) {
+ hw->vdec_pg_enable_flag = 1;
+ amvdec_enable();
+ if (hw->mmu_enable)
+ amhevc_enable();
+ }
run_count[DECODE_ID(hw)]++;
vdec_reset_core(vdec);
if (hw->mmu_enable)
if (ret < 0) {
amvdec_enable_flag = false;
amvdec_disable();
-
+ hw->vdec_pg_enable_flag = 0;
dpb_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
"MH264 the %s fw loading failed, err: %x\n",
tee_enabled() ? "TEE" : "local", ret);
if (ret < 0) {
amvdec_enable_flag = false;
amhevc_disable();
-
dpb_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
"MH264_MMU the %s fw loading failed, err: %x\n",
tee_enabled() ? "TEE" : "local", ret);
u32 profile_idc;
u32 level_idc;
int dec_again_cnt;
+ int vdec_pg_enable_flag;
};
static void vmpeg12_local_init(struct vdec_mpeg12_hw_s *hw);
static int vmpeg12_hw_ctx_restore(struct vdec_mpeg12_hw_s *hw);
hw->user_data_buffer,
USER_DATA_SIZE);
- amvdec_enable();
+ //amvdec_enable();
init_timer(&hw->check_timer);
hw->check_timer.data = (unsigned long)hw;
hw->check_timer.function = check_timer_func;
{
struct vdec_mpeg12_hw_s *hw =
(struct vdec_mpeg12_hw_s *)vdec->private;
- //int save_reg = READ_VREG(POWER_CTL_VLD);
+ int save_reg;
int size, ret;
-
+ if (!hw->vdec_pg_enable_flag) {
+ hw->vdec_pg_enable_flag = 1;
+ amvdec_enable();
+ }
+ save_reg = READ_VREG(POWER_CTL_VLD);
/* reset everything except DOS_TOP[1] and APB_CBUS[0]*/
- //WRITE_VREG(DOS_SW_RESET0, 0xfffffff0);
- //WRITE_VREG(DOS_SW_RESET0, 0);
- //WRITE_VREG(POWER_CTL_VLD, save_reg);
+ WRITE_VREG(DOS_SW_RESET0, 0xfffffff0);
+ WRITE_VREG(DOS_SW_RESET0, 0);
+ WRITE_VREG(POWER_CTL_VLD, save_reg);
hw->run_count++;
vdec_reset_core(vdec);
hw->vdec_cb_arg = arg;
unsigned int b_concealed_frames;
u32 profile_idc;
u32 level_idc;
+ int vdec_pg_enable_flag;
};
static void vmpeg4_local_init(struct vdec_mpeg4_hw_s *hw);
static int vmpeg4_hw_ctx_restore(struct vdec_mpeg4_hw_s *hw);
pr_info("%s\n", __func__);
- amvdec_enable();
+ //amvdec_enable();
init_timer(&hw->check_timer);
hw->check_timer.data = (unsigned long)hw;
{
struct vdec_mpeg4_hw_s *hw = (struct vdec_mpeg4_hw_s *)vdec->private;
int size = 0, ret = 0;
-
+ if (!hw->vdec_pg_enable_flag) {
+ hw->vdec_pg_enable_flag = 1;
+ amvdec_enable();
+ }
hw->run_count++;
hw->vdec_cb_arg = arg;
hw->vdec_cb = callback;