********************************/
static int firmware_sel;
static int disable_longcabac_trans = 1;
-static int pre_decode_buf_level = 0x20000;
+static int pre_decode_buf_level = 0x800;
static struct vframe_s *vavs_vf_peek(void *);
u32 old_udebug_flag;
u32 decode_status_skip_pic_done_flag;
u32 decode_decode_cont_start_code;
- int cc_init_flag;
};
static void reset_process_time(struct vdec_avs_hw_s *hw);
#endif
#ifdef ENABLE_USER_DATA
- if (hw->cc_init_flag == 0) {
- hw->cc_init_flag++;
+ if (hw->decode_pic_count == 0) {
WRITE_VREG(AV_SCRATCH_N, (u32)(hw->user_data_buffer_phys - hw->buf_offset));
pr_debug("AV_SCRATCH_N = 0x%x\n", READ_VREG(AV_SCRATCH_N));
} else
run_count[DECODE_ID(hw)] >= max_run_count[DECODE_ID(hw)])
return 0;
#endif
- if (vdec_stream_based(vdec)
+ if (vdec_stream_based(vdec) && (hw->init_flag == 0)
&& pre_decode_buf_level != 0) {
u32 rp, wp, level;
}
}
-
if (hw->reset_decode_flag == 0 &&
hw->again_flag == 0 &&
(hw->buf_status & buf_busy_mask) == buf_busy_mask) {
userdata_push_process(hw);
return;
} else if (hw->dec_result == DEC_RESULT_DONE) {
- hw->buf_recycle_status = 0;
+
if (!hw->ctx_valid)
hw->ctx_valid = 1;
#ifdef DEBUG_MULTI_FRAME_INS
del_timer_sync(&hw->check_timer);
hw->stat &= ~STAT_TIMER_ARM;
}
-
+ if (hw->dec_result == DEC_RESULT_DONE)
+ hw->buf_recycle_status = 0;
+ debug_print(hw, PRINT_FLAG_RUN_FLOW, "work end %d\n", hw->dec_result);
if (vdec->parallel_dec == 1)
vdec_core_finish_run(hw_to_vdec(hw), CORE_MASK_VDEC_1);
else
}
/*recycle*/
- if (!hw->m_ins_flag ||
- hw->dec_result == DEC_RESULT_NONE ||
- hw->dec_result == DEC_RESULT_USERDATA) {
+ if (!hw->m_ins_flag) {
spin_lock_irqsave(&lock, flags);
recycle_frame_bufferin(hw);
spin_unlock_irqrestore(&lock, flags);
int save_reg = READ_VREG(POWER_CTL_VLD);
int size, ret;
/* 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)) {
hw->pre_parser_wr_ptr =
STBUF_READ(&vdec->vbuf, get_wp);
(hw->decode_pic_count & 0xffff) |
((~hw->buf_recycle_status) << 16));
}
- if (hw->again_flag == 0)
- hw->buf_recycle_status = 0;
+
hw->reset_decode_flag = 0;
- hw->decode_status_skip_pic_done_flag = 0;
+ //hw->decode_status_skip_pic_done_flag = 0;
start_process_time(hw);
#if DEBUG_MULTI_FLAG == 1
if (hw->decode_pic_count > 0)
}
}*/
+ debug_print(hw, PRINT_FLAG_RUN_FLOW, "READ_VREG(AVS_BUFFEROUT) 0x%x, READ_VREG(DECODE_STATUS) 0x%x READ_VREG(AV_SCRATCH_N) 0x%x, READ_VREG(DEBUG_REG1) 0x%x\n",
+ READ_VREG(AVS_BUFFEROUT),READ_VREG(DECODE_STATUS), READ_VREG(AV_SCRATCH_N), READ_VREG(DEBUG_REG1));
+
debug_tag = READ_VREG(DEBUG_REG1);
buffer_status_debug = debug_tag >> 16;
debug_tag &= 0xffff;
hw->pic_type = 2;
if ((picture_type == I_PICTURE) && pts_valid) {
vf->pts = pts;
+ vf->pts_us64 = pts_us64;
if ((repeat_count > 1) && hw->avi_flag) {
/* hw->next_pts = pts +
* (hw->vavs_amstream_dec_info.rate *
hw->next_pts = 0;
} else {
vf->pts = hw->next_pts;
+ if (vf->pts == 0) {
+ vf->pts_us64 = 0;
+ }
if ((repeat_count > 1) && hw->avi_flag) {
/* vf->duration =
* hw->vavs_amstream_dec_info.rate *
debug_print(hw, PRINT_FLAG_VFRAME_DETAIL,
"buffer_index %d, canvas addr %x\n",
buffer_index, vf->canvas0Addr);
- vf->pts_us64 = (pts_valid) ? pts_us64 : 0;
+ vf->pts = (pts_valid)?pts:0;
+ //vf->pts_us64 = (pts_valid) ? pts_us64 : 0;
hw->vfbuf_use[buffer_index]++;
vf->mem_handle =
decoder_bmmu_box_get_mem_handle(
if (hw->m_ins_flag && vdec_frame_based(hw_to_vdec(hw)))
set_vframe_pts(hw, decode_pic_count, vf);
+
if (vdec_stream_based(vdec) && (!vdec->vbuf.use_ptsserv)) {
vf->pts_us64 = offset;
vf->pts = 0;
}
+
+ debug_print(hw, PRINT_FLAG_PTS,
+ "interlace1 vf->pts = %d, vf->pts_us64 = %lld, pts_valid = %d\n", vf->pts, vf->pts_us64, pts_valid);
kfifo_put(&hw->display_q,
(const struct vframe_s *)vf);
avs_vf_notify_receiver(hw, PROVIDER_NAME,
vf->pts = 0;
else
vf->pts = hw->next_pts;
-
+
+ if (vf->pts == 0) {
+ vf->pts_us64 = 0;
+ }
+
if ((repeat_count > 1) && hw->avi_flag) {
/* vf->duration = hw->vavs_amstream_dec_info.rate *
* repeat_count >> 1;
vf->pts_us64 = offset;
vf->pts = 0;
}
+ debug_print(hw, PRINT_FLAG_PTS,
+ "interlace2 vf->pts = %d, vf->pts_us64 = %lld, pts_valid = %d\n", vf->pts, vf->pts_us64, pts_valid);
kfifo_put(&hw->display_q,
(const struct vframe_s *)vf);
avs_vf_notify_receiver(hw, PROVIDER_NAME,
hw->next_pts = 0;
} else {
vf->pts = hw->next_pts;
+ if (vf->pts == 0) {
+ vf->pts_us64 = 0;
+ }
if ((repeat_count > 1) && hw->avi_flag) {
/* vf->duration =
* hw->vavs_amstream_dec_info.rate *
index2canvas(buffer_index);
vf->type_original = vf->type;
- vf->pts_us64 = (pts_valid) ? pts_us64 : 0;
+ vf->pts = (pts_valid)?pts:0;
+ //vf->pts_us64 = (pts_valid) ? pts_us64 : 0;
debug_print(hw, PRINT_FLAG_VFRAME_DETAIL,
"buffer_index %d, canvas addr %x\n",
buffer_index, vf->canvas0Addr);
-
+ debug_print(hw, PRINT_FLAG_PTS,
+ "progressive vf->pts = %d, vf->pts_us64 = %lld, pts_valid = %d\n", vf->pts, vf->pts_us64, pts_valid);
hw->vfbuf_use[buffer_index]++;
vf->mem_handle =
decoder_bmmu_box_get_mem_handle(
if (decode_status == DECODE_STATUS_SKIP_PIC_DONE) {
hw->decode_status_skip_pic_done_flag = 1;
hw->decode_decode_cont_start_code = (status_reg >> 8) & 0xff;
- }
+ } else
+ hw->decode_status_skip_pic_done_flag = 0;
hw->decode_pic_count++;
if ((hw->decode_pic_count & 0xffff) == 0) {
/*make ucode do not handle it as first picture*/
hw->dec_result = DEC_RESULT_AGAIN;
debug_print(hw, PRINT_FLAG_DECODING,
- "%s BUF_EMPTY, READ_VREG(DECODE_STATUS) = 0x%x, decode_status 0x%x, buf_status 0x%x, scratch_8 (AVS_BUFFERIN) 0x%x, dec_result = 0x%x, decode_pic_count = %d, bit_cnt=0x%x\n",
+ "%s BUF_EMPTY, READ_VREG(DECODE_STATUS) = 0x%x, decode_status 0x%x, buf_status 0x%x, scratch_8 (AVS_BUFFERIN) 0x%x, dec_result = 0x%x, decode_pic_count = %d, bit_cnt=0x%x, hw->decode_status_skip_pic_done_flag = %d, hw->decode_decode_cont_start_code = 0x%x\n",
__func__, status_reg, decode_status,
hw->buf_status,
hw->reg_scratch_8,
hw->dec_result, hw->decode_pic_count,
- READ_VREG(VIFF_BIT_CNT));
+ READ_VREG(VIFF_BIT_CNT), hw->decode_status_skip_pic_done_flag, hw->decode_decode_cont_start_code);
vdec_schedule_work(&hw->work);
return IRQ_HANDLED;
}
module_param(udebug_pause_ins_id, uint, 0664);
MODULE_PARM_DESC(udebug_pause_ins_id, "\n udebug_pause_ins_id\n");
+
module_param(start_decoding_delay, uint, 0664);
MODULE_PARM_DESC(start_decoding_delay, "\n start_decoding_delay\n");