if (dec->eos)
return ret;
- if (work_pending(&dec->work) ||
- work_busy(&dec->work)) {
- avs2_print(dec, PRINT_FLAG_VDEC_DETAIL,
- "avs2 work pending,not ready for run.\n");
- return 0;
- }
if (!dec->first_sc_checked) {
int size = decoder_mmu_box_sc_check(dec->mmu_box, tvp);
dec->first_sc_checked = 1;
int ret = 1;
unsigned buf_busy_mask = (1 << hw->vf_buf_num_used) - 1;
- if (work_pending(&hw->work) ||
- work_busy(&hw->work)) {
- debug_print(hw, PRINT_FLAG_RUN_FLOW,
- "avs work pending,not ready for run.\n");
- return 0;
- }
-
#ifdef DEBUG_MULTI_FRAME_INS
if ((DECODE_ID(hw) == 0) && run_count[0] > run_count[1] &&
run_count[1] < max_run_count[1])
struct dec_sysinfo vh264_amstream_dec_info;
int dec_result;
+ u32 timeout_processing;
struct work_struct work;
struct work_struct notify_work;
struct work_struct timeout_work;
*/
if (work_pending(&hw->work) ||
work_busy(&hw->work) ||
- work_pending(&hw->timeout_work) ||
- work_busy(&hw->timeout_work)) {
+ work_busy(&hw->timeout_work) ||
+ work_pending(&hw->timeout_work)) {
pr_err("%s h264[%d] work pending, do nothing.\n",__func__, vdec->id);
return;
}
if (work_pending(&hw->work))
return;
+ hw->timeout_processing = 1;
vh264_work_implement(hw, vdec, 1);
+
}
static unsigned long run_ready(struct vdec_s *vdec, unsigned long mask)
int tvp = vdec_secure(hw_to_vdec(hw)) ?
CODEC_MM_FLAGS_TVP : 0;
- if (work_pending(&hw->work) ||
- work_busy(&hw->work) ||
- work_pending(&hw->timeout_work) ||
- work_busy(&hw->timeout_work)) {
+ if (hw->timeout_processing &&
+ (work_pending(&hw->work) || work_busy(&hw->work) ||
+ work_pending(&hw->timeout_work) || work_busy(&hw->timeout_work))) {
dpb_print(DECODE_ID(hw), PRINT_FLAG_VDEC_DETAIL,
"h264 work pending, not ready for run.\n");
return 0;
}
+ hw->timeout_processing = 0;
if (!hw->first_sc_checked && hw->mmu_enable) {
int size = decoder_mmu_box_sc_check(hw->mmu_box, tvp);
hw->first_sc_checked =1;
void *vdec_cb_arg;
struct vframe_chunk_s *chunk;
int dec_result;
+ u32 timeout_processing;
struct work_struct work;
struct work_struct timeout_work;
struct work_struct notify_work;
*/
if (work_pending(&hevc->work) ||
work_busy(&hevc->work) ||
- work_pending(&hevc->timeout_work) ||
+ work_busy(&hevc->timeout_work) ||
work_pending(&hevc->timeout_work)) {
pr_err("%s h265[%d] work pending, do nothing.\n",__func__, hevc->index);
return;
if (run_ready(vdec, VDEC_HEVC)) {
int r;
int decode_size;
+
r = vdec_prepare_input(vdec, &hevc->chunk);
if (r < 0) {
hevc->dec_result = DEC_RESULT_GET_DATA_RETRY;
if (work_pending(&hevc->work))
return;
+ hevc->timeout_processing = 1;
vh265_work_implement(hevc, vdec, 1);
}
if (hevc->eos)
return 0;
- if (work_pending(&hevc->work) ||
+ if (hevc->timeout_processing &&
+ (work_pending(&hevc->work) ||
work_busy(&hevc->work) ||
- work_pending(&hevc->timeout_work) ||
- work_pending(&hevc->timeout_work)) {
+ work_busy(&hevc->timeout_work) ||
+ work_pending(&hevc->timeout_work))) {
hevc_print(hevc, PRINT_FLAG_VDEC_STATUS,
"h265 work pending,not ready for run.\n");
return 0;
}
+ hevc->timeout_processing = 0;
if (!hevc->first_sc_checked && hevc->mmu_enable) {
int size = decoder_mmu_box_sc_check(hevc->mmu_box, tvp);
hevc->first_sc_checked =1;
hw->not_run_ready++;
if (hw->eos)
return 0;
- if (work_pending(&hw->work) ||
- work_busy(&hw->work)) {
- mmjpeg_debug_print(DECODE_ID(hw), PRINT_FLAG_RUN_FLOW,
- "mjpeg work pending,not ready for run.\n");
- return 0;
- }
if (vdec_stream_based(vdec) && (hw->init_flag == 0)
&& pre_decode_buf_level != 0) {
u32 rp, wp, level;
s32 refs[2];
int dec_result;
+ u32 timeout_processing;
struct work_struct work;
struct work_struct timeout_work;
struct work_struct notify_work;
amvdec_stop();
hw->stat &= ~STAT_VDEC_RUN;
}
+ /*disable mbox interrupt */
+ WRITE_VREG(ASSIST_MBOX1_MASK, 0);
+ del_timer_sync(&hw->check_timer);
+ hw->stat &= ~STAT_TIMER_ARM;
+ wait_vmmpeg12_search_done(hw);
if (from == 1) {
/*This is a timeout work*/
}
}
- /*disable mbox interrupt */
- WRITE_VREG(ASSIST_MBOX1_MASK, 0);
- wait_vmmpeg12_search_done(hw);
if (vdec->parallel_dec == 1)
vdec_core_finish_run(vdec, CORE_MASK_VDEC_1);
else
vdec_core_finish_run(vdec, CORE_MASK_VDEC_1 | CORE_MASK_HEVC);
- del_timer_sync(&hw->check_timer);
- hw->stat &= ~STAT_TIMER_ARM;
if (hw->is_used_v4l) {
struct aml_vcodec_ctx *ctx =
return;
}
+ hw->timeout_processing = 1;
vmpeg12_work_implement(hw, vdec, 1);
}
if (work_pending(&hw->work) ||
work_busy(&hw->work) ||
- work_pending(&hw->timeout_work) ||
- work_busy(&hw->timeout_work)) {
+ work_busy(&hw->timeout_work) ||
+ work_pending(&hw->timeout_work)) {
pr_err("%s mpeg12[%d] timeout_process return befor do anything.\n",__func__, vdec->id);
return;
}
(struct vdec_mpeg12_hw_s *)vdec->private;
if (hw->eos)
return 0;
- if (work_pending(&hw->work) ||
- work_busy(&hw->work) ||
- work_pending(&hw->timeout_work) ||
- work_busy(&hw->timeout_work)) {
+ if (hw->timeout_processing &&
+ (work_pending(&hw->work) || work_busy(&hw->work) ||
+ work_pending(&hw->timeout_work) || work_busy(&hw->timeout_work))) {
debug_print(DECODE_ID(hw), PRINT_FLAG_VDEC_STATUS,
"mpeg12 work pending,not ready for run.\n");
return 0;
if (hw->eos)
return 0;
- if (work_pending(&hw->work) ||
- work_busy(&hw->work)) {
- mmpeg4_debug_print(DECODE_ID(hw), PRINT_FLAG_VDEC_STATUS,
- "mpeg4 work pending,not ready for run.\n");
- return 0;
- }
if (vdec_stream_based(vdec) && (hw->init_flag == 0)
&& pre_decode_buf_level != 0) {
u32 rp, wp, level;
CODEC_MM_FLAGS_TVP : 0;
unsigned long ret = 0;
- if (work_pending(&hw->work) ||
- work_busy(&hw->work)) {
- av1_print(hw, PRINT_FLAG_VDEC_DETAIL,
- "av1 work pending,not ready for run.\n");
- return 0;
- }
if (!hw->pic_list_init_done2 || hw->eos)
return ret;