vmh264: fix error frame detect issue [1/1]
authorHui Zhang <hui.zhang@amlogic.com>
Sun, 29 Sep 2019 08:46:04 +0000 (16:46 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Wed, 16 Oct 2019 12:16:49 +0000 (05:16 -0700)
PD#SWPL-12967

Problem:
in frame mode, some pic miss stream data, which may cause
data_request from hw, but driver think it is data not comming
,not skip this error frame

Solution:
in frame mode, change data_reqest handle to pic_done. driver
will check if there is error with mb number. the error will
be detected

Verify:
AC-213

Change-Id: I186c6149fc6802fbd4636f4e02b1ea787fba85be
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c

index 32241458e715659e02da49acf7efb254e14b528b..0d8614460fca6bd3b6da7a8b6e13a98126a48ad2 100644 (file)
@@ -5710,7 +5710,8 @@ static irqreturn_t vh264_isr_thread_fn(struct vdec_s *vdec, int irq)
                hw->last_mby_mbx = 0;
                hw->last_vld_level = 0;
                start_process_time(hw);
-       } else if (dec_dpb_status == H264_PIC_DATA_DONE) {
+       } else if (dec_dpb_status == H264_PIC_DATA_DONE
+               ||((dec_dpb_status == H264_DATA_REQUEST) && input_frame_based(vdec))) {
 pic_done_proc:
                reset_process_time(hw);
 
@@ -5984,6 +5985,9 @@ empty_proc:
                                                (p_H264_Dpb->last_dpb_status == H264_PIC_DATA_DONE) ||
                                                ((p_H264_Dpb->last_dpb_status == H264_SLICE_HEAD_DONE) &&
                                                 (p_H264_Dpb->mSlice.slice_type != B_SLICE))) {
+                                                dpb_print(DECODE_ID(hw),
+                                                       PRINT_FLAG_ERROR, "%s last dpb status 0x%x need bugmgr reset \n",
+                                                       p_H264_Dpb->last_dpb_status, __func__);
                                                        hw->reset_bufmgr_flag = 1;
                                        }
                                }
@@ -6201,12 +6205,15 @@ static irqreturn_t vh264_isr(struct vdec_s *vdec, int irq)
 
 static void timeout_process(struct vdec_h264_hw_s *hw)
 {
+       struct h264_dpb_stru *p_H264_Dpb = &hw->dpb;
        hw->timeout_num++;
        amvdec_stop();
        if (hw->mmu_enable) {
                hevc_set_frame_done(hw);
                hevc_sao_wait_done(hw);
        }
+       if (!hw->i_only && (error_proc_policy & 0x2))
+               flush_dpb(p_H264_Dpb);
        dpb_print(DECODE_ID(hw),
                PRINT_FLAG_ERROR, "%s decoder timeout\n", __func__);
        release_cur_decoding_buf(hw);